From 924242c7325a4d88337c3ed885e341fab637f29d Mon Sep 17 00:00:00 2001 From: Kamen Stoykov Date: Tue, 9 Nov 2021 11:53:12 +0000 Subject: [PATCH] add autoincrement ids to genesis --- module/proto/gravity/v1/genesis.proto | 26 +-- module/x/gravity/keeper/genesis.go | 80 ++++----- module/x/gravity/keeper/pool.go | 29 +++- module/x/gravity/types/genesis.pb.go | 225 +++++++++++++++++--------- 4 files changed, 224 insertions(+), 136 deletions(-) diff --git a/module/proto/gravity/v1/genesis.proto b/module/proto/gravity/v1/genesis.proto index 223dd06de..4ec6a5185 100644 --- a/module/proto/gravity/v1/genesis.proto +++ b/module/proto/gravity/v1/genesis.proto @@ -125,16 +125,18 @@ message Params { // GenesisState struct message GenesisState { - Params params = 1; - uint64 last_observed_nonce = 2; - repeated Valset valsets = 3; - repeated MsgValsetConfirm valset_confirms = 4; - repeated OutgoingTxBatch batches = 5; - repeated MsgConfirmBatch batch_confirms = 6 [(gogoproto.nullable) = false]; - repeated OutgoingLogicCall logic_calls = 7; - repeated MsgConfirmLogicCall logic_call_confirms = 8 [(gogoproto.nullable) = false]; - repeated Attestation attestations = 9 [(gogoproto.nullable) = false]; - repeated MsgSetOrchestratorAddress delegate_keys = 10; - repeated ERC20ToDenom erc20_to_denoms = 11; - repeated OutgoingTransferTx unbatched_transfers = 12; + Params params = 1; + uint64 last_observed_nonce = 2; + repeated Valset valsets = 3; + repeated MsgValsetConfirm valset_confirms = 4; + repeated OutgoingTxBatch batches = 5; + repeated MsgConfirmBatch batch_confirms = 6 [(gogoproto.nullable) = false]; + repeated OutgoingLogicCall logic_calls = 7; + repeated MsgConfirmLogicCall logic_call_confirms = 8 [(gogoproto.nullable) = false]; + repeated Attestation attestations = 9 [(gogoproto.nullable) = false]; + repeated MsgSetOrchestratorAddress delegate_keys = 10; + repeated ERC20ToDenom erc20_to_denoms = 11; + repeated OutgoingTransferTx unbatched_transfers = 12; + uint64 last_tx_pool_id = 13; + uint64 last_outgoing_batch_id = 14; } diff --git a/module/x/gravity/keeper/genesis.go b/module/x/gravity/keeper/genesis.go index bac27402b..fe2b77dc6 100644 --- a/module/x/gravity/keeper/genesis.go +++ b/module/x/gravity/keeper/genesis.go @@ -8,9 +8,6 @@ import ( // InitGenesis starts a chain from a genesis state func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) { - var lastTxPoolId uint64 = 0 - var lastBatchNonce uint64 = 0 - k.SetParams(ctx, *data.Params) // reset valsets in state for _, vs := range data.Valsets { @@ -27,19 +24,12 @@ func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) { for _, batch := range data.Batches { // TODO: block height? k.StoreBatchUnsafe(ctx, batch) - if batch.BatchNonce > lastBatchNonce { - lastBatchNonce = batch.BatchNonce - } for _, tx := range batch.Transactions { if err := k.setPoolEntry(ctx, tx); err != nil { panic(err) } - if tx.Id > lastTxPoolId { - lastTxPoolId = tx.Id - } } } - k.setIncrementID(ctx, types.KeyLastOutgoingBatchID, lastBatchNonce+1) // reset batch confirmations in state for _, conf := range data.BatchConfirms { @@ -64,13 +54,8 @@ func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) { panic(err) } k.appendToUnbatchedTXIndex(ctx, tx.Erc20Fee.Contract, *tx.Erc20Fee, tx.Id) - if tx.Id > lastTxPoolId { - lastTxPoolId = tx.Id - } } - k.setIncrementID(ctx, types.KeyLastTXPoolID, lastTxPoolId+1) - // reset attestations in state for _, att := range data.Attestations { att := att @@ -151,25 +136,38 @@ func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState) { } } + if data.LastTxPoolId == 0 { + k.setIncrementID(ctx, types.KeyLastTXPoolID, 1) + } else { + k.setIncrementID(ctx, types.KeyLastTXPoolID, data.LastTxPoolId) + } + + if data.LastOutgoingBatchId == 0 { + k.setIncrementID(ctx, types.KeyLastOutgoingBatchID, 1) + } else { + k.setIncrementID(ctx, types.KeyLastOutgoingBatchID, data.LastOutgoingBatchId) + } } // ExportGenesis exports all the state needed to restart the chain // from the current state of the chain func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState { var ( - p = k.GetParams(ctx) - calls = k.GetOutgoingLogicCalls(ctx) - batches = k.GetOutgoingTxBatches(ctx) - valsets = k.GetValsets(ctx) - attmap = k.GetAttestationMapping(ctx) - vsconfs = []*types.MsgValsetConfirm{} - batchconfs = []types.MsgConfirmBatch{} - callconfs = []types.MsgConfirmLogicCall{} - attestations = []types.Attestation{} - delegates = k.GetDelegateKeys(ctx) - lastobserved = k.GetLastObservedEventNonce(ctx) - erc20ToDenoms = []*types.ERC20ToDenom{} - unbatchedTransfers = k.GetPoolTransactions(ctx) + p = k.GetParams(ctx) + calls = k.GetOutgoingLogicCalls(ctx) + batches = k.GetOutgoingTxBatches(ctx) + valsets = k.GetValsets(ctx) + attmap = k.GetAttestationMapping(ctx) + vsconfs = []*types.MsgValsetConfirm{} + batchconfs = []types.MsgConfirmBatch{} + callconfs = []types.MsgConfirmLogicCall{} + attestations = []types.Attestation{} + delegates = k.GetDelegateKeys(ctx) + lastobserved = k.GetLastObservedEventNonce(ctx) + erc20ToDenoms = []*types.ERC20ToDenom{} + unbatchedTransfers = k.GetPoolTransactions(ctx) + lastTxPoolId = k.GetIncrementID(ctx, types.KeyLastTXPoolID) + lastOutgoingBatchID = k.GetIncrementID(ctx, types.KeyLastOutgoingBatchID) ) // export valset confirmations from state @@ -205,17 +203,19 @@ func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState { }) return types.GenesisState{ - Params: &p, - LastObservedNonce: lastobserved, - Valsets: valsets, - ValsetConfirms: vsconfs, - Batches: batches, - BatchConfirms: batchconfs, - LogicCalls: calls, - LogicCallConfirms: callconfs, - Attestations: attestations, - DelegateKeys: delegates, - Erc20ToDenoms: erc20ToDenoms, - UnbatchedTransfers: unbatchedTransfers, + Params: &p, + LastObservedNonce: lastobserved, + Valsets: valsets, + ValsetConfirms: vsconfs, + Batches: batches, + BatchConfirms: batchconfs, + LogicCalls: calls, + LogicCallConfirms: callconfs, + Attestations: attestations, + DelegateKeys: delegates, + Erc20ToDenoms: erc20ToDenoms, + UnbatchedTransfers: unbatchedTransfers, + LastTxPoolId: lastTxPoolId, + LastOutgoingBatchId: lastOutgoingBatchID, } } diff --git a/module/x/gravity/keeper/pool.go b/module/x/gravity/keeper/pool.go index f457eafb0..e92b22738 100644 --- a/module/x/gravity/keeper/pool.go +++ b/module/x/gravity/keeper/pool.go @@ -371,14 +371,17 @@ func (k Keeper) createBatchFees(ctx sdk.Context, maxElements uint) map[string]*t } func (k Keeper) autoIncrementID(ctx sdk.Context, idKey []byte) uint64 { - store := ctx.KVStore(k.storeKey) - bz := store.Get(idKey) - var id uint64 = 1 - if bz != nil { - id = binary.BigEndian.Uint64(bz) - } - bz = sdk.Uint64ToBigEndian(id + 1) - store.Set(idKey, bz) + // store := ctx.KVStore(k.storeKey) + // bz := store.Get(idKey) + // var id uint64 = 1 + // if bz != nil { + // id = binary.BigEndian.Uint64(bz) + // } + // bz = sdk.Uint64ToBigEndian(id + 1) + // store.Set(idKey, bz) + // return id + var id uint64 = k.GetIncrementID(ctx, idKey) + k.setIncrementID(ctx, idKey, id+1) return id } @@ -388,3 +391,13 @@ func (k Keeper) setIncrementID(ctx sdk.Context, idKey []byte, id uint64) uint64 store.Set(idKey, bz) return id } + +func (k Keeper) GetIncrementID(ctx sdk.Context, idKey []byte) uint64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get(idKey) + var id uint64 = 1 + if bz != nil { + id = binary.BigEndian.Uint64(bz) + } + return id +} diff --git a/module/x/gravity/types/genesis.pb.go b/module/x/gravity/types/genesis.pb.go index 5f35494e5..8930c90a0 100644 --- a/module/x/gravity/types/genesis.pb.go +++ b/module/x/gravity/types/genesis.pb.go @@ -183,18 +183,20 @@ func (m *Params) GetValsetReward() types.Coin { // GenesisState struct type GenesisState struct { - Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` - LastObservedNonce uint64 `protobuf:"varint,2,opt,name=last_observed_nonce,json=lastObservedNonce,proto3" json:"last_observed_nonce,omitempty"` - Valsets []*Valset `protobuf:"bytes,3,rep,name=valsets,proto3" json:"valsets,omitempty"` - ValsetConfirms []*MsgValsetConfirm `protobuf:"bytes,4,rep,name=valset_confirms,json=valsetConfirms,proto3" json:"valset_confirms,omitempty"` - Batches []*OutgoingTxBatch `protobuf:"bytes,5,rep,name=batches,proto3" json:"batches,omitempty"` - BatchConfirms []MsgConfirmBatch `protobuf:"bytes,6,rep,name=batch_confirms,json=batchConfirms,proto3" json:"batch_confirms"` - LogicCalls []*OutgoingLogicCall `protobuf:"bytes,7,rep,name=logic_calls,json=logicCalls,proto3" json:"logic_calls,omitempty"` - LogicCallConfirms []MsgConfirmLogicCall `protobuf:"bytes,8,rep,name=logic_call_confirms,json=logicCallConfirms,proto3" json:"logic_call_confirms"` - Attestations []Attestation `protobuf:"bytes,9,rep,name=attestations,proto3" json:"attestations"` - DelegateKeys []*MsgSetOrchestratorAddress `protobuf:"bytes,10,rep,name=delegate_keys,json=delegateKeys,proto3" json:"delegate_keys,omitempty"` - Erc20ToDenoms []*ERC20ToDenom `protobuf:"bytes,11,rep,name=erc20_to_denoms,json=erc20ToDenoms,proto3" json:"erc20_to_denoms,omitempty"` - UnbatchedTransfers []*OutgoingTransferTx `protobuf:"bytes,12,rep,name=unbatched_transfers,json=unbatchedTransfers,proto3" json:"unbatched_transfers,omitempty"` + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` + LastObservedNonce uint64 `protobuf:"varint,2,opt,name=last_observed_nonce,json=lastObservedNonce,proto3" json:"last_observed_nonce,omitempty"` + Valsets []*Valset `protobuf:"bytes,3,rep,name=valsets,proto3" json:"valsets,omitempty"` + ValsetConfirms []*MsgValsetConfirm `protobuf:"bytes,4,rep,name=valset_confirms,json=valsetConfirms,proto3" json:"valset_confirms,omitempty"` + Batches []*OutgoingTxBatch `protobuf:"bytes,5,rep,name=batches,proto3" json:"batches,omitempty"` + BatchConfirms []MsgConfirmBatch `protobuf:"bytes,6,rep,name=batch_confirms,json=batchConfirms,proto3" json:"batch_confirms"` + LogicCalls []*OutgoingLogicCall `protobuf:"bytes,7,rep,name=logic_calls,json=logicCalls,proto3" json:"logic_calls,omitempty"` + LogicCallConfirms []MsgConfirmLogicCall `protobuf:"bytes,8,rep,name=logic_call_confirms,json=logicCallConfirms,proto3" json:"logic_call_confirms"` + Attestations []Attestation `protobuf:"bytes,9,rep,name=attestations,proto3" json:"attestations"` + DelegateKeys []*MsgSetOrchestratorAddress `protobuf:"bytes,10,rep,name=delegate_keys,json=delegateKeys,proto3" json:"delegate_keys,omitempty"` + Erc20ToDenoms []*ERC20ToDenom `protobuf:"bytes,11,rep,name=erc20_to_denoms,json=erc20ToDenoms,proto3" json:"erc20_to_denoms,omitempty"` + UnbatchedTransfers []*OutgoingTransferTx `protobuf:"bytes,12,rep,name=unbatched_transfers,json=unbatchedTransfers,proto3" json:"unbatched_transfers,omitempty"` + LastTxPoolId uint64 `protobuf:"varint,13,opt,name=last_tx_pool_id,json=lastTxPoolId,proto3" json:"last_tx_pool_id,omitempty"` + LastOutgoingBatchId uint64 `protobuf:"varint,14,opt,name=last_outgoing_batch_id,json=lastOutgoingBatchId,proto3" json:"last_outgoing_batch_id,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -314,6 +316,20 @@ func (m *GenesisState) GetUnbatchedTransfers() []*OutgoingTransferTx { return nil } +func (m *GenesisState) GetLastTxPoolId() uint64 { + if m != nil { + return m.LastTxPoolId + } + return 0 +} + +func (m *GenesisState) GetLastOutgoingBatchId() uint64 { + if m != nil { + return m.LastOutgoingBatchId + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "gravity.v1.Params") proto.RegisterType((*GenesisState)(nil), "gravity.v1.GenesisState") @@ -322,70 +338,73 @@ func init() { func init() { proto.RegisterFile("gravity/v1/genesis.proto", fileDescriptor_387b0aba880adb60) } var fileDescriptor_387b0aba880adb60 = []byte{ - // 993 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x95, 0xdf, 0x4e, 0x23, 0x37, - 0x14, 0xc6, 0x93, 0x6e, 0x36, 0x80, 0x93, 0xc0, 0xe2, 0x00, 0x6b, 0xfe, 0x6c, 0x88, 0x56, 0xea, - 0x0a, 0x55, 0xcb, 0x0c, 0xa4, 0x6a, 0xa5, 0x56, 0x6a, 0x55, 0x12, 0x68, 0x77, 0xdb, 0x6e, 0xa9, - 0x26, 0xb4, 0x95, 0xaa, 0x4a, 0xae, 0x67, 0xc6, 0xcc, 0x8c, 0x98, 0xd8, 0xc8, 0x76, 0x02, 0xdc, - 0xf5, 0x11, 0x7a, 0xdb, 0x07, 0xe9, 0x3b, 0xec, 0xe5, 0x5e, 0x56, 0x55, 0xb5, 0xaa, 0xe0, 0x45, - 0x56, 0x63, 0x7b, 0x26, 0x43, 0x96, 0x2b, 0xae, 0x60, 0xfc, 0x7d, 0xbf, 0x73, 0x4e, 0x8e, 0xed, - 0x63, 0x80, 0x22, 0x41, 0x26, 0x89, 0xba, 0x72, 0x27, 0xfb, 0x6e, 0x44, 0x19, 0x95, 0x89, 0x74, - 0xce, 0x05, 0x57, 0x1c, 0x02, 0xab, 0x38, 0x93, 0xfd, 0x8d, 0x95, 0x88, 0x47, 0x5c, 0x2f, 0xbb, - 0xd9, 0x7f, 0xc6, 0xb1, 0xb1, 0x56, 0x62, 0xd5, 0xd5, 0x39, 0xb5, 0xe4, 0xc6, 0x6a, 0x69, 0x7d, - 0x24, 0x23, 0x79, 0x87, 0xdd, 0x27, 0x2a, 0x88, 0xed, 0xfa, 0x56, 0x69, 0x9d, 0x28, 0x45, 0xa5, - 0x22, 0x2a, 0xe1, 0xcc, 0xaa, 0x9d, 0x80, 0xcb, 0x11, 0x97, 0xae, 0x4f, 0x24, 0x75, 0x27, 0xfb, - 0x3e, 0x55, 0x64, 0xdf, 0x0d, 0x78, 0x62, 0xf5, 0xa7, 0x7f, 0xcf, 0x83, 0xfa, 0x8f, 0x44, 0x90, - 0x91, 0x84, 0x4f, 0x40, 0x5e, 0x33, 0x4e, 0x42, 0x54, 0xed, 0x56, 0x77, 0x16, 0xbc, 0x05, 0xbb, - 0xf2, 0x32, 0x84, 0x7b, 0x60, 0x25, 0xe0, 0x4c, 0x09, 0x12, 0x28, 0x2c, 0xf9, 0x58, 0x04, 0x14, - 0xc7, 0x44, 0xc6, 0xe8, 0x03, 0x6d, 0x84, 0xb9, 0x36, 0xd4, 0xd2, 0x0b, 0x22, 0x63, 0xf8, 0x29, - 0x78, 0xec, 0x8b, 0x24, 0x8c, 0x28, 0xa6, 0x2a, 0xa6, 0x82, 0x8e, 0x47, 0x98, 0x84, 0xa1, 0xa0, - 0x52, 0xa2, 0x9a, 0x86, 0x56, 0x8d, 0x7c, 0x64, 0xd5, 0x03, 0x23, 0xc2, 0x67, 0x60, 0xc9, 0x72, - 0x41, 0x4c, 0x12, 0x96, 0x55, 0xf3, 0xb0, 0x5b, 0xdd, 0xa9, 0x79, 0x2d, 0xb3, 0x3c, 0xc8, 0x56, - 0x5f, 0x86, 0xb0, 0x07, 0x56, 0x65, 0x12, 0x31, 0x1a, 0xe2, 0x09, 0x49, 0x25, 0x55, 0x12, 0x5f, - 0x24, 0x2c, 0xe4, 0x17, 0xa8, 0xae, 0xdd, 0x6d, 0x23, 0xfe, 0x6c, 0xb4, 0x5f, 0xb4, 0x54, 0x62, - 0x74, 0x0f, 0x69, 0xc1, 0xcc, 0x95, 0x99, 0xbe, 0xd1, 0x2c, 0xf3, 0x19, 0x58, 0xb7, 0x4c, 0xca, - 0xa3, 0x24, 0xc0, 0x01, 0x49, 0xd3, 0x82, 0x9b, 0xd7, 0xdc, 0x9a, 0x31, 0x7c, 0x9f, 0xe9, 0x83, - 0x4c, 0xb6, 0xe8, 0x1e, 0x58, 0x51, 0x44, 0x44, 0x54, 0x99, 0x74, 0x58, 0x25, 0x23, 0xca, 0xc7, - 0x0a, 0x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x65, 0x6f, 0xcd, 0x74, 0x27, 0x3c, 0x52, 0xf1, 0x30, - 0x8f, 0x09, 0x0f, 0x41, 0xcb, 0x14, 0x8b, 0x05, 0xbd, 0x20, 0x22, 0x44, 0xcb, 0xdd, 0xea, 0x4e, - 0xa3, 0xb7, 0xee, 0x98, 0x58, 0x4e, 0x36, 0x23, 0x1c, 0x3b, 0x23, 0x9c, 0x01, 0x4f, 0x58, 0xbf, - 0x96, 0xe5, 0xf7, 0x9a, 0x86, 0xf2, 0x34, 0xf4, 0x79, 0xed, 0x8f, 0xff, 0xba, 0x95, 0xa7, 0x7f, - 0xd5, 0x41, 0xf3, 0x1b, 0x33, 0xf0, 0x86, 0x8a, 0x28, 0x0a, 0x3f, 0x02, 0xf5, 0x73, 0x3d, 0x47, - 0xf4, 0xe4, 0x68, 0xf4, 0xa0, 0x33, 0x1d, 0x80, 0x8e, 0x99, 0x30, 0x9e, 0x75, 0x40, 0x07, 0xb4, - 0x53, 0x22, 0x15, 0xe6, 0xbe, 0xa4, 0x62, 0x42, 0x43, 0xcc, 0x38, 0x0b, 0xa8, 0x9e, 0x24, 0x35, - 0x6f, 0x39, 0x93, 0x8e, 0xad, 0xf2, 0x43, 0x26, 0xc0, 0xe7, 0x60, 0xce, 0x76, 0x19, 0x3d, 0xe8, - 0x3e, 0x98, 0x0d, 0x6e, 0x9a, 0xeb, 0xe5, 0x16, 0x78, 0x04, 0x96, 0xec, 0xcf, 0x0c, 0x38, 0x3b, - 0x4d, 0xc4, 0x28, 0x1b, 0x37, 0x19, 0xb5, 0x55, 0xa6, 0x5e, 0x49, 0xbb, 0x2b, 0x03, 0x63, 0xf2, - 0x16, 0x27, 0xe5, 0x4f, 0x09, 0x3f, 0x01, 0x73, 0x76, 0x44, 0xa0, 0x87, 0x1a, 0xdf, 0x2c, 0xe3, - 0xc7, 0x63, 0x15, 0xf1, 0x84, 0x45, 0x27, 0x97, 0xfa, 0x0c, 0x7a, 0xb9, 0x17, 0xbe, 0x00, 0x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, 0x7b, 0x7d, 0xdd, 0xa9, 0xbe, 0xb9, 0xee, 0x54, 0xff, 0xbf, - 0xee, 0x54, 0xff, 0xbc, 0xe9, 0x54, 0xde, 0xdc, 0x74, 0x2a, 0xff, 0xdc, 0x74, 0x2a, 0xbf, 0xf6, - 0x4b, 0xf7, 0x98, 0xa4, 0x2a, 0xa6, 0x64, 0x97, 0x51, 0x95, 0xdf, 0x65, 0x9b, 0x69, 0xd7, 0xbc, - 0x72, 0xee, 0x88, 0x87, 0xe3, 0x94, 0xba, 0x97, 0x6e, 0xfe, 0xc0, 0xeb, 0x7b, 0xee, 0xd7, 0xf5, - 0xc3, 0xfd, 0xf1, 0xbb, 0x00, 0x00, 0x00, 0xff, 0xff, 0x70, 0x7b, 0x92, 0x4a, 0x7b, 0x08, 0x00, - 0x00, + // 1042 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x4e, 0x1b, 0x47, + 0x14, 0xc6, 0x8d, 0x63, 0x60, 0xb0, 0x21, 0x0c, 0x3f, 0x19, 0x7e, 0x62, 0xac, 0x48, 0x89, 0x50, + 0x15, 0xd6, 0x40, 0xd4, 0x4a, 0xad, 0xd4, 0xaa, 0xd8, 0xd0, 0x86, 0xb6, 0x29, 0xd1, 0x42, 0x5b, + 0xa9, 0xaa, 0x34, 0x1d, 0xef, 0x0c, 0xbb, 0x2b, 0xd6, 0x3b, 0x68, 0x66, 0x6c, 0xe0, 0xae, 0x8f, + 0xd0, 0x97, 0xe9, 0x3b, 0xe4, 0x32, 0x97, 0x55, 0x55, 0x45, 0x15, 0x3c, 0x43, 0xef, 0xab, 0x3d, + 0x33, 0xbb, 0x5e, 0x1c, 0xae, 0xb8, 0x02, 0x9f, 0xef, 0xfb, 0xce, 0x39, 0x7b, 0xe6, 0xec, 0x37, + 0x8b, 0x48, 0xa8, 0xd8, 0x30, 0x36, 0x57, 0xed, 0x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d, 0xc9, 0x07, 0x89, 0x68, 0x5f, 0xb6, 0xf3, 0x8f, 0x07, 0xf0, 0x90, 0x5e, + 0x0d, 0x3e, 0x0a, 0x5e, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x41, 0x29, 0xec, 0xe1, 0xd7, 0x08, + 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -546,6 +565,16 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.LastOutgoingBatchId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.LastOutgoingBatchId)) + i-- + dAtA[i] = 0x70 + } + if m.LastTxPoolId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.LastTxPoolId)) + i-- + dAtA[i] = 0x68 + } if len(m.UnbatchedTransfers) > 0 { for iNdEx := len(m.UnbatchedTransfers) - 1; iNdEx >= 0; iNdEx-- { { @@ -845,6 +874,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if m.LastTxPoolId != 0 { + n += 1 + sovGenesis(uint64(m.LastTxPoolId)) + } + if m.LastOutgoingBatchId != 0 { + n += 1 + sovGenesis(uint64(m.LastOutgoingBatchId)) + } return n } @@ -1744,6 +1779,44 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastTxPoolId", wireType) + } + m.LastTxPoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastTxPoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastOutgoingBatchId", wireType) + } + m.LastOutgoingBatchId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastOutgoingBatchId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])