-
Notifications
You must be signed in to change notification settings - Fork 490
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
Minimum Account Balance in Algod #3287
Changes from 32 commits
c8e17b7
f247cbe
f8edde8
ee5451c
7e4daef
5dafabb
4ed0617
88544cf
d0cacfe
1f1fc88
bd90ea6
035432d
85de603
d6034e5
3bcb8bc
2139807
2b7a8b5
9edf2e0
aa2196b
4894d95
42adb53
7dd6db4
9c71612
5ecd5b0
277c6ce
395a6e4
992609b
d15fc97
5d20acb
c12a0ed
19ed866
19e2a40
084adf0
125bfbf
ae82da2
5efca2c
bb5d4a9
c50f1f8
af2acec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1354,7 +1354,8 @@ | |
"pending-rewards", | ||
"amount-without-pending-rewards", | ||
"rewards", | ||
"status" | ||
"status", | ||
"min-balance" | ||
], | ||
"properties": { | ||
"address": { | ||
|
@@ -1365,6 +1366,10 @@ | |
"description": "\\[algo\\] total number of MicroAlgos in the account", | ||
"type": "integer" | ||
}, | ||
"min-balance": { | ||
"description": "MicroAlgo balance required by the account.\n\nThe requirement starts at 100,000 and grows based on asset and application usage.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to drop off the numeric constants from the description. These values are consensus protocol dependent and can be modified in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
"type": "integer" | ||
}, | ||
"amount-without-pending-rewards": { | ||
"description": "specifies the amount of MicroAlgos in the account, without the pending rewards.", | ||
"type": "integer" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ func TestAccount(t *testing.T) { | |
b := a.WithUpdatedRewards(proto, 100) | ||
|
||
addr := basics.Address{}.String() | ||
conv, err := AccountDataToAccount(addr, &b, map[basics.AssetIndex]string{}, round, a.MicroAlgos) | ||
conv, err := AccountDataToAccount(addr, &b, map[basics.AssetIndex]string{}, round, &config.ConsensusParams{MinBalance: 100000}, a.MicroAlgos) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The minimum balance depends of a multiple fields from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
require.NoError(t, err) | ||
require.Equal(t, addr, conv.Address) | ||
require.Equal(t, b.MicroAlgos.Raw, conv.Amount) | ||
|
@@ -196,7 +196,7 @@ func TestAccount(t *testing.T) { | |
// convert the same account a few more times to make sure we always | ||
// produce the same generated.Account | ||
for i := 0; i < 10; i++ { | ||
anotherConv, err := AccountDataToAccount(addr, &b, map[basics.AssetIndex]string{}, round, a.MicroAlgos) | ||
anotherConv, err := AccountDataToAccount(addr, &b, map[basics.AssetIndex]string{}, round, &config.ConsensusParams{MinBalance: 100000}, a.MicroAlgos) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
require.NoError(t, err) | ||
|
||
require.Equal(t, protocol.EncodeJSON(conv), protocol.EncodeJSON(anotherConv)) | ||
|
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.
Adding a line to
goal account info
's output