Skip to content
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

Merged
merged 8 commits into from
Dec 5, 2018

Conversation

kjunu
Copy link
Contributor

@kjunu kjunu commented Dec 4, 2018

#16

 - 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()
Copy link
Member

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()?

Copy link
Contributor Author

@kjunu kjunu Dec 4, 2018

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(),
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashen1dev ashen1dev merged commit e8a88d3 into master Dec 5, 2018
@kjunu kjunu deleted the issue/16/decimal_support branch December 17, 2018 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants