-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
register feegrant amino codec to support legacy service
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package feegrant | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
feegrant "github.com/cosmos/cosmos-sdk/x/feegrant/module" | ||
|
||
customtypes "github.com/terra-money/core/custom/feegrant/types" | ||
) | ||
|
||
var ( | ||
_ module.AppModuleBasic = AppModuleBasic{} | ||
) | ||
|
||
// AppModuleBasic defines the basic application module used by the distribution module. | ||
type AppModuleBasic struct { | ||
feegrant.AppModuleBasic | ||
} | ||
|
||
// RegisterLegacyAminoCodec registers the bank module's types for the given codec. | ||
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
customtypes.RegisterLegacyAminoCodec(cdc) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package types | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/x/feegrant" | ||
) | ||
|
||
// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types | ||
// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. | ||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | ||
cdc.RegisterInterface((*feegrant.FeeAllowanceI)(nil), nil) | ||
|
||
cdc.RegisterConcrete(&feegrant.MsgGrantAllowance{}, "feegrant/MsgGrantAllowance", nil) | ||
cdc.RegisterConcrete(&feegrant.MsgRevokeAllowance{}, "feegrant/MsgRevokeAllowance", nil) | ||
cdc.RegisterConcrete(&feegrant.BasicAllowance{}, "feegrant/BasicAllowance", nil) | ||
cdc.RegisterConcrete(&feegrant.PeriodicAllowance{}, "feegrant/PeriodicAllowance", nil) | ||
cdc.RegisterConcrete(&feegrant.AllowedMsgAllowance{}, "feegrant/AllowedMsgAllowance", nil) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"body":{"messages":[{"@type":"/cosmos.feegrant.v1beta1.MsgGrantAllowance","granter":"terra1t849fxw7e8ney35mxemh4h3ayea4zf77dslwna","grantee":"terra1ucp369yry6n70qq3zaxyt85cnug75r7ln8l6se","allowance":{"@type":"/cosmos.feegrant.v1beta1.BasicAllowance","spend_limit":[{"denom":"uluna","amount":"1000000"}],"expiration":"2022-01-01T00:00:00Z"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A4p3L23DzwwM6JnbLyY1xdgAl5ewiYPBQU+cD7Jzqwu7"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"12"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["sXJnHYbymwd3G0ax2gYMVt6K2m60YppZ5UYuM4TOkwkeTwFqcX0SR57cC5THRxnt47xJUif6N+aqXFUkg+Eh7w=="]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"terra1t849fxw7e8ney35mxemh4h3ayea4zf77dslwna","to_address":"terra18h5pmhrz45z2ne7lz4nfd7cdfwl3jfeu99e7a5","amount":[{"denom":"ukrw","amount":"1000000"}]}],"memo":"return gov deposits","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[{"denom":"ukrw","amount":"100"}],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]} | ||
{"body":{"messages":[{"@type":"/cosmos.feegrant.v1beta1.MsgGrantAllowance","granter":"terra1t849fxw7e8ney35mxemh4h3ayea4zf77dslwna","grantee":"terra1ucp369yry6n70qq3zaxyt85cnug75r7ln8l6se","allowance":{"@type":"/cosmos.feegrant.v1beta1.BasicAllowance","spend_limit":[{"denom":"uluna","amount":"1000000"}],"expiration":"2022-01-01T00:00:00Z"}}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]} |