forked from Kava-Labs/kava
-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder.go
33 lines (26 loc) · 1.01 KB
/
decoder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package simulation
// import (
// "bytes"
// "fmt"
// "time"
// "github.com/cosmos/cosmos-sdk/codec"
// "github.com/mage-coven/mage/x/issuance/types"
// "github.com/tendermint/tendermint/libs/kv"
// )
// // DecodeStore the issuance module has no store keys -- all state is stored in params
// func DecodeStore(cdc *codec.Codec, kvA, kvB kv.Pair) string {
// switch {
// case bytes.Equal(kvA.Key[:1], types.AssetSupplyPrefix):
// var supplyA, supplyB types.AssetSupply
// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &supplyA)
// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &supplyB)
// return fmt.Sprintf("%s\n%s", supplyA, supplyB)
// case bytes.Equal(kvA.Key[:1], types.PreviousBlockTimeKey):
// var timeA, timeB time.Time
// cdc.MustUnmarshalBinaryLengthPrefixed(kvA.Value, &timeA)
// cdc.MustUnmarshalBinaryLengthPrefixed(kvB.Value, &timeB)
// return fmt.Sprintf("%s\n%s", timeA, timeB)
// default:
// panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1]))
// }
// }