Favor marshal unmashal binare bare (#5799)

* change abci file to use BinaryBare

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper store.

* change all calls to EncodeLengthPrefixed to BinaryBare in slashing keeper store.

* update decoder test

* migrate decoder

* migrate gov simulation decoder

* migrate baseapp_test

* refactor QuerySubspace

* refactor coedc std codec

* migrate keybase

* migrate iavl store

* migrate root multi

* migrate ante basic

* migrate tx type to bare

* migrate auth client

* update auth types

* update decoder

* migrate supply decoder

* migrate stake encoding

* migrate staking simulation

* migrate genutil

* migrate simapp test helpers

* migrate docs

* upgrade changelog

* Update CHANGELOG.md

Co-Authored-By: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
This commit is contained in:
Jonathan Gimeno
2020-03-13 19:58:43 +00:00
committed by GitHub
co-authored by Alexander Bezobchuk
parent b87f5934f5
commit 2e42f9cb74
60 changed files with 199 additions and 199 deletions
+8 -8
View File
@@ -44,14 +44,14 @@ func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) {
return nil, err
}
return c.Marshaler.MarshalBinaryLengthPrefixed(acc)
return c.Marshaler.MarshalBinaryBare(acc)
}
// UnmarshalAccount returns an Account interface from raw encoded account bytes
// of a Proto-based Account type. An error is returned upon decoding failure.
func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) {
acc := &Account{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, acc); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil {
return nil, err
}
@@ -83,14 +83,14 @@ func (c *Codec) MarshalSupply(supplyI supplyexported.SupplyI) ([]byte, error) {
return nil, err
}
return c.Marshaler.MarshalBinaryLengthPrefixed(supply)
return c.Marshaler.MarshalBinaryBare(supply)
}
// UnmarshalSupply returns a SupplyI interface from raw encoded account bytes
// of a Proto-based SupplyI type. An error is returned upon decoding failure.
func (c *Codec) UnmarshalSupply(bz []byte) (supplyexported.SupplyI, error) {
supply := &Supply{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, supply); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, supply); err != nil {
return nil, err
}
@@ -122,7 +122,7 @@ func (c *Codec) MarshalEvidence(evidenceI eviexported.Evidence) ([]byte, error)
return nil, err
}
return c.Marshaler.MarshalBinaryLengthPrefixed(evidence)
return c.Marshaler.MarshalBinaryBare(evidence)
}
// UnmarshalEvidence returns an Evidence interface from raw encoded evidence
@@ -130,7 +130,7 @@ func (c *Codec) MarshalEvidence(evidenceI eviexported.Evidence) ([]byte, error)
// failure.
func (c *Codec) UnmarshalEvidence(bz []byte) (eviexported.Evidence, error) {
evidence := &Evidence{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, evidence); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, evidence); err != nil {
return nil, err
}
@@ -162,7 +162,7 @@ func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error) {
return nil, err
}
return c.Marshaler.MarshalBinaryLengthPrefixed(proposal)
return c.Marshaler.MarshalBinaryBare(proposal)
}
// UnmarshalProposal decodes a Proposal defined by the x/gov module and uses the
@@ -170,7 +170,7 @@ func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error) {
// to deserialize.
func (c *Codec) UnmarshalProposal(bz []byte) (gov.Proposal, error) {
proposal := &Proposal{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, proposal); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, proposal); err != nil {
return gov.Proposal{}, err
}