-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fees #615
fees #615
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #615 +/- ##
===========================================
+ Coverage 62.42% 63.14% +0.72%
===========================================
Files 34 34
Lines 1948 1997 +49
===========================================
+ Hits 1216 1261 +45
- Misses 629 634 +5
+ Partials 103 102 -1 |
I like this. Only nitpick is that we should pass in the |
Rebased on #634 Just need to finish up some tests ! |
if !res.IsOK() { | ||
return ctx, res, true | ||
} | ||
} |
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.
get rid?
x/auth/ante.go
Outdated
return | ||
} | ||
|
||
// deduct the fee from the account | ||
func deductFees(acc sdk.Account, fee sdk.StdFee) (sdk.Account, sdk.Result) { |
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.
add note as to why not using coin keeper
x/auth/ante_test.go
Outdated
return sdk.Coins{ | ||
{"atom", 10000000}, | ||
} | ||
} |
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.
I'd consider getting rid of this function and just declaring coins each time, annoying to have to look it up doesn't even really save space because can define in one line ... newCoins()
isn't that much smaller than sdk.Coins{{atom, 1000}}
just more obscure
x/auth/ante_test.go
Outdated
}{ | ||
{"", []int64{1}, fee, msg, codeUnauth}, // test invalid chain_id | ||
{chainID, []int64{2}, fee, msg, codeUnauth}, // test wrong seqs | ||
{chainID, []int64{1}, fee, newTestMsg(addr2), codeUnauth}, // test wrong msg |
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.
test bad fee
x/auth/baseaccount_test.go
Outdated
|
||
assert.EqualValues(t, addr, acc.GetAddress()) | ||
// cant override pubkey |
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.
can't
x/auth/baseaccount_test.go
Outdated
|
||
err := acc.SetPubKey(pub) | ||
// cant override address |
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.
can't
x/auth/baseaccount_test.go
Outdated
acc := NewBaseAccountWithAddress(addr) | ||
|
||
assert.Panics(t, func() { acc.Get("key") }) | ||
assert.Panics(t, func() { acc.Set("key", "value") }) |
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.
could use more comments here - not totally obvious why this should panic... is there a case where it doesn't panic and can we include that?
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.
tests pass
#613
Also elements from #483 / #562
Currently it's just the data structures. Need to actually implement the logic and write tests still.
@sunnya97 @jaekwon any feedback ?