Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/matic-cli-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defaultStake: 10000
defaultFee: 2000
borChainId: 15001
heimdallChainId: heimdall-15001
contractsRepo: https://github.com/0xPolygon/pos-contracts.git
contractsRepo: https://github.com/0xPolygon/pos-contracts.git
contractsBranch: anvil-pos
genesisContractsBranch: master
sprintSize:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ dist/
.dccache
.idea/
.idea*

cover.out
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ clean:
tests:
# go test -v ./...

go test -v ./app/ ./auth/ ./clerk/ ./sidechannel/ ./bank/ ./chainmanager/ ./topup/ ./checkpoint/ ./staking/ ./gov/ -cover -coverprofile=cover.out -parallel 1
go test -v ./app/ ./auth/ ./clerk/ ./sidechannel/ ./bank/ ./chainmanager/ ./topup/ ./checkpoint/ ./staking/ -cover -coverprofile=cover.out -parallel 1

# make build
build: clean
Expand Down
13 changes: 0 additions & 13 deletions bor/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,6 @@ func handleQuerySpanList(ctx sdk.Context, req abci.RequestQuery, keeper Keeper)
}

func handleQueryLatestSpan(ctx sdk.Context, _ abci.RequestQuery, keeper Keeper) ([]byte, sdk.Error) {
var defaultSpan hmTypes.Span

spans := keeper.GetAllSpans(ctx)
if len(spans) == 0 {
// json record
bz, err := jsoniter.ConfigFastest.Marshal(defaultSpan)
if err != nil {
return nil, sdk.ErrInternal(sdk.AppendMsgToErr("could not marshal result to JSON", err.Error()))
}

return bz, nil
}

// explicitly fetch the last span
span, err := keeper.GetLastSpan(ctx)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions checkpoint/handler_milestone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (suite *HandlerTestSuite) TestHandleMsgMilestone() {

// check valid milestone
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.MilestoneIncrementAccum(ctx, 1)

lastMilestone, err := keeper.GetLastMilestone(ctx)
Expand Down Expand Up @@ -221,7 +221,7 @@ func (suite *HandlerTestSuite) TestHandleMsgMilestoneExistInStore() {
start := uint64(0)
milestoneLength := helper.MilestoneLength

chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastMilestone, err := keeper.GetLastMilestone(ctx)
Expand Down Expand Up @@ -294,7 +294,7 @@ func (suite *HandlerTestSuite) TestHandleMsgMilestoneTimeout() {

proposer := hmTypes.HeimdallAddress{}

chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)

suite.Run("Last milestone not found", func() {
msgMilestoneTimeout := types.NewMsgMilestoneTimeout(
Expand Down
12 changes: 6 additions & 6 deletions checkpoint/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpoint() {

// check valid checkpoint
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -230,7 +230,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpointAfterBufferTimeOut() {
require.NoError(t, err)

// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -276,7 +276,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpointExistInBuffer() {
err := topupKeeper.AddDividendAccount(ctx, dividendAccount)
require.NoError(t, err)

chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -317,7 +317,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpointAck() {

// check valid checkpoint
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -410,7 +410,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpointNoAck() {

// check valid checkpoint
// generate proposer for validator set
chSim.LoadValidatorSet(t, 4, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 4, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -477,7 +477,7 @@ func (suite *HandlerTestSuite) TestHandleMsgCheckpointNoAckBeforeBufferTimeout()

// check valid checkpoint
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (suite *QuerierTestSuite) TestQueryCheckpointList() {

func (suite *QuerierTestSuite) TestQueryNextCheckpoint() {
t, app, ctx, querier := suite.T(), suite.app, suite.ctx, suite.querier
chSim.LoadValidatorSet(t, 2, app.StakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, app.StakingKeeper, ctx, false, 10, 0)

dividendAccount := hmTypes.DividendAccount{
User: hmTypes.HexToHeimdallAddress("123"),
Expand Down
4 changes: 2 additions & 2 deletions checkpoint/side_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func (suite *SideHandlerTestSuite) TestPostHandleMsgCheckpoint() {

// check valid checkpoint
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastCheckpoint, err := keeper.GetLastCheckpoint(ctx)
Expand Down Expand Up @@ -418,7 +418,7 @@ func (suite *SideHandlerTestSuite) TestPostHandleMsgCheckpointAck() {
params := keeper.GetParams(ctx)
header, _ := chSim.GenRandCheckpoint(start, maxSize, params.MaxCheckpointLength)
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, app.StakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, app.StakingKeeper, ctx, false, 10, 0)
app.StakingKeeper.IncrementAccum(ctx, 1)

// send ack
Expand Down
2 changes: 1 addition & 1 deletion checkpoint/side_milestone_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (suite *SideHandlerTestSuite) TestPostHandleMsgMilestone() {

// check valid milestone
// generate proposer for validator set
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10)
chSim.LoadValidatorSet(t, 2, stakingKeeper, ctx, false, 10, 0)
stakingKeeper.IncrementAccum(ctx, 1)

lastMilestone, err := keeper.GetLastMilestone(ctx)
Expand Down
4 changes: 2 additions & 2 deletions checkpoint/simulation/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func GenRandCheckpoint(start uint64, headerSize uint64, maxCheckpointLength uint
}

// LoadValidatorSet loads validator set
func LoadValidatorSet(t *testing.T, count int, keeper staking.Keeper, ctx sdk.Context, randomise bool, timeAlive int) types.ValidatorSet {
func LoadValidatorSet(t *testing.T, count int, keeper staking.Keeper, ctx sdk.Context, randomise bool, timeAlive int, nonce uint64) types.ValidatorSet {
t.Helper()

var valSet types.ValidatorSet

validators := stakingSim.GenRandomVal(count, 0, 10, uint64(timeAlive), randomise, 1)
validators := stakingSim.GenRandomVal(count, 0, 10, uint64(timeAlive), randomise, 1, nonce)
for _, validator := range validators {
err := keeper.AddValidator(ctx, validator)
require.NoError(t, err, "Unable to set validator, Error: %v", err)
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/maticnetwork/heimdall

go 1.23.6
go 1.23.8

require (
github.com/RichardKnop/machinery v1.10.6
github.com/cbergoon/merkletree v0.2.0
github.com/cosmos/cosmos-sdk v0.50.12
github.com/ethereum/go-ethereum v1.14.13
github.com/cosmos/cosmos-sdk v0.50.13
github.com/ethereum/go-ethereum v1.15.8
github.com/go-kit/log v0.2.1
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
Expand All @@ -29,7 +29,7 @@ require (
github.com/tendermint/go-amino v0.16.0
github.com/tendermint/tendermint v0.34.24
github.com/tendermint/tm-db v0.6.7
golang.org/x/sync v0.11.0
golang.org/x/sync v0.13.0
google.golang.org/grpc v1.64.1
google.golang.org/protobuf v1.34.1
)
Expand Down Expand Up @@ -88,6 +88,7 @@ require (
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down Expand Up @@ -159,17 +160,16 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0
go.opentelemetry.io/otel/sdk v1.27.0
go.opentelemetry.io/otel/trace v1.27.0
golang.org/x/crypto v0.35.0 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/oauth2 v0.29.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
gopkg.in/yaml.v3 v3.0.1
)

replace github.com/tendermint/tendermint => github.com/maticnetwork/tendermint v0.33.3
replace github.com/tendermint/tendermint => github.com/maticnetwork/tendermint v0.33.5

replace github.com/tendermint/tm-db => github.com/tendermint/tm-db v0.2.0

Expand Down
27 changes: 14 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2216,8 +2216,8 @@ github.com/maticnetwork/heimdall v1.0.7/go.mod h1:+ANI5+VV28ahwfdl7oMzrcNwaTEs1F
github.com/maticnetwork/polyproto v0.0.3-0.20230216113155-340ea926ca53/go.mod h1:e1mU2EXSwEpn5jM7GfNwu3AupsV6WAGoPFFfswXOF0o=
github.com/maticnetwork/polyproto v0.0.4 h1:qQ/qwcO6UNGS4mJlzlLJn1AUMfJK9Rqmf1v+KJgnPsk=
github.com/maticnetwork/polyproto v0.0.4/go.mod h1:e1mU2EXSwEpn5jM7GfNwu3AupsV6WAGoPFFfswXOF0o=
github.com/maticnetwork/tendermint v0.33.3 h1:s1/Ubxh7Axv2bClr+aFMWNn5qzbRKEHEw/uEVxLTc0I=
github.com/maticnetwork/tendermint v0.33.3/go.mod h1:D2fcnxGk6bje+LoPwImuKSSYLiK7/G06IynGNDSEcJk=
github.com/maticnetwork/tendermint v0.33.5 h1:Cu1VSVWCsw045q9dootXXzYI7ONUKcq3o2gd7646Fm0=
github.com/maticnetwork/tendermint v0.33.5/go.mod h1:D2fcnxGk6bje+LoPwImuKSSYLiK7/G06IynGNDSEcJk=
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
Expand Down Expand Up @@ -2884,8 +2884,8 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -3059,8 +3059,8 @@ golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -3105,8 +3105,9 @@ golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCA
golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o=
golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA=
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98=
golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -3132,8 +3133,8 @@ golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -3275,8 +3276,8 @@ golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/telemetry v0.0.0-20240208230135-b75ee8823808/go.mod h1:KG1lNk5ZFNssSZLrpVb4sMXKMpGwGXOxSG3rnu2gZQQ=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0=
Expand Down Expand Up @@ -3328,8 +3329,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
36 changes: 0 additions & 36 deletions gov/types/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,3 @@ func TestProposalKeys(t *testing.T) {
require.Panics(t, func() { SplitProposalKey([]byte("test")) })
require.Panics(t, func() { SplitInactiveProposalQueueKey([]byte("test")) })
}

func TestDepositKeys(t *testing.T) {

id := 1

key := DepositsKey(2)
proposalID := SplitProposalKey(key)
require.Equal(t, int(proposalID), 2)

key = DepositKey(2, hmTypes.ValidatorID(id))
proposalID, depositorAddr := SplitKeyDeposit(key)
require.Equal(t, int(proposalID), 2)
require.Equal(t, addr, depositorAddr)

// invalid key
key = DepositKey(5, hmTypes.ValidatorID(id))
require.Panics(t, func() { SplitKeyDeposit(key) })
}

func TestVoteKeys(t *testing.T) {

id := 1

key := VotesKey(2)
proposalID := SplitProposalKey(key)
require.Equal(t, int(proposalID), 2)

key = VoteKey(2, hmTypes.ValidatorID(id))
proposalID, voterAddr := SplitKeyDeposit(key)
require.Equal(t, int(proposalID), 2)
require.Equal(t, addr, voterAddr)

// invalid key
key = VoteKey(5, hmTypes.ValidatorID(id))
require.Panics(t, func() { SplitKeyVote(key) })
}
Empty file modified packaging/templates/package_scripts/preinst
100644 → 100755
Empty file.
Loading
Loading