-
Notifications
You must be signed in to change notification settings - Fork 80
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
refactor!: eliminate sdk codec dependency from remote mode #107
refactor!: eliminate sdk codec dependency from remote mode #107
Conversation
e7064a4
to
afd4cf8
Compare
type EncodingConfigBuilder func() appparams.EncodingConfig | ||
|
||
var ( | ||
ModuleBasics = module.NewBasicManager( | ||
auth.AppModuleBasic{}, | ||
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), | ||
bank.AppModuleBasic{}, | ||
capability.AppModuleBasic{}, | ||
staking.AppModuleBasic{}, | ||
mint.AppModuleBasic{}, | ||
distr.AppModuleBasic{}, | ||
gov.NewAppModuleBasic( | ||
[]govclient.ProposalHandler{ | ||
paramsclient.ProposalHandler, | ||
upgradeclient.LegacyProposalHandler, | ||
upgradeclient.LegacyCancelProposalHandler, | ||
}, | ||
), | ||
params.AppModuleBasic{}, | ||
crisis.AppModuleBasic{}, | ||
slashing.AppModuleBasic{}, | ||
feegrantmodule.AppModuleBasic{}, | ||
upgrade.AppModuleBasic{}, | ||
evidence.AppModuleBasic{}, | ||
authzmodule.AppModuleBasic{}, | ||
groupmodule.AppModuleBasic{}, | ||
vesting.AppModuleBasic{}, | ||
nftmodule.AppModuleBasic{}, | ||
consensus.AppModuleBasic{}, | ||
) | ||
) |
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.
Remove it, the Codec should be manually defined by users who wants to use local mode node.
@@ -49,7 +48,7 @@ type Database interface { | |||
|
|||
// SaveMessage stores a single message. | |||
// An error is returned if the operation fails. | |||
SaveMessage(msg *types.Message) error | |||
SaveMessage(height int64, txHash string, msg types.Message, addresses []string) error |
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.
Message is unmarshaled from TxBody which does not contain height
, txHash
and addresses
information, so I change the interface to include them.
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.
LGTM.
@dadamu just for me to understand better could you explain:
- What's a codec regarding transactions?
- How do you decide the data structure/layout your mapping to?
@0x7u Thanks for the review!
Currently, Cosmos-SDK handles the data in ProtoBuffer format. In addition, Codec is the encoder/decoder for ProtoBuffer, which is responsible to decode the raw data in ProtoBuffer format into the golang structure. This document tells more information. Currently, in order to transform all the message from ProtoBuffer into JSON to store inside
The structure/layout is following the Cosmos-SDK spec. Although the original structure is based on ProtoBuffer, so some |
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.
utACK
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! ✰ v Before smashing the submit button please review the checkboxes. v If a checkbox is n/a - please still include it but + a little note why ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> ## Description <!-- Small description --> This PR eliminate the codec dependency from remote node to make Juno chain-agnostic. ## Checklist - [x] Targeted PR against correct branch. - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Wrote unit tests. - [x] Re-reviewed `Files changed` in the Github PR explorer.
Description
This PR eliminate the codec dependency from remote node to make Juno chain-agnostic.
Checklist
Files changed
in the Github PR explorer.