-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: cosmos-sdk v0.50 upgrade and multi zone enhancements (#27)
* feat: multi zone - plugin & reflection (#5) * added plugins feature and reflection features * fixed minor sdkTx variables issue * Roll back some changes on config.go * fixed makefile build command * improvements over lint * Added nolint ant changed variable name * fix .gitworkflow build * fix .gitworkflow build * Added makefile build plugin steps * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * gofumpt on project * skiped a test due to reliance on an experimental feature of cosmos v0.46.0-beta * build plugin before test * build plugin before test * fixed failing test * fix make test * added docs * small refactor on variable names * Zondax/feature/multi zone fix * added plugins feature and reflection features * fixed minor sdkTx variables issue * Roll back some changes on config.go * fixed makefile build command * improvements over lint * Added nolint ant changed variable name * fix .gitworkflow build * fix .gitworkflow build * Added makefile build plugin steps * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * added nolint on staticcheck on load.go * gofumpt on project * skiped a test due to reliance on an experimental feature of cosmos v0.46.0-beta * build plugin before test * build plugin before test * fixed failing test * fix make test * added docs * small refactor on variable names * Updated documentation and added --plugin flag * updated install step on README * lint fix * updated docs * updated go.sum (#8) * refactor: Upgrade rosetta to cosmos-sdk v0.50.0 (#7) * changed go.mod name, renamed dependencies on rosetta, adapted methods and uses of cosmos-sdk, upgraded dependencies * fixed all code errors * improvements over parsing * fees and gas parsing * remmoved validation on message due to deprecation (it should be validated on the server side) * solved issue on missing tx tipper * added codec types * fixed interface registre addr issue * improvements * fixed converter tests * commented plugin_test.go due to some modules not being available at v0.50 yet * improved code, moved parsing functions to utils.go * solved comments, fixed lint and added utils.go for parsing * fixed comment on cast variables * lint comments * Commented ibc-go dependdency until upgrade * added type assertion error handlinhg * updated go.sum * rename module for vanity url * update go.mod and go.sum
- Loading branch information
Showing
25 changed files
with
2,693 additions
and
266 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
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
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 |
---|---|---|
@@ -1,22 +1,38 @@ | ||
package rosetta | ||
|
||
import ( | ||
"cosmossdk.io/x/tx/signing" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/address" | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
txtypes "github.com/cosmos/cosmos-sdk/types/tx" | ||
authcodec "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
bankcodec "github.com/cosmos/cosmos-sdk/x/bank/types" | ||
"github.com/cosmos/gogoproto/proto" | ||
) | ||
|
||
// MakeCodec generates the codec required to interact | ||
// with the cosmos APIs used by the rosetta gateway | ||
func MakeCodec() (*codec.ProtoCodec, codectypes.InterfaceRegistry) { | ||
ir := codectypes.NewInterfaceRegistry() | ||
ir, _ := codectypes.NewInterfaceRegistryWithOptions(codectypes.InterfaceRegistryOptions{ | ||
ProtoFiles: proto.HybridResolver, | ||
SigningOptions: signing.Options{ | ||
AddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(), | ||
}, | ||
ValidatorAddressCodec: address.Bech32Codec{ | ||
Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(), | ||
}, | ||
}, | ||
}) | ||
cdc := codec.NewProtoCodec(ir) | ||
|
||
authcodec.RegisterInterfaces(ir) | ||
bankcodec.RegisterInterfaces(ir) | ||
cryptocodec.RegisterInterfaces(ir) | ||
txtypes.RegisterInterfaces(ir) | ||
|
||
return cdc, ir | ||
} |
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
Oops, something went wrong.