2020-08-17 17:09:02 +00:00
|
|
|
package simulation
|
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// import (
|
|
|
|
// "bytes"
|
|
|
|
// "fmt"
|
|
|
|
// "time"
|
2020-08-17 17:09:02 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// "github.com/cosmos/cosmos-sdk/codec"
|
2020-08-17 17:09:02 +00:00
|
|
|
|
2024-05-01 03:17:24 +00:00
|
|
|
// "github.com/0glabs/0g-chain/x/issuance/types"
|
2020-08-17 17:09:02 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// "github.com/tendermint/tendermint/libs/kv"
|
|
|
|
// )
|
2020-08-17 17:09:02 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// // 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]))
|
2020-08-21 22:56:20 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// }
|
2020-08-21 22:56:20 +00:00
|
|
|
|
2022-01-08 00:39:27 +00:00
|
|
|
// }
|