Skip to content

Commit

Permalink
typos, int64->uint64
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Nov 14, 2024
1 parent ac43fb0 commit 1ee0cca
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion proto/exocore/oracle/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ message ValidatorMissedRounds {
// MissedRound records if round with index is missed
message MissedRound {
// index of the round in current window
int64 index = 1;
uint64 index = 1;
// if this round is missed
bool missed = 2;
}
4 changes: 2 additions & 2 deletions proto/exocore/oracle/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ message Params {
int32 threshold_b = 8;
// for v1, mode=1, get final price as soon as voting power reach threshold_a/threshold_b
ConsensusMode mode = 9;
// for each round, a validator only allowed to provide at most max_det_id continuos rounds of prices for DS
// for each round, a validator only allowed to provide at most max_det_id continuous rounds of prices for DS
int32 max_det_id = 10;
// for each token, only keep max_size_prices round of prices
int32 max_size_prices = 11;
Expand Down Expand Up @@ -72,7 +72,7 @@ message SlashingParams {
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
// slash_fraction_miss defines the fractino one validator should be punished for maliciours behavior
// slash_fraction_miss defines the fraction one validator should be punished for malicious behavior
bytes slash_fraction_malicious = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false,
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)
// set vlidatorMissedRounds
for _, elem := range genState.ValidatorMissedRounds {
for _, missedRound := range elem.MissedRounds {
k.SetValidatorMissedRoundBitArray(ctx, elem.Address, uint64(missedRound.Index), missedRound.Missed)
k.SetValidatorMissedRoundBitArray(ctx, elem.Address, missedRound.Index, missedRound.Missed)
}
}
// this line is used by starport scaffolding # genesis/module/init
Expand Down
6 changes: 3 additions & 3 deletions x/oracle/keeper/slashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (k Keeper) IterateValidatorReportInfos(ctx sdk.Context, handler func(addres
}

// IterateValidatorMissedRoundBitArrray iterates all missed rounds in one performance window of rounds
func (k Keeper) IterateValidatorMissedRoundBitArray(ctx sdk.Context, validator string, handler func(index int64, missed bool) (stop bool)) {
func (k Keeper) IterateValidatorMissedRoundBitArray(ctx sdk.Context, validator string, handler func(index uint64, missed bool) (stop bool)) {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SlashingMissedBitArrayPrefix(validator))
iterator := sdk.KVStorePrefixIterator(store, []byte{})
defer iterator.Close()
Expand All @@ -127,15 +127,15 @@ func (k Keeper) IterateValidatorMissedRoundBitArray(ctx sdk.Context, validator s
if err := k.cdc.Unmarshal(iterator.Value(), &missed); err != nil {
panic(fmt.Sprintf("failed to unmarshal missed round: %v", err))
}
if handler(int64(index), missed.Value) {
if handler(index, missed.Value) {
break
}
}
}

func (k Keeper) GetValidatorMissedRounds(ctx sdk.Context, address string) []*types.MissedRound {
missedRounds := []*types.MissedRound{}
k.IterateValidatorMissedRoundBitArray(ctx, address, func(index int64, missed bool) (stop bool) {
k.IterateValidatorMissedRoundBitArray(ctx, address, func(index uint64, missed bool) (stop bool) {
missedRounds = append(missedRounds, types.NewMissedRound(index, missed))
return false
})
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewGenesisState(p Params) *GenesisState {
}
}

func NewMissedRound(index int64, missed bool) *MissedRound {
func NewMissedRound(index uint64, missed bool) *MissedRound {
return &MissedRound{
Index: index,
Missed: missed,
Expand Down
10 changes: 5 additions & 5 deletions x/oracle/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/oracle/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ee0cca

Please sign in to comment.