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

feat: Add fee.{payer,granter} and tip fields to StdSignDoc #10348

Merged
merged 34 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6ec5722
Add IsTipper
amaury1093 Oct 7, 2021
6eb5a10
Use addr in signer data
amaury1093 Oct 7, 2021
72a56cb
Always populate addr in signer data
amaury1093 Oct 7, 2021
c0bd505
fi error messages
amaury1093 Oct 7, 2021
551f5f4
make proto gen
amaury1093 Oct 12, 2021
49987e7
Merge branch 'master' into am/0fee0gas
amaury1093 Oct 12, 2021
76b8dff
fix build
amaury1093 Oct 12, 2021
e285150
Add fields to sign docs and sign mode handler
amaury1093 Oct 12, 2021
3f04021
Remove getSequence
amaury1093 Oct 12, 2021
031b987
Merge branch 'am/0fee0gas' of ssh://github.com/cosmos/cosmos-sdk into…
amaury1093 Oct 12, 2021
a33a5cd
Update x/auth/migrations/legacytx/stdtx.go
amaury1093 Oct 12, 2021
a5d11b3
Update x/auth/migrations/legacytx/stdsign.go
amaury1093 Oct 12, 2021
894a7ce
Use addressCodec
amaury1093 Oct 12, 2021
6c66bfb
NewTxConfig with addrCdc
amaury1093 Oct 12, 2021
debee8d
REmove simapp.NewBech32
amaury1093 Oct 12, 2021
e3a7c35
Move bech32 stuff to x/auth/address
amaury1093 Oct 13, 2021
dfd1d82
Add changelog
amaury1093 Oct 13, 2021
7092ee8
Move address.Codec to x/auth
amaury1093 Oct 13, 2021
bac6349
Fix test
amaury1093 Oct 13, 2021
b5a18ea
Merge branch 'am/0fee0gas' of ssh://github.com/cosmos/cosmos-sdk into…
amaury1093 Oct 13, 2021
80b0637
Merge branch 'am/amino-tipper' of ssh://github.com/cosmos/cosmos-sdk …
amaury1093 Oct 13, 2021
ab495df
Add tests for tipper and feepayer
amaury1093 Oct 13, 2021
892bff4
Rename tests
amaury1093 Oct 13, 2021
2dd883c
Add more tests
amaury1093 Oct 13, 2021
07ef3e2
Empty tip test
amaury1093 Oct 13, 2021
34a4a89
Merge branch 'master' of ssh://github.com/cosmos/cosmos-sdk into am/a…
amaury1093 Oct 18, 2021
d5feed5
Revert unwanted files
amaury1093 Oct 18, 2021
0071f3c
Less line diff
amaury1093 Oct 18, 2021
df19e58
fix test
amaury1093 Oct 18, 2021
6c069d5
fix another test
amaury1093 Oct 18, 2021
7216370
Fix test
amaury1093 Oct 18, 2021
0fa4bc0
Update x/auth/migrations/legacytx/stdtx_test.go
amaury1093 Oct 19, 2021
7602d4d
Address reviews
amaury1093 Oct 22, 2021
6b9abab
Merge branch 'master' into am/amino-tipper
amaury1093 Oct 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address reviews
  • Loading branch information
amaury1093 committed Oct 22, 2021
commit 7602d4d61384c263b6f138a27fbd04f6821cbca7
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Move Baseapp panic recovery into a middleware.
* Rename simulation helper methods `baseapp.{Check,Deliver}` to `baseapp.Sim{Check,Deliver}**`.
* (x/gov) [\#10373](https://github.com/cosmos/cosmos-sdk/pull/10373) Removed gov `keeper.{MustMarshal, MustUnmarshal}`.
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
* [\#10348](https://github.com/cosmos/cosmos-sdk/pull/10348) StdSignBytes takes a new argument of type `*tx.Tip` for signing over tips using LEGACY_AMINO_JSON.


### Client Breaking Changes
Expand Down
5 changes: 0 additions & 5 deletions x/auth/migrations/legacytx/stdtx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,6 @@ func TestStdSignBytes(t *testing.T) {
args{"1234", 3, 6, 0, StdFee{Amount: defaultFee.Amount, Gas: defaultFee.Gas, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s","payer":"%s"},"memo":"memo","msgs":[["%s"]],"sequence":"6"}`, addr, addr, addr),
},
{
"no tip (omitempty)",
args{"1234", 3, 6, 0, StdFee{Amount: defaultFee.Amount, Gas: defaultFee.Gas, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil},
fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[["%s"]],"sequence":"6"}`, addr, addr),
},
{
"no fee, with tip",
args{"1234", 3, 6, 0, StdFee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip},
Expand Down
7 changes: 1 addition & 6 deletions x/auth/tx/legacy_amino_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
legacytx.StdSignBytes(chainId, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil),
},
{
"explicit fee payer and feegranter", addr1.String(),
"explicit fee payer and fee granter", addr1.String(),
func(w *wrapper) {
w.SetFeePayer(addr2)
w.SetFeeGranter(addr2)
Expand All @@ -80,11 +80,6 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) {
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainId, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip),
},
{
"signer which is not tipper", addr2.String(),
func(w *wrapper) { w.SetTip(tip) },
legacytx.StdSignBytes(chainId, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip),
},
}

handler := signModeLegacyAminoJSONHandler{}
Expand Down