-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change uint64 to bytes for supporting big number #18
Conversation
it's not compiled yet
- transaction's amount and price should be written in "string", not number format
@@ -155,7 +156,7 @@ func TestVerfiyFail(t *testing.T) { | |||
assert.NotNil(t, tx.Body.Sign, "failed to sign") | |||
|
|||
//edit tx after sign | |||
tx.Body.Amount = 0xff | |||
tx.Body.Amount = new(big.Int).SetUint64(0xff).Bytes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't big.NewInt(0xff).Bytes()
the same as new(big.Int).SetUint64(0xff).Bytes()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right 👍 I will fix :)
edit
it's different, Int vs Uint.
no need to use SetUint64 at that case, some others should use SetUint64
I changed all the value using macro.
} | ||
|
||
tx := &types.Tx{ | ||
Body: &types.TxBody{ | ||
Account: account, | ||
Recipient: []byte(types.AergoSystem), | ||
Amount: amount, | ||
Price: 0, | ||
Amount: amountBigInt.Bytes(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a question, what is the point of calling Bytes()? Is it to create a copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16