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:
co-authored by
Alexander Bezobchuk
parent
b87f5934f5
commit
2e42f9cb74
@@ -86,7 +86,7 @@ Example:
|
||||
// ...
|
||||
}
|
||||
|
||||
bz := cdc.MustMarshalBinaryLengthPrefixed(ts)
|
||||
bz := cdc.MustMarshalBinaryBare(ts)
|
||||
```
|
||||
|
||||
However, modules can vary greatly in purpose and design and so we must support the ability for modules
|
||||
@@ -161,12 +161,12 @@ func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return c.Marshaler.MarshalBinaryLengthPrefixed(acc)
|
||||
return c.Marshaler.MarshalBinaryBare(acc)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ iterator := sdk.KVStorePrefixIterator(store, prefix) // proxy for store.Iterator
|
||||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var object types.Object
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &object)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &object)
|
||||
|
||||
if cb(object) {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user