Merge branch 'master' into bez/proto-client-init
This commit is contained in:
commit
f60cd5a2b5
|
@ -148,6 +148,7 @@ Buffers for state serialization instead of Amino.
|
|||
to define their own concrete `MsgSubmitProposal` types.
|
||||
* The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by
|
||||
requiring a concrete codec to know how to serialize `Proposal` types.
|
||||
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that is not needed.
|
||||
|
||||
### Improvements
|
||||
|
||||
|
|
|
@ -331,7 +331,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res
|
|||
return abci.ResponseQuery{
|
||||
Codespace: sdkerrors.RootCodespace,
|
||||
Height: req.Height,
|
||||
Value: codec.Cdc.MustMarshalBinaryLengthPrefixed(gInfo.GasUsed),
|
||||
Value: codec.Cdc.MustMarshalBinaryBare(gInfo.GasUsed),
|
||||
}
|
||||
|
||||
case "version":
|
||||
|
|
|
@ -386,7 +386,7 @@ func TestTxDecoder(t *testing.T) {
|
|||
|
||||
app := newBaseApp(t.Name())
|
||||
tx := newTxCounter(1, 0)
|
||||
txBytes := codec.MustMarshalBinaryLengthPrefixed(tx)
|
||||
txBytes := codec.MustMarshalBinaryBare(tx)
|
||||
|
||||
dTx, err := app.txDecoder(txBytes)
|
||||
require.NoError(t, err)
|
||||
|
@ -625,7 +625,7 @@ func testTxDecoder(cdc *codec.Codec) sdk.TxDecoder {
|
|||
return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "tx bytes are empty")
|
||||
}
|
||||
|
||||
err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &tx)
|
||||
err := cdc.UnmarshalBinaryBare(txBytes, &tx)
|
||||
if err != nil {
|
||||
return nil, sdkerrors.ErrTxDecode
|
||||
}
|
||||
|
@ -733,7 +733,7 @@ func TestCheckTx(t *testing.T) {
|
|||
|
||||
for i := int64(0); i < nTxs; i++ {
|
||||
tx := newTxCounter(i, 0)
|
||||
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := codec.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
r := app.CheckTx(abci.RequestCheckTx{Tx: txBytes})
|
||||
assert.True(t, r.IsOK(), fmt.Sprintf("%v", r))
|
||||
|
@ -787,7 +787,7 @@ func TestDeliverTx(t *testing.T) {
|
|||
counter := int64(blockN*txPerHeight + i)
|
||||
tx := newTxCounter(counter, counter)
|
||||
|
||||
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := codec.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -831,7 +831,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
|
|||
header := abci.Header{Height: 1}
|
||||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
tx := newTxCounter(0, 0, 1, 2)
|
||||
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := codec.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
|
@ -851,7 +851,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
|
|||
tx = newTxCounter(1, 3)
|
||||
tx.Msgs = append(tx.Msgs, msgCounter2{0})
|
||||
tx.Msgs = append(tx.Msgs, msgCounter2{1})
|
||||
txBytes, err = codec.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err = codec.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
|
@ -912,7 +912,7 @@ func TestSimulateTx(t *testing.T) {
|
|||
app.BeginBlock(abci.RequestBeginBlock{Header: header})
|
||||
|
||||
tx := newTxCounter(count, count)
|
||||
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := cdc.MarshalBinaryBare(tx)
|
||||
require.Nil(t, err)
|
||||
|
||||
// simulate a message, check gas reported
|
||||
|
@ -936,7 +936,7 @@ func TestSimulateTx(t *testing.T) {
|
|||
require.True(t, queryResult.IsOK(), queryResult.Log)
|
||||
|
||||
var res uint64
|
||||
err = codec.Cdc.UnmarshalBinaryLengthPrefixed(queryResult.Value, &res)
|
||||
err = codec.Cdc.UnmarshalBinaryBare(queryResult.Value, &res)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, gasConsumed, res)
|
||||
app.EndBlock(abci.RequestEndBlock{})
|
||||
|
@ -1036,7 +1036,7 @@ func TestRunInvalidTransaction(t *testing.T) {
|
|||
registerTestCodec(newCdc)
|
||||
newCdc.RegisterConcrete(&msgNoDecode{}, "cosmos-sdk/baseapp/msgNoDecode", nil)
|
||||
|
||||
txBytes, err := newCdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := newCdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -1259,7 +1259,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
|||
// the next txs ante handler execution (anteHandlerTxTest).
|
||||
tx := newTxCounter(0, 0)
|
||||
tx.setFailOnAnte(true)
|
||||
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := cdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
require.False(t, res.IsOK(), fmt.Sprintf("%v", res))
|
||||
|
@ -1273,7 +1273,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
|||
tx = newTxCounter(0, 0)
|
||||
tx.setFailOnHandler(true)
|
||||
|
||||
txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err = cdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -1288,7 +1288,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
|
|||
// implicitly checked by previous tx executions
|
||||
tx = newTxCounter(1, 0)
|
||||
|
||||
txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err = cdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -1359,7 +1359,7 @@ func TestGasConsumptionBadTx(t *testing.T) {
|
|||
|
||||
tx := newTxCounter(5, 0)
|
||||
tx.setFailOnAnte(true)
|
||||
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := cdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -1367,7 +1367,7 @@ func TestGasConsumptionBadTx(t *testing.T) {
|
|||
|
||||
// require next tx to fail due to black gas limit
|
||||
tx = newTxCounter(5, 0)
|
||||
txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err = cdc.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
@ -1529,7 +1529,7 @@ func TestWithRouter(t *testing.T) {
|
|||
counter := int64(blockN*txPerHeight + i)
|
||||
tx := newTxCounter(counter, counter)
|
||||
|
||||
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := codec.MarshalBinaryBare(tx)
|
||||
require.NoError(t, err)
|
||||
|
||||
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
|
||||
|
|
|
@ -64,7 +64,7 @@ func (ctx CLIContext) QuerySubspace(subspace []byte, storeName string) (res []sd
|
|||
return res, height, err
|
||||
}
|
||||
|
||||
ctx.Codec.MustUnmarshalBinaryLengthPrefixed(resRaw, &res)
|
||||
ctx.Codec.MustUnmarshalBinaryBare(resRaw, &res)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ func (kb baseKeybase) DecodeSignature(info Info, msg []byte) (sig []byte, pub tm
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
if err := CryptoCdc.UnmarshalBinaryLengthPrefixed([]byte(signed), sig); err != nil {
|
||||
if err := CryptoCdc.UnmarshalBinaryBare([]byte(signed), sig); err != nil {
|
||||
return nil, nil, errors.Wrap(err, "failed to decode signature")
|
||||
}
|
||||
|
||||
|
|
|
@ -337,12 +337,12 @@ func (i multiInfo) GetPath() (*hd.BIP44Params, error) {
|
|||
|
||||
// encoding info
|
||||
func marshalInfo(i Info) []byte {
|
||||
return CryptoCdc.MustMarshalBinaryLengthPrefixed(i)
|
||||
return CryptoCdc.MustMarshalBinaryBare(i)
|
||||
}
|
||||
|
||||
// decoding info
|
||||
func unmarshalInfo(bz []byte) (info Info, err error) {
|
||||
err = CryptoCdc.UnmarshalBinaryLengthPrefixed(bz, &info)
|
||||
err = CryptoCdc.UnmarshalBinaryBare(bz, &info)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
4
go.mod
4
go.mod
|
@ -28,9 +28,9 @@ require (
|
|||
github.com/tendermint/btcd v0.1.1
|
||||
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
|
||||
github.com/tendermint/go-amino v0.15.1
|
||||
github.com/tendermint/iavl v0.13.0
|
||||
github.com/tendermint/iavl v0.13.1
|
||||
github.com/tendermint/tendermint v0.33.2
|
||||
github.com/tendermint/tm-db v0.4.1
|
||||
github.com/tendermint/tm-db v0.5.0
|
||||
google.golang.org/protobuf v1.20.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.2.8
|
||||
)
|
||||
|
|
25
go.sum
25
go.sum
|
@ -12,7 +12,6 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX
|
|||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
|
||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
||||
github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
|
||||
github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
|
||||
|
@ -57,6 +56,7 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+
|
|||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
|
@ -91,7 +91,9 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1
|
|||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
|
||||
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=
|
||||
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
||||
|
@ -125,7 +127,6 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
|
|||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
|
||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
|
@ -137,6 +138,7 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
|
|||
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
|
@ -147,6 +149,7 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l
|
|||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
|
@ -343,7 +346,6 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx
|
|||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
|
||||
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/regen-network/cosmos-proto v0.1.1-0.20200213154359-02baa11ea7c2 h1:jQK1YoH972Aptd22YKgtNu5jM2X2xMGkyIENOAc71to=
|
||||
|
@ -374,7 +376,6 @@ github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M=
|
|||
github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs=
|
||||
github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
|
||||
|
@ -386,7 +387,6 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
|
|||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
|
||||
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
|
||||
github.com/spf13/viper v1.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E=
|
||||
github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
|
||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
|
@ -405,7 +405,6 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
|
|||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs=
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191017175515-d217d93fd4c5/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
|
||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
|
||||
github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s=
|
||||
|
@ -415,14 +414,13 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM
|
|||
github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso=
|
||||
github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ=
|
||||
github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
|
||||
github.com/tendermint/iavl v0.13.0 h1:r2sINvNFlJsLlLhGoqlqPlREWYkuK26BvMfkBt+XQnA=
|
||||
github.com/tendermint/iavl v0.13.0/go.mod h1:7nSUPdrsHEZ2nNZa+9gaIrcJciWd1jCQZXtcyARU82k=
|
||||
github.com/tendermint/tendermint v0.33.0/go.mod h1:s5UoymnPIY+GcA3mMte4P9gpMP8vS7UH7HBXikT1pHI=
|
||||
github.com/tendermint/iavl v0.13.1 h1:KWg3NVqOZLJFCLKpUJjUprdWAgIYdC9GDJLN8PBmKbI=
|
||||
github.com/tendermint/iavl v0.13.1/go.mod h1:vE1u0XAGXYjHykd4BLp8p/yivrw2PF1TuoljBcsQoGA=
|
||||
github.com/tendermint/tendermint v0.33.2 h1:NzvRMTuXJxqSsFed2J7uHmMU5N1CVzSpfi3nCc882KY=
|
||||
github.com/tendermint/tendermint v0.33.2/go.mod h1:25DqB7YvV1tN3tHsjWoc2vFtlwICfrub9XO6UBO+4xk=
|
||||
github.com/tendermint/tm-db v0.4.0/go.mod h1:+Cwhgowrf7NBGXmsqFMbwEtbo80XmyrlY5Jsk95JubQ=
|
||||
github.com/tendermint/tm-db v0.4.1 h1:TvX7JWjJOVZ+N3y+I86wddrGttOdMmmBxXcu0/Y7ZJ0=
|
||||
github.com/tendermint/tm-db v0.4.1/go.mod h1:JsJ6qzYkCGiGwm5GHl/H5GLI9XLb6qZX7PRe425dHAY=
|
||||
github.com/tendermint/tm-db v0.5.0 h1:qtM5UTr1dlRnHtDY6y7MZO5Di8XAE2j3lc/pCnKJ5hQ=
|
||||
github.com/tendermint/tm-db v0.5.0/go.mod h1:lSq7q5WRR/njf1LnhiZ/lIJHk2S8Y1Zyq5oP/3o9C2U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
|
@ -506,7 +504,6 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
@ -559,9 +556,11 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij
|
|||
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
|
||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4=
|
||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
|
|
|
@ -228,7 +228,7 @@ func SignCheckDeliver(
|
|||
priv...,
|
||||
)
|
||||
|
||||
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
txBytes, err := cdc.MarshalBinaryBare(tx)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Must simulate now as CheckTx doesn't run Msgs anymore
|
||||
|
|
|
@ -31,7 +31,7 @@ func TestGetSimulationLog(t *testing.T) {
|
|||
},
|
||||
{
|
||||
auth.StoreKey,
|
||||
[]tmkv.Pair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryLengthPrefixed(uint64(10))}},
|
||||
[]tmkv.Pair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryBare(uint64(10))}},
|
||||
"10",
|
||||
},
|
||||
{
|
||||
|
|
|
@ -312,7 +312,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
|
|||
}
|
||||
|
||||
iterator.Close()
|
||||
res.Value = cdc.MustMarshalBinaryLengthPrefixed(KVs)
|
||||
res.Value = cdc.MustMarshalBinaryBare(KVs)
|
||||
|
||||
default:
|
||||
return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path))
|
||||
|
|
|
@ -521,9 +521,9 @@ func TestIAVLStoreQuery(t *testing.T) {
|
|||
{Key: k1, Value: v3},
|
||||
{Key: k2, Value: v2},
|
||||
}
|
||||
valExpSubEmpty := cdc.MustMarshalBinaryLengthPrefixed(KVs0)
|
||||
valExpSub1 := cdc.MustMarshalBinaryLengthPrefixed(KVs1)
|
||||
valExpSub2 := cdc.MustMarshalBinaryLengthPrefixed(KVs2)
|
||||
valExpSubEmpty := cdc.MustMarshalBinaryBare(KVs0)
|
||||
valExpSub1 := cdc.MustMarshalBinaryBare(KVs1)
|
||||
valExpSub2 := cdc.MustMarshalBinaryBare(KVs2)
|
||||
|
||||
cid := iavlStore.Commit()
|
||||
ver := cid.Version
|
||||
|
|
|
@ -68,7 +68,7 @@ func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
|
|||
// XXX: a bit strange as we'll discard this, but it works
|
||||
var op MultiStoreProofOp
|
||||
|
||||
err := cdc.UnmarshalBinaryLengthPrefixed(pop.Data, &op)
|
||||
err := cdc.UnmarshalBinaryBare(pop.Data, &op)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decoding ProofOp.Data into MultiStoreProofOp: %w", err)
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
|
|||
// ProofOp return a merkle proof operation from a given multi-store proof
|
||||
// operation.
|
||||
func (op MultiStoreProofOp) ProofOp() merkle.ProofOp {
|
||||
bz := cdc.MustMarshalBinaryLengthPrefixed(op)
|
||||
bz := cdc.MustMarshalBinaryBare(op)
|
||||
return merkle.ProofOp{
|
||||
Type: ProofOpMultiStore,
|
||||
Key: op.key,
|
||||
|
|
|
@ -617,7 +617,7 @@ func getLatestVersion(db dbm.DB) int64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(latestBytes, &latest)
|
||||
err = cdc.UnmarshalBinaryBare(latestBytes, &latest)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -627,7 +627,7 @@ func getLatestVersion(db dbm.DB) int64 {
|
|||
|
||||
// Set the latest version.
|
||||
func setLatestVersion(batch dbm.Batch, version int64) {
|
||||
latestBytes, _ := cdc.MarshalBinaryLengthPrefixed(version)
|
||||
latestBytes, _ := cdc.MarshalBinaryBare(version)
|
||||
batch.Set([]byte(latestVersionKey), latestBytes)
|
||||
}
|
||||
|
||||
|
@ -668,7 +668,7 @@ func getCommitInfo(db dbm.DB, ver int64) (commitInfo, error) {
|
|||
|
||||
var cInfo commitInfo
|
||||
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(cInfoBytes, &cInfo)
|
||||
err = cdc.UnmarshalBinaryBare(cInfoBytes, &cInfo)
|
||||
if err != nil {
|
||||
return commitInfo{}, errors.Wrap(err, "failed to get store")
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ func getCommitInfo(db dbm.DB, ver int64) (commitInfo, error) {
|
|||
|
||||
// Set a commitInfo for given version.
|
||||
func setCommitInfo(batch dbm.Batch, version int64, cInfo commitInfo) {
|
||||
cInfoBytes := cdc.MustMarshalBinaryLengthPrefixed(cInfo)
|
||||
cInfoBytes := cdc.MustMarshalBinaryBare(cInfo)
|
||||
cInfoKey := fmt.Sprintf(commitInfoKeyFmt, version)
|
||||
batch.Set([]byte(cInfoKey), cInfoBytes)
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
|
|||
PubKey: pubkey.Bytes(),
|
||||
}
|
||||
|
||||
sigBz := codec.Cdc.MustMarshalBinaryLengthPrefixed(simSig)
|
||||
sigBz := codec.Cdc.MustMarshalBinaryBare(simSig)
|
||||
cost := sdk.Gas(len(sigBz) + 6)
|
||||
|
||||
// If the pubkey is a multi-signature pubkey, then we estimate for the maximum
|
||||
|
|
|
@ -31,7 +31,7 @@ $ <appcli> tx broadcast ./mytxn.json
|
|||
return
|
||||
}
|
||||
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryLengthPrefixed(stdTx)
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryBare(stdTx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ func runDecodeTxString(codec *amino.Codec) func(cmd *cobra.Command, args []strin
|
|||
}
|
||||
|
||||
var stdTx authtypes.StdTx
|
||||
err = cliCtx.Codec.UnmarshalBinaryLengthPrefixed(txBytes, &stdTx)
|
||||
err = cliCtx.Codec.UnmarshalBinaryBare(txBytes, &stdTx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ If you supply a dash (-) argument in place of an input filename, the command rea
|
|||
}
|
||||
|
||||
// re-encode it via the Amino wire protocol
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryLengthPrefixed(stdTx)
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryBare(stdTx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ func formatTxResult(cdc *codec.Codec, resTx *ctypes.ResultTx, resBlock *ctypes.R
|
|||
func parseTx(cdc *codec.Codec, txBytes []byte) (sdk.Tx, error) {
|
||||
var tx types.StdTx
|
||||
|
||||
err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &tx)
|
||||
err := cdc.UnmarshalBinaryBare(txBytes, &tx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ func BroadcastTxRequest(cliCtx context.CLIContext) http.HandlerFunc {
|
|||
return
|
||||
}
|
||||
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryLengthPrefixed(req.Tx)
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryBare(req.Tx)
|
||||
if err != nil {
|
||||
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
|
|
|
@ -46,7 +46,7 @@ func DecodeTxRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
|||
}
|
||||
|
||||
var stdTx authtypes.StdTx
|
||||
err = cliCtx.Codec.UnmarshalBinaryLengthPrefixed(txBytes, &stdTx)
|
||||
err = cliCtx.Codec.UnmarshalBinaryBare(txBytes, &stdTx)
|
||||
if err != nil {
|
||||
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
|
|
|
@ -35,7 +35,7 @@ func EncodeTxRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
|
|||
}
|
||||
|
||||
// re-encode it via the Amino wire protocol
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryLengthPrefixed(req)
|
||||
txBytes, err := cliCtx.Codec.MarshalBinaryBare(req)
|
||||
if err != nil {
|
||||
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
|
|
|
@ -289,7 +289,7 @@ func adjustGasEstimate(estimate uint64, adjustment float64) uint64 {
|
|||
|
||||
func parseQueryResponse(cdc *codec.Codec, rawRes []byte) (uint64, error) {
|
||||
var gasUsed uint64
|
||||
if err := cdc.UnmarshalBinaryLengthPrefixed(rawRes, &gasUsed); err != nil {
|
||||
if err := cdc.UnmarshalBinaryBare(rawRes, &gasUsed); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var (
|
|||
|
||||
func TestParseQueryResponse(t *testing.T) {
|
||||
cdc := makeCodec()
|
||||
sdkResBytes := cdc.MustMarshalBinaryLengthPrefixed(uint64(10))
|
||||
sdkResBytes := cdc.MustMarshalBinaryBare(uint64(10))
|
||||
gas, err := parseQueryResponse(cdc, sdkResBytes)
|
||||
assert.Equal(t, gas, uint64(10))
|
||||
assert.Nil(t, err)
|
||||
|
@ -39,7 +39,7 @@ func TestCalculateGas(t *testing.T) {
|
|||
if wantErr {
|
||||
return nil, 0, errors.New("")
|
||||
}
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(gasUsed), 0, nil
|
||||
return cdc.MustMarshalBinaryBare(gasUsed), 0, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 {
|
|||
} else {
|
||||
val := gogotypes.UInt64Value{}
|
||||
|
||||
err := ak.cdc.UnmarshalBinaryLengthPrefixed(bz, &val)
|
||||
err := ak.cdc.UnmarshalBinaryBare(bz, &val)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64 {
|
|||
accNumber = val.GetValue()
|
||||
}
|
||||
|
||||
bz = ak.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.UInt64Value{Value: accNumber + 1})
|
||||
bz = ak.cdc.MustMarshalBinaryBare(&gogotypes.UInt64Value{Value: accNumber + 1})
|
||||
store.Set(types.GlobalAccountNumberKey, bz)
|
||||
|
||||
return accNumber
|
||||
|
|
|
@ -22,8 +22,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
|
||||
case bytes.Equal(kvA.Key, types.GlobalAccountNumberKey):
|
||||
var globalAccNumberA, globalAccNumberB uint64
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &globalAccNumberA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &globalAccNumberB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &globalAccNumberA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &globalAccNumberB)
|
||||
return fmt.Sprintf("GlobalAccNumberA: %d\nGlobalAccNumberB: %d", globalAccNumberA, globalAccNumberB)
|
||||
|
||||
default:
|
||||
|
|
|
@ -34,7 +34,7 @@ func TestDecodeStore(t *testing.T) {
|
|||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.AddressStoreKey(delAddr1), Value: cdc.MustMarshalBinaryBare(acc)},
|
||||
tmkv.Pair{Key: types.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryLengthPrefixed(globalAccNumber)},
|
||||
tmkv.Pair{Key: types.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryBare(globalAccNumber)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
tests := []struct {
|
||||
|
|
|
@ -326,7 +326,7 @@ func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder {
|
|||
|
||||
// StdTx.Msg is an interface. The concrete types
|
||||
// are registered by MakeTxCodec
|
||||
err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &tx)
|
||||
err := cdc.UnmarshalBinaryBare(txBytes, &tx)
|
||||
if err != nil {
|
||||
return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, err.Error())
|
||||
}
|
||||
|
@ -338,6 +338,6 @@ func DefaultTxDecoder(cdc *codec.Codec) sdk.TxDecoder {
|
|||
// DefaultTxEncoder logic for standard transaction encoding
|
||||
func DefaultTxEncoder(cdc *codec.Codec) sdk.TxEncoder {
|
||||
return func(tx sdk.Tx) ([]byte, error) {
|
||||
return cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
return cdc.MarshalBinaryBare(tx)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ func TestDefaultTxEncoder(t *testing.T) {
|
|||
|
||||
tx := NewStdTx(msgs, fee, sigs, "")
|
||||
|
||||
cdcBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
|
||||
cdcBytes, err := cdc.MarshalBinaryBare(tx)
|
||||
|
||||
require.NoError(t, err)
|
||||
encoderBytes, err := encoder(tx)
|
||||
|
|
|
@ -50,14 +50,14 @@ func (k Keeper) GetFeePool(ctx sdk.Context) (feePool types.FeePool) {
|
|||
if b == nil {
|
||||
panic("Stored fee pool should not have been nil")
|
||||
}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &feePool)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &feePool)
|
||||
return
|
||||
}
|
||||
|
||||
// set the global fee pool distribution info
|
||||
func (k Keeper) SetFeePool(ctx sdk.Context, feePool types.FeePool) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&feePool)
|
||||
b := k.cdc.MustMarshalBinaryBare(&feePool)
|
||||
store.Set(types.FeePoolKey, b)
|
||||
}
|
||||
|
||||
|
@ -71,14 +71,14 @@ func (k Keeper) GetPreviousProposerConsAddr(ctx sdk.Context) sdk.ConsAddress {
|
|||
}
|
||||
|
||||
addrValue := gogotypes.BytesValue{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &addrValue)
|
||||
return sdk.ConsAddress(addrValue.GetValue())
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &addrValue)
|
||||
return addrValue.GetValue()
|
||||
}
|
||||
|
||||
// set the proposer public key for this block
|
||||
func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.BytesValue{Value: consAddr})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&gogotypes.BytesValue{Value: consAddr})
|
||||
store.Set(types.ProposerKey, bz)
|
||||
}
|
||||
|
||||
|
@ -86,14 +86,14 @@ func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAd
|
|||
func (k Keeper) GetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) (period types.DelegatorStartingInfo) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := store.Get(types.GetDelegatorStartingInfoKey(val, del))
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &period)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &period)
|
||||
return
|
||||
}
|
||||
|
||||
// set the starting info associated with a delegator
|
||||
func (k Keeper) SetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress, period types.DelegatorStartingInfo) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&period)
|
||||
b := k.cdc.MustMarshalBinaryBare(&period)
|
||||
store.Set(types.GetDelegatorStartingInfoKey(val, del), b)
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ func (k Keeper) IterateDelegatorStartingInfos(ctx sdk.Context, handler func(val
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var info types.DelegatorStartingInfo
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &info)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &info)
|
||||
val, del := types.GetDelegatorStartingInfoAddresses(iter.Key())
|
||||
if handler(val, del, info) {
|
||||
break
|
||||
|
@ -128,14 +128,14 @@ func (k Keeper) IterateDelegatorStartingInfos(ctx sdk.Context, handler func(val
|
|||
func (k Keeper) GetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64) (rewards types.ValidatorHistoricalRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := store.Get(types.GetValidatorHistoricalRewardsKey(val, period))
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &rewards)
|
||||
return
|
||||
}
|
||||
|
||||
// set historical rewards for a particular period
|
||||
func (k Keeper) SetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64, rewards types.ValidatorHistoricalRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&rewards)
|
||||
b := k.cdc.MustMarshalBinaryBare(&rewards)
|
||||
store.Set(types.GetValidatorHistoricalRewardsKey(val, period), b)
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ func (k Keeper) IterateValidatorHistoricalRewards(ctx sdk.Context, handler func(
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var rewards types.ValidatorHistoricalRewards
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &rewards)
|
||||
addr, period := types.GetValidatorHistoricalRewardsAddressPeriod(iter.Key())
|
||||
if handler(addr, period, rewards) {
|
||||
break
|
||||
|
@ -187,7 +187,7 @@ func (k Keeper) GetValidatorHistoricalReferenceCount(ctx sdk.Context) (count uin
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var rewards types.ValidatorHistoricalRewards
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &rewards)
|
||||
count += uint64(rewards.ReferenceCount)
|
||||
}
|
||||
return
|
||||
|
@ -197,14 +197,14 @@ func (k Keeper) GetValidatorHistoricalReferenceCount(ctx sdk.Context) (count uin
|
|||
func (k Keeper) GetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorCurrentRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := store.Get(types.GetValidatorCurrentRewardsKey(val))
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &rewards)
|
||||
return
|
||||
}
|
||||
|
||||
// set current rewards for a validator
|
||||
func (k Keeper) SetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorCurrentRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&rewards)
|
||||
b := k.cdc.MustMarshalBinaryBare(&rewards)
|
||||
store.Set(types.GetValidatorCurrentRewardsKey(val), b)
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ func (k Keeper) IterateValidatorCurrentRewards(ctx sdk.Context, handler func(val
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var rewards types.ValidatorCurrentRewards
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &rewards)
|
||||
addr := types.GetValidatorCurrentRewardsAddress(iter.Key())
|
||||
if handler(addr, rewards) {
|
||||
break
|
||||
|
@ -236,7 +236,7 @@ func (k Keeper) GetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAd
|
|||
if b == nil {
|
||||
return types.ValidatorAccumulatedCommission{}
|
||||
}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &commission)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &commission)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -246,9 +246,9 @@ func (k Keeper) SetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAd
|
|||
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
if commission.Commission.IsZero() {
|
||||
bz = k.cdc.MustMarshalBinaryLengthPrefixed(&types.ValidatorAccumulatedCommission{})
|
||||
bz = k.cdc.MustMarshalBinaryBare(&types.ValidatorAccumulatedCommission{})
|
||||
} else {
|
||||
bz = k.cdc.MustMarshalBinaryLengthPrefixed(&commission)
|
||||
bz = k.cdc.MustMarshalBinaryBare(&commission)
|
||||
}
|
||||
|
||||
store.Set(types.GetValidatorAccumulatedCommissionKey(val), bz)
|
||||
|
@ -267,7 +267,7 @@ func (k Keeper) IterateValidatorAccumulatedCommissions(ctx sdk.Context, handler
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var commission types.ValidatorAccumulatedCommission
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &commission)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &commission)
|
||||
addr := types.GetValidatorAccumulatedCommissionAddress(iter.Key())
|
||||
if handler(addr, commission) {
|
||||
break
|
||||
|
@ -279,14 +279,14 @@ func (k Keeper) IterateValidatorAccumulatedCommissions(ctx sdk.Context, handler
|
|||
func (k Keeper) GetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorOutstandingRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := store.Get(types.GetValidatorOutstandingRewardsKey(val))
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &rewards)
|
||||
return
|
||||
}
|
||||
|
||||
// set validator outstanding rewards
|
||||
func (k Keeper) SetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorOutstandingRewards) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&rewards)
|
||||
b := k.cdc.MustMarshalBinaryBare(&rewards)
|
||||
store.Set(types.GetValidatorOutstandingRewardsKey(val), b)
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ func (k Keeper) IterateValidatorOutstandingRewards(ctx sdk.Context, handler func
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
rewards := types.ValidatorOutstandingRewards{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &rewards)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &rewards)
|
||||
addr := types.GetValidatorOutstandingRewardsAddress(iter.Key())
|
||||
if handler(addr, rewards) {
|
||||
break
|
||||
|
@ -318,14 +318,14 @@ func (k Keeper) GetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, heig
|
|||
if b == nil {
|
||||
return types.ValidatorSlashEvent{}, false
|
||||
}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &event)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &event)
|
||||
return event, true
|
||||
}
|
||||
|
||||
// set slash event for height
|
||||
func (k Keeper) SetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, height, period uint64, event types.ValidatorSlashEvent) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&event)
|
||||
b := k.cdc.MustMarshalBinaryBare(&event)
|
||||
store.Set(types.GetValidatorSlashEventKey(val, height, period), b)
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ func (k Keeper) IterateValidatorSlashEventsBetween(ctx sdk.Context, val sdk.ValA
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var event types.ValidatorSlashEvent
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &event)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &event)
|
||||
_, height := types.GetValidatorSlashEventAddressHeight(iter.Key())
|
||||
if handler(height, event) {
|
||||
break
|
||||
|
@ -355,7 +355,7 @@ func (k Keeper) IterateValidatorSlashEvents(ctx sdk.Context, handler func(val sd
|
|||
defer iter.Close()
|
||||
for ; iter.Valid(); iter.Next() {
|
||||
var event types.ValidatorSlashEvent
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &event)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &event)
|
||||
val, height := types.GetValidatorSlashEventAddressHeight(iter.Key())
|
||||
if handler(val, height, event) {
|
||||
break
|
||||
|
|
|
@ -16,8 +16,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], types.FeePoolKey):
|
||||
var feePoolA, feePoolB types.FeePool
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &feePoolA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &feePoolB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &feePoolA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &feePoolB)
|
||||
return fmt.Sprintf("%v\n%v", feePoolA, feePoolB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ProposerKey):
|
||||
|
@ -25,8 +25,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorOutstandingRewardsPrefix):
|
||||
var rewardsA, rewardsB types.ValidatorOutstandingRewards
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &rewardsB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &rewardsB)
|
||||
return fmt.Sprintf("%v\n%v", rewardsA, rewardsB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.DelegatorWithdrawAddrPrefix):
|
||||
|
@ -34,32 +34,32 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
|
||||
case bytes.Equal(kvA.Key[:1], types.DelegatorStartingInfoPrefix):
|
||||
var infoA, infoB types.DelegatorStartingInfo
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &infoA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &infoB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &infoA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &infoB)
|
||||
return fmt.Sprintf("%v\n%v", infoA, infoB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorHistoricalRewardsPrefix):
|
||||
var rewardsA, rewardsB types.ValidatorHistoricalRewards
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &rewardsB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &rewardsB)
|
||||
return fmt.Sprintf("%v\n%v", rewardsA, rewardsB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorCurrentRewardsPrefix):
|
||||
var rewardsA, rewardsB types.ValidatorCurrentRewards
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &rewardsB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &rewardsA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &rewardsB)
|
||||
return fmt.Sprintf("%v\n%v", rewardsA, rewardsB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorAccumulatedCommissionPrefix):
|
||||
var commissionA, commissionB types.ValidatorAccumulatedCommission
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &commissionA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &commissionB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &commissionA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &commissionB)
|
||||
return fmt.Sprintf("%v\n%v", commissionA, commissionB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorSlashEventPrefix):
|
||||
var eventA, eventB types.ValidatorSlashEvent
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &eventA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &eventB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &eventA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &eventB)
|
||||
return fmt.Sprintf("%v\n%v", eventA, eventB)
|
||||
|
||||
default:
|
||||
|
|
|
@ -43,15 +43,15 @@ func TestDecodeDistributionStore(t *testing.T) {
|
|||
slashEvent := types.NewValidatorSlashEvent(10, sdk.OneDec())
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.FeePoolKey, Value: cdc.MustMarshalBinaryLengthPrefixed(feePool)},
|
||||
tmkv.Pair{Key: types.FeePoolKey, Value: cdc.MustMarshalBinaryBare(feePool)},
|
||||
tmkv.Pair{Key: types.ProposerKey, Value: consAddr1.Bytes()},
|
||||
tmkv.Pair{Key: types.GetValidatorOutstandingRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(outstanding)},
|
||||
tmkv.Pair{Key: types.GetValidatorOutstandingRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(outstanding)},
|
||||
tmkv.Pair{Key: types.GetDelegatorWithdrawAddrKey(delAddr1), Value: delAddr1.Bytes()},
|
||||
tmkv.Pair{Key: types.GetDelegatorStartingInfoKey(valAddr1, delAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(info)},
|
||||
tmkv.Pair{Key: types.GetValidatorHistoricalRewardsKey(valAddr1, 100), Value: cdc.MustMarshalBinaryLengthPrefixed(historicalRewards)},
|
||||
tmkv.Pair{Key: types.GetValidatorCurrentRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(currentRewards)},
|
||||
tmkv.Pair{Key: types.GetValidatorAccumulatedCommissionKey(valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(commission)},
|
||||
tmkv.Pair{Key: types.GetValidatorSlashEventKeyPrefix(valAddr1, 13), Value: cdc.MustMarshalBinaryLengthPrefixed(slashEvent)},
|
||||
tmkv.Pair{Key: types.GetDelegatorStartingInfoKey(valAddr1, delAddr1), Value: cdc.MustMarshalBinaryBare(info)},
|
||||
tmkv.Pair{Key: types.GetValidatorHistoricalRewardsKey(valAddr1, 100), Value: cdc.MustMarshalBinaryBare(historicalRewards)},
|
||||
tmkv.Pair{Key: types.GetValidatorCurrentRewardsKey(valAddr1), Value: cdc.MustMarshalBinaryBare(currentRewards)},
|
||||
tmkv.Pair{Key: types.GetValidatorAccumulatedCommissionKey(valAddr1), Value: cdc.MustMarshalBinaryBare(commission)},
|
||||
tmkv.Pair{Key: types.GetValidatorSlashEventKeyPrefix(valAddr1, 13), Value: cdc.MustMarshalBinaryBare(slashEvent)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ func DeliverGenTxs(
|
|||
var tx authtypes.StdTx
|
||||
cdc.MustUnmarshalJSON(genTx, &tx)
|
||||
|
||||
bz := cdc.MustMarshalBinaryLengthPrefixed(tx)
|
||||
bz := cdc.MustMarshalBinaryBare(tx)
|
||||
|
||||
res := deliverTx(abci.RequestDeliverTx{Tx: bz})
|
||||
if !res.IsOK() {
|
||||
|
|
|
@ -137,9 +137,9 @@ func TestGetPaginatedVotes(t *testing.T) {
|
|||
cdc = newTestCodec()
|
||||
)
|
||||
for i := range tc.txs {
|
||||
tx, err := cdc.MarshalBinaryLengthPrefixed(&tc.txs[i])
|
||||
tx, err := cdc.MarshalBinaryBare(&tc.txs[i])
|
||||
require.NoError(t, err)
|
||||
marshalled[i] = tmtypes.Tx(tx)
|
||||
marshalled[i] = tx
|
||||
}
|
||||
client := TxSearchMock{txs: marshalled}
|
||||
ctx := context.CLIContext{}.WithCodec(cdc).WithTrustNode(true).WithClient(client)
|
||||
|
|
|
@ -16,14 +16,14 @@ func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAdd
|
|||
return deposit, false
|
||||
}
|
||||
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &deposit)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(bz, &deposit)
|
||||
return deposit, true
|
||||
}
|
||||
|
||||
// SetDeposit sets a Deposit to the gov store
|
||||
func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit) {
|
||||
store := ctx.KVStore(keeper.storeKey)
|
||||
bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(&deposit)
|
||||
bz := keeper.cdc.MustMarshalBinaryBare(&deposit)
|
||||
store.Set(types.DepositKey(deposit.ProposalID, deposit.Depositor), bz)
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit types.D
|
|||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var deposit types.Deposit
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &deposit)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &deposit)
|
||||
|
||||
if cb(deposit) {
|
||||
break
|
||||
|
@ -84,7 +84,7 @@ func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func
|
|||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var deposit types.Deposit
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &deposit)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &deposit)
|
||||
|
||||
if cb(deposit) {
|
||||
break
|
||||
|
|
|
@ -62,14 +62,14 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A
|
|||
return vote, false
|
||||
}
|
||||
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &vote)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(bz, &vote)
|
||||
return vote, true
|
||||
}
|
||||
|
||||
// SetVote sets a Vote to the gov store
|
||||
func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) {
|
||||
store := ctx.KVStore(keeper.storeKey)
|
||||
bz := keeper.cdc.MustMarshalBinaryLengthPrefixed(&vote)
|
||||
bz := keeper.cdc.MustMarshalBinaryBare(&vote)
|
||||
store.Set(types.VoteKey(vote.ProposalID, vote.Voter), bz)
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) (
|
|||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var vote types.Vote
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &vote)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &vote)
|
||||
|
||||
if cb(vote) {
|
||||
break
|
||||
|
@ -97,7 +97,7 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo
|
|||
defer iterator.Close()
|
||||
for ; iterator.Valid(); iterator.Next() {
|
||||
var vote types.Vote
|
||||
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &vote)
|
||||
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &vote)
|
||||
|
||||
if cb(vote) {
|
||||
break
|
||||
|
|
|
@ -16,8 +16,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], types.ProposalsKeyPrefix):
|
||||
var proposalA, proposalB types.Proposal
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &proposalA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &proposalB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &proposalA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &proposalB)
|
||||
return fmt.Sprintf("%v\n%v", proposalA, proposalB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ActiveProposalQueuePrefix),
|
||||
|
@ -29,14 +29,14 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
|
||||
case bytes.Equal(kvA.Key[:1], types.DepositsKeyPrefix):
|
||||
var depositA, depositB types.Deposit
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &depositA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &depositB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &depositA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &depositB)
|
||||
return fmt.Sprintf("%v\n%v", depositA, depositB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.VotesKeyPrefix):
|
||||
var voteA, voteB types.Vote
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &voteA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &voteB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &voteA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &voteB)
|
||||
return fmt.Sprintf("%v\n%v", voteA, voteB)
|
||||
|
||||
default:
|
||||
|
|
|
@ -42,10 +42,10 @@ func TestDecodeStore(t *testing.T) {
|
|||
vote := types.NewVote(1, delAddr1, types.OptionYes)
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.ProposalKey(1), Value: cdc.MustMarshalBinaryLengthPrefixed(proposal)},
|
||||
tmkv.Pair{Key: types.ProposalKey(1), Value: cdc.MustMarshalBinaryBare(proposal)},
|
||||
tmkv.Pair{Key: types.InactiveProposalQueueKey(1, endTime), Value: proposalIDBz},
|
||||
tmkv.Pair{Key: types.DepositKey(1, delAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(deposit)},
|
||||
tmkv.Pair{Key: types.VoteKey(1, delAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(vote)},
|
||||
tmkv.Pair{Key: types.DepositKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(deposit)},
|
||||
tmkv.Pair{Key: types.VoteKey(1, delAddr1), Value: cdc.MustMarshalBinaryBare(vote)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
|
||||
|
|
|
@ -57,14 +57,14 @@ func (k Keeper) GetMinter(ctx sdk.Context) (minter types.Minter) {
|
|||
panic("stored minter should not have been nil")
|
||||
}
|
||||
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &minter)
|
||||
k.cdc.MustUnmarshalBinaryBare(b, &minter)
|
||||
return
|
||||
}
|
||||
|
||||
// set the minter
|
||||
func (k Keeper) SetMinter(ctx sdk.Context, minter types.Minter) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
b := k.cdc.MustMarshalBinaryLengthPrefixed(&minter)
|
||||
b := k.cdc.MustMarshalBinaryBare(&minter)
|
||||
store.Set(types.MinterKey, b)
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key, types.MinterKey):
|
||||
var minterA, minterB types.Minter
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &minterA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &minterB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &minterA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &minterB)
|
||||
return fmt.Sprintf("%v\n%v", minterA, minterB)
|
||||
default:
|
||||
panic(fmt.Sprintf("invalid mint key %X", kvA.Key))
|
||||
|
|
|
@ -24,7 +24,7 @@ func TestDecodeStore(t *testing.T) {
|
|||
minter := types.NewMinter(sdk.OneDec(), sdk.NewDec(15))
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.MinterKey, Value: cdc.MustMarshalBinaryLengthPrefixed(minter)},
|
||||
tmkv.Pair{Key: types.MinterKey, Value: cdc.MustMarshalBinaryBare(minter)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
tests := []struct {
|
||||
|
|
|
@ -53,7 +53,7 @@ func (k Keeper) GetPubkey(ctx sdk.Context, address crypto.Address) (crypto.PubKe
|
|||
store := ctx.KVStore(k.storeKey)
|
||||
|
||||
var pubkey gogotypes.StringValue
|
||||
err := k.cdc.UnmarshalBinaryLengthPrefixed(store.Get(types.GetAddrPubkeyRelationKey(address)), &pubkey)
|
||||
err := k.cdc.UnmarshalBinaryBare(store.Get(types.GetAddrPubkeyRelationKey(address)), &pubkey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("address %s not found", sdk.ConsAddress(address))
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ func (k Keeper) Jail(ctx sdk.Context, consAddr sdk.ConsAddress) {
|
|||
func (k Keeper) setAddrPubkeyRelation(ctx sdk.Context, addr crypto.Address, pubkey string) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.StringValue{Value: pubkey})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&gogotypes.StringValue{Value: pubkey})
|
||||
store.Set(types.GetAddrPubkeyRelationKey(addr), bz)
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ func (k Keeper) GetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress
|
|||
found = false
|
||||
return
|
||||
}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &info)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &info)
|
||||
found = true
|
||||
return
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ func (k Keeper) HasValidatorSigningInfo(ctx sdk.Context, consAddr sdk.ConsAddres
|
|||
// SetValidatorSigningInfo sets the validator signing info to a consensus address key
|
||||
func (k Keeper) SetValidatorSigningInfo(ctx sdk.Context, address sdk.ConsAddress, info types.ValidatorSigningInfo) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&info)
|
||||
bz := k.cdc.MustMarshalBinaryBare(&info)
|
||||
store.Set(types.GetValidatorSigningInfoKey(address), bz)
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ func (k Keeper) IterateValidatorSigningInfos(ctx sdk.Context,
|
|||
for ; iter.Valid(); iter.Next() {
|
||||
address := types.GetValidatorSigningInfoAddress(iter.Key())
|
||||
var info types.ValidatorSigningInfo
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), &info)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), &info)
|
||||
if handler(address, info) {
|
||||
break
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ func (k Keeper) GetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.Con
|
|||
// lazy: treat empty key as not missed
|
||||
return false
|
||||
}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &missed)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &missed)
|
||||
|
||||
return missed.Value
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ func (k Keeper) IterateValidatorMissedBlockBitArray(ctx sdk.Context,
|
|||
continue
|
||||
}
|
||||
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &missed)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &missed)
|
||||
if handler(index, missed.Value) {
|
||||
break
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ func (k Keeper) IsTombstoned(ctx sdk.Context, consAddr sdk.ConsAddress) bool {
|
|||
// missed a block in the current window
|
||||
func (k Keeper) SetValidatorMissedBlockBitArray(ctx sdk.Context, address sdk.ConsAddress, index int64, missed bool) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.BoolValue{Value: missed})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&gogotypes.BoolValue{Value: missed})
|
||||
store.Set(types.GetValidatorMissedBlockBitArrayKey(address, index), bz)
|
||||
}
|
||||
|
||||
|
|
|
@ -18,20 +18,20 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorSigningInfoKey):
|
||||
var infoA, infoB types.ValidatorSigningInfo
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &infoA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &infoB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &infoA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &infoB)
|
||||
return fmt.Sprintf("%v\n%v", infoA, infoB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorMissedBlockBitArrayKey):
|
||||
var missedA, missedB gogotypes.BoolValue
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &missedA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &missedB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &missedA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &missedB)
|
||||
return fmt.Sprintf("missedA: %v\nmissedB: %v", missedA.Value, missedB.Value)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.AddrPubkeyRelationKey):
|
||||
var pubKeyA, pubKeyB crypto.PubKey
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &pubKeyA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &pubKeyB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &pubKeyA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &pubKeyB)
|
||||
bechPKA := sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKeyA)
|
||||
bechPKB := sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, pubKeyB)
|
||||
return fmt.Sprintf("PubKeyA: %s\nPubKeyB: %s", bechPKA, bechPKB)
|
||||
|
|
|
@ -41,9 +41,9 @@ func TestDecodeStore(t *testing.T) {
|
|||
missed := gogotypes.BoolValue{Value: true}
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.GetValidatorSigningInfoKey(consAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(info)},
|
||||
tmkv.Pair{Key: types.GetValidatorMissedBlockBitArrayKey(consAddr1, 6), Value: cdc.MustMarshalBinaryLengthPrefixed(&missed)},
|
||||
tmkv.Pair{Key: types.GetAddrPubkeyRelationKey(delAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(delPk1)},
|
||||
tmkv.Pair{Key: types.GetValidatorSigningInfoKey(consAddr1), Value: cdc.MustMarshalBinaryBare(info)},
|
||||
tmkv.Pair{Key: types.GetValidatorMissedBlockBitArrayKey(consAddr1, 6), Value: cdc.MustMarshalBinaryBare(&missed)},
|
||||
tmkv.Pair{Key: types.GetAddrPubkeyRelationKey(delAddr1), Value: cdc.MustMarshalBinaryBare(delPk1)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,6 @@ func (i ValidatorSigningInfo) String() string {
|
|||
|
||||
// unmarshal a validator signing info from a store value
|
||||
func UnmarshalValSigningInfo(cdc codec.Marshaler, value []byte) (signingInfo ValidatorSigningInfo, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &signingInfo)
|
||||
err = cdc.UnmarshalBinaryBare(value, &signingInfo)
|
||||
return signingInfo, err
|
||||
}
|
||||
|
|
|
@ -223,14 +223,14 @@ func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPa
|
|||
}
|
||||
|
||||
pairs := types.DVPairs{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &pairs)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &pairs)
|
||||
return pairs.Pairs
|
||||
}
|
||||
|
||||
// Sets a specific unbonding queue timeslice.
|
||||
func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVPair) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&types.DVPairs{Pairs: keys})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&types.DVPairs{Pairs: keys})
|
||||
store.Set(types.GetUnbondingDelegationTimeKey(timestamp), bz)
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (m
|
|||
for ; unbondingTimesliceIterator.Valid(); unbondingTimesliceIterator.Next() {
|
||||
timeslice := types.DVPairs{}
|
||||
value := unbondingTimesliceIterator.Value()
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(value, ×lice)
|
||||
k.cdc.MustUnmarshalBinaryBare(value, ×lice)
|
||||
|
||||
matureUnbonds = append(matureUnbonds, timeslice.Pairs...)
|
||||
store.Delete(unbondingTimesliceIterator.Key())
|
||||
|
@ -412,14 +412,14 @@ func (k Keeper) GetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Ti
|
|||
}
|
||||
|
||||
triplets := types.DVVTriplets{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &triplets)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &triplets)
|
||||
return triplets.Triplets
|
||||
}
|
||||
|
||||
// Sets a specific redelegation queue timeslice.
|
||||
func (k Keeper) SetRedelegationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DVVTriplet) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&types.DVVTriplets{Triplets: keys})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&types.DVVTriplets{Triplets: keys})
|
||||
store.Set(types.GetRedelegationTimeKey(timestamp), bz)
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ func (k Keeper) DequeueAllMatureRedelegationQueue(ctx sdk.Context, currTime time
|
|||
for ; redelegationTimesliceIterator.Valid(); redelegationTimesliceIterator.Next() {
|
||||
timeslice := types.DVVTriplets{}
|
||||
value := redelegationTimesliceIterator.Value()
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(value, ×lice)
|
||||
k.cdc.MustUnmarshalBinaryBare(value, ×lice)
|
||||
|
||||
matureRedelegations = append(matureRedelegations, timeslice.Triplets...)
|
||||
store.Delete(redelegationTimesliceIterator.Key())
|
||||
|
|
|
@ -85,13 +85,13 @@ func (k Keeper) GetLastTotalPower(ctx sdk.Context) sdk.Int {
|
|||
}
|
||||
|
||||
ip := sdk.IntProto{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &ip)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &ip)
|
||||
return ip.Int
|
||||
}
|
||||
|
||||
// Set the last total validator power.
|
||||
func (k Keeper) SetLastTotalPower(ctx sdk.Context, power sdk.Int) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&sdk.IntProto{Int: power})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&sdk.IntProto{Int: power})
|
||||
store.Set(types.LastTotalPowerKey, bz)
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab
|
|||
oldPowerBytes, found := last[valAddrBytes]
|
||||
|
||||
newPower := validator.ConsensusPower()
|
||||
newPowerBytes := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.Int64Value{Value: newPower})
|
||||
newPowerBytes := k.cdc.MustMarshalBinaryBare(&gogotypes.Int64Value{Value: newPower})
|
||||
|
||||
// update the validator set if power has changed
|
||||
if !found || !bytes.Equal(oldPowerBytes, newPowerBytes) {
|
||||
|
|
|
@ -278,14 +278,14 @@ func (k Keeper) GetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress)
|
|||
}
|
||||
|
||||
intV := gogotypes.Int64Value{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &intV)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &intV)
|
||||
return intV.GetValue()
|
||||
}
|
||||
|
||||
// Set the last validator power.
|
||||
func (k Keeper) SetLastValidatorPower(ctx sdk.Context, operator sdk.ValAddress, power int64) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&gogotypes.Int64Value{Value: power})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&gogotypes.Int64Value{Value: power})
|
||||
store.Set(types.GetLastValidatorPowerKey(operator), bz)
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, handler func(operato
|
|||
addr := sdk.ValAddress(iter.Key()[len(types.LastValidatorPowerKey):])
|
||||
intV := &gogotypes.Int64Value{}
|
||||
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(iter.Value(), intV)
|
||||
k.cdc.MustUnmarshalBinaryBare(iter.Value(), intV)
|
||||
if handler(addr, intV.GetValue()) {
|
||||
break
|
||||
}
|
||||
|
@ -358,14 +358,14 @@ func (k Keeper) GetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time)
|
|||
}
|
||||
|
||||
va := sdk.ValAddresses{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(bz, &va)
|
||||
k.cdc.MustUnmarshalBinaryBare(bz, &va)
|
||||
return va.Addresses
|
||||
}
|
||||
|
||||
// Sets a specific validator queue timeslice.
|
||||
func (k Keeper) SetValidatorQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []sdk.ValAddress) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
bz := k.cdc.MustMarshalBinaryLengthPrefixed(&sdk.ValAddresses{Addresses: keys})
|
||||
bz := k.cdc.MustMarshalBinaryBare(&sdk.ValAddresses{Addresses: keys})
|
||||
store.Set(types.GetValidatorQueueTimeKey(timestamp), bz)
|
||||
}
|
||||
|
||||
|
@ -413,7 +413,7 @@ func (k Keeper) GetAllMatureValidatorQueue(ctx sdk.Context, currTime time.Time)
|
|||
|
||||
for ; validatorTimesliceIterator.Valid(); validatorTimesliceIterator.Next() {
|
||||
timeslice := sdk.ValAddresses{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(validatorTimesliceIterator.Value(), ×lice)
|
||||
k.cdc.MustUnmarshalBinaryBare(validatorTimesliceIterator.Value(), ×lice)
|
||||
|
||||
matureValsAddrs = append(matureValsAddrs, timeslice.Addresses...)
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ func (k Keeper) UnbondAllMatureValidatorQueue(ctx sdk.Context) {
|
|||
|
||||
for ; validatorTimesliceIterator.Valid(); validatorTimesliceIterator.Next() {
|
||||
timeslice := sdk.ValAddresses{}
|
||||
k.cdc.MustUnmarshalBinaryLengthPrefixed(validatorTimesliceIterator.Value(), ×lice)
|
||||
k.cdc.MustUnmarshalBinaryBare(validatorTimesliceIterator.Value(), ×lice)
|
||||
|
||||
for _, valAddr := range timeslice.Addresses {
|
||||
val, found := k.GetValidator(ctx, valAddr)
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/simapp"
|
||||
|
|
|
@ -16,14 +16,14 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], types.LastTotalPowerKey):
|
||||
var powerA, powerB sdk.Int
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &powerA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &powerB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &powerA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &powerB)
|
||||
return fmt.Sprintf("%v\n%v", powerA, powerB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.ValidatorsKey):
|
||||
var validatorA, validatorB types.Validator
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &validatorA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &validatorB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &validatorA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &validatorB)
|
||||
return fmt.Sprintf("%v\n%v", validatorA, validatorB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.LastValidatorPowerKey),
|
||||
|
@ -33,22 +33,22 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
|
||||
case bytes.Equal(kvA.Key[:1], types.DelegationKey):
|
||||
var delegationA, delegationB types.Delegation
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &delegationA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &delegationB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &delegationA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &delegationB)
|
||||
return fmt.Sprintf("%v\n%v", delegationA, delegationB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.UnbondingDelegationKey),
|
||||
bytes.Equal(kvA.Key[:1], types.UnbondingDelegationByValIndexKey):
|
||||
var ubdA, ubdB types.UnbondingDelegation
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &ubdA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &ubdB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &ubdA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &ubdB)
|
||||
return fmt.Sprintf("%v\n%v", ubdA, ubdB)
|
||||
|
||||
case bytes.Equal(kvA.Key[:1], types.RedelegationKey),
|
||||
bytes.Equal(kvA.Key[:1], types.RedelegationByValSrcIndexKey):
|
||||
var redA, redB types.Redelegation
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &redA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &redB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &redA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &redB)
|
||||
return fmt.Sprintf("%v\n%v", redA, redB)
|
||||
|
||||
default:
|
||||
|
|
|
@ -40,12 +40,12 @@ func TestDecodeStore(t *testing.T) {
|
|||
red := types.NewRedelegation(delAddr1, valAddr1, valAddr1, 12, bondTime, sdk.OneInt(), sdk.OneDec())
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: types.LastTotalPowerKey, Value: cdc.MustMarshalBinaryLengthPrefixed(sdk.OneInt())},
|
||||
tmkv.Pair{Key: types.GetValidatorKey(valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(val)},
|
||||
tmkv.Pair{Key: types.LastTotalPowerKey, Value: cdc.MustMarshalBinaryBare(sdk.OneInt())},
|
||||
tmkv.Pair{Key: types.GetValidatorKey(valAddr1), Value: cdc.MustMarshalBinaryBare(val)},
|
||||
tmkv.Pair{Key: types.LastValidatorPowerKey, Value: valAddr1.Bytes()},
|
||||
tmkv.Pair{Key: types.GetDelegationKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(del)},
|
||||
tmkv.Pair{Key: types.GetUBDKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(ubd)},
|
||||
tmkv.Pair{Key: types.GetREDKey(delAddr1, valAddr1, valAddr1), Value: cdc.MustMarshalBinaryLengthPrefixed(red)},
|
||||
tmkv.Pair{Key: types.GetDelegationKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(del)},
|
||||
tmkv.Pair{Key: types.GetUBDKey(delAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(ubd)},
|
||||
tmkv.Pair{Key: types.GetREDKey(delAddr1, valAddr1, valAddr1), Value: cdc.MustMarshalBinaryBare(red)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ func NewDelegation(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, s
|
|||
|
||||
// MustMarshalDelegation returns the delegation bytes. Panics if fails
|
||||
func MustMarshalDelegation(cdc codec.Marshaler, delegation Delegation) []byte {
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(&delegation)
|
||||
return cdc.MustMarshalBinaryBare(&delegation)
|
||||
}
|
||||
|
||||
// MustUnmarshalDelegation return the unmarshaled delegation from bytes.
|
||||
|
@ -54,7 +54,7 @@ func MustUnmarshalDelegation(cdc codec.Marshaler, value []byte) Delegation {
|
|||
|
||||
// return the delegation
|
||||
func UnmarshalDelegation(cdc codec.Marshaler, value []byte) (delegation Delegation, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &delegation)
|
||||
err = cdc.UnmarshalBinaryBare(value, &delegation)
|
||||
return delegation, err
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ func (ubd *UnbondingDelegation) RemoveEntry(i int64) {
|
|||
|
||||
// return the unbonding delegation
|
||||
func MustMarshalUBD(cdc codec.Marshaler, ubd UnbondingDelegation) []byte {
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(&ubd)
|
||||
return cdc.MustMarshalBinaryBare(&ubd)
|
||||
}
|
||||
|
||||
// unmarshal a unbonding delegation from a store value
|
||||
|
@ -141,7 +141,7 @@ func MustUnmarshalUBD(cdc codec.Marshaler, value []byte) UnbondingDelegation {
|
|||
|
||||
// unmarshal a unbonding delegation from a store value
|
||||
func UnmarshalUBD(cdc codec.Marshaler, value []byte) (ubd UnbondingDelegation, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &ubd)
|
||||
err = cdc.UnmarshalBinaryBare(value, &ubd)
|
||||
return ubd, err
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ func (red *Redelegation) RemoveEntry(i int64) {
|
|||
|
||||
// MustMarshalRED returns the Redelegation bytes. Panics if fails.
|
||||
func MustMarshalRED(cdc codec.Marshaler, red Redelegation) []byte {
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(&red)
|
||||
return cdc.MustMarshalBinaryBare(&red)
|
||||
}
|
||||
|
||||
// MustUnmarshalRED unmarshals a redelegation from a store value. Panics if fails.
|
||||
|
@ -233,7 +233,7 @@ func MustUnmarshalRED(cdc codec.Marshaler, value []byte) Redelegation {
|
|||
|
||||
// UnmarshalRED unmarshals a redelegation from a store value
|
||||
func UnmarshalRED(cdc codec.Marshaler, value []byte) (red Redelegation, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &red)
|
||||
err = cdc.UnmarshalBinaryBare(value, &red)
|
||||
return red, err
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ func NewHistoricalInfo(header abci.Header, valSet Validators) HistoricalInfo {
|
|||
|
||||
// MustMarshalHistoricalInfo wll marshal historical info and panic on error
|
||||
func MustMarshalHistoricalInfo(cdc codec.Marshaler, hi HistoricalInfo) []byte {
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(&hi)
|
||||
return cdc.MustMarshalBinaryBare(&hi)
|
||||
}
|
||||
|
||||
// MustUnmarshalHistoricalInfo wll unmarshal historical info and panic on error
|
||||
|
@ -35,7 +35,7 @@ func MustUnmarshalHistoricalInfo(cdc codec.Marshaler, value []byte) HistoricalIn
|
|||
|
||||
// UnmarshalHistoricalInfo will unmarshal historical info and return any error
|
||||
func UnmarshalHistoricalInfo(cdc codec.Marshaler, value []byte) (hi HistoricalInfo, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &hi)
|
||||
err = cdc.UnmarshalBinaryBare(value, &hi)
|
||||
return hi, err
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ func MustUnmarshalParams(cdc *codec.Codec, value []byte) Params {
|
|||
|
||||
// unmarshal the current staking params value from store key
|
||||
func UnmarshalParams(cdc *codec.Codec, value []byte) (params Params, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, ¶ms)
|
||||
err = cdc.UnmarshalBinaryBare(value, ¶ms)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ func (v Validators) Swap(i, j int) {
|
|||
|
||||
// return the redelegation
|
||||
func MustMarshalValidator(cdc codec.Marshaler, validator Validator) []byte {
|
||||
return cdc.MustMarshalBinaryLengthPrefixed(&validator)
|
||||
return cdc.MustMarshalBinaryBare(&validator)
|
||||
}
|
||||
|
||||
// unmarshal a redelegation from a store value
|
||||
|
@ -122,7 +122,7 @@ func MustUnmarshalValidator(cdc codec.Marshaler, value []byte) Validator {
|
|||
|
||||
// unmarshal a redelegation from a store value
|
||||
func UnmarshalValidator(cdc codec.Marshaler, value []byte) (v Validator, err error) {
|
||||
err = cdc.UnmarshalBinaryLengthPrefixed(value, &v)
|
||||
err = cdc.UnmarshalBinaryBare(value, &v)
|
||||
return v, err
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ func DecodeStore(cdc *codec.Codec, kvA, kvB tmkv.Pair) string {
|
|||
switch {
|
||||
case bytes.Equal(kvA.Key[:1], keeper.SupplyKey):
|
||||
var supplyA, supplyB types.Supply
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &supplyA)
|
||||
cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &supplyB)
|
||||
cdc.MustUnmarshalBinaryBare(kvA.Value, &supplyA)
|
||||
cdc.MustUnmarshalBinaryBare(kvB.Value, &supplyB)
|
||||
return fmt.Sprintf("%v\n%v", supplyB, supplyB)
|
||||
|
||||
default:
|
||||
|
|
|
@ -27,7 +27,7 @@ func TestDecodeStore(t *testing.T) {
|
|||
totalSupply := types.NewSupply(sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000)))
|
||||
|
||||
kvPairs := tmkv.Pairs{
|
||||
tmkv.Pair{Key: keeper.SupplyKey, Value: cdc.MustMarshalBinaryLengthPrefixed(totalSupply)},
|
||||
tmkv.Pair{Key: keeper.SupplyKey, Value: cdc.MustMarshalBinaryBare(totalSupply)},
|
||||
tmkv.Pair{Key: []byte{0x99}, Value: []byte{0x99}},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue