Skip to content

Commit

Permalink
clear key naming
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Dec 26, 2023
1 parent e6fe984 commit 633225c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion x/opchild/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewKeeper(
consensusAddressCodec: consensusAddressCodec,
NextL2Sequence: collections.NewItem(sb, types.NextL2SequenceKey, "next_l2_sequence", collections.Uint64Value),
Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)),
FinalizedL1Sequence: collections.NewMap(sb, types.FinalizedL1SequenceKey, "finalized_l1_sequence", collections.Uint64Key, collections.BoolValue),
FinalizedL1Sequence: collections.NewMap(sb, types.FinalizedL1SequencePrefix, "finalized_l1_sequence", collections.Uint64Key, collections.BoolValue),
LastValidatorPowers: collections.NewMap(sb, types.LastValidatorPowerPrefix, "last_validator_powers", collections.BytesKey, collections.Int64Value),
Validators: collections.NewMap(sb, types.ValidatorsPrefix, "validators", collections.BytesKey, codec.CollValue[types.Validator](cdc)),
ValidatorsByConsAddr: collections.NewMap(sb, types.ValidatorsByConsAddrPrefix, "validators_by_cons_addr", collections.BytesKey, collections.BytesValue),
Expand Down
20 changes: 8 additions & 12 deletions x/opchild/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ const (

var (
// Keys for store prefixes
// Last* values are constant during a block.
LastValidatorPowerPrefix = []byte{0x11} // prefix for each key to a validator index, for bonded validators

ValidatorsPrefix = []byte{0x21} // prefix for each key to a validator
ValidatorsByConsAddrPrefix = []byte{0x22} // prefix for each key to a validator index, by pubkey

HistoricalInfoPrefix = []byte{0x31} // prefix for the historical info

ParamsKey = []byte{0x41} // prefix for parameters for module x/opchild

NextL2SequenceKey = []byte{0x51} // key for the outbound sequence number
FinalizedL1SequenceKey = []byte{0x62} // prefix for finalized deposit sequences
ParamsKey = []byte{0x11} // prefix for parameters for module x/opchild
NextL2SequenceKey = []byte{0x12} // key for the outbound sequence number

LastValidatorPowerPrefix = []byte{0x21} // prefix for each key to a validator index, for bonded validators
ValidatorsPrefix = []byte{0x31} // prefix for each key to a validator
ValidatorsByConsAddrPrefix = []byte{0x41} // prefix for each key to a validator index, by pubkey
FinalizedL1SequencePrefix = []byte{0x51} // prefix for finalized deposit sequences
HistoricalInfoPrefix = []byte{0x61} // prefix for the historical info
)
20 changes: 8 additions & 12 deletions x/ophost/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ var (

// Keys for store prefixes
NextBridgeIdKey = []byte{0x11}

BridgeConfigPrefix = []byte{0x21}
NextL1SequencePrefix = []byte{0x22}

TokenPairPrefix = []byte{0x31}

OutputProposalPrefix = []byte{0x41}
NextOutputIndexPrefix = []byte{0x42}

ProvenWithdrawalPrefix = []byte{0x51}

ParamsKey = []byte{0x61}
ParamsKey = []byte{0x12}

BridgeConfigPrefix = []byte{0x21}
NextL1SequencePrefix = []byte{0x31}
TokenPairPrefix = []byte{0x41}
OutputProposalPrefix = []byte{0x51}
NextOutputIndexPrefix = []byte{0x61}
ProvenWithdrawalPrefix = []byte{0x71}
)

0 comments on commit 633225c

Please sign in to comment.