Skip to content
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
22 changes: 0 additions & 22 deletions .github/workflows/dependencies-review.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ permissions:
jobs:
labeler:
permissions:
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
contents: read # for actions/labeler to determine modified files
pull-requests: write # for actions/labeler to add labels to PRs
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
17 changes: 0 additions & 17 deletions .github/workflows/project.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@ jobs:
with:
name: "${{ github.sha }}-e2e-coverage"
continue-on-error: true
- name: sonarcloud
if: env.GIT_DIFF
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

liveness-test:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package server
// DONTCOVER

import (
"encoding/hex"
"errors"
"fmt"
"net"
Expand All @@ -24,8 +25,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

"encoding/hex"

"cosmossdk.io/tools/rosetta"
crgserver "cosmossdk.io/tools/rosetta/lib/server"
"github.com/cosmos/cosmos-sdk/client"
Expand Down
71 changes: 56 additions & 15 deletions tests/e2e/auth/vesting/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package testutil

import (
"fmt"
"log"
"os"

"github.com/cosmos/gogoproto/proto"
"github.com/stretchr/testify/suite"
Expand Down Expand Up @@ -221,6 +223,10 @@ func (s *E2ETestSuite) TestNewMsgCreatePermanentLockedAccountCmd() {
}

func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
pwd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
val := s.network.Validators[0]
for _, tc := range []struct {
name string
Expand All @@ -234,8 +240,8 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr10______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -249,7 +255,7 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr11______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -263,7 +269,7 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr12______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
Expand All @@ -277,8 +283,8 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
args: []string{
sdk.AccAddress("addr10______________").String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=%s", cli.FlagMerge, "true"),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
Expand Down Expand Up @@ -306,51 +312,57 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
name: "bad lockup filename",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/noexist"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"testdata/noexist")),
},
expectErr: true,
},
{
name: "bad lockup json",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/badjson"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"testdata/badjson")),
},
expectErr: true,
},
{
name: "bad lockup periods",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/badperiod.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"testdata/badperiod.json")),
},
expectErr: true,
},
{
name: "bad vesting filename",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/noexist"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"testdata/noexist")),
},
expectErr: true,
},
{
name: "bad vesting json",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/badjson"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"testdata/badjson")),
},
expectErr: true,
},
{
name: "bad vesting periods",
args: []string{
sdk.AccAddress("addr13______________").String(),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/badperiod.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"testdata/badperiod.json")),
},
expectErr: true,
},
} {
// Synchronize height between test runs, to ensure sequence numbers are
// properly updated.
height, err := s.network.LatestHeight()
s.Require().NoError(err, "Getting initial latest height")
s.T().Logf("Initial latest height: %d", height)

s.Run(tc.name, func() {
clientCtx := val.ClientCtx

Expand All @@ -365,24 +377,43 @@ func (s *E2ETestSuite) TestNewMsgCreateClawbackVestingAccountCmd() {
s.Require().Equal(tc.expectedCode, txResp.Code)
}
})
next, err := s.network.WaitForHeight(height + 1)
s.Require().NoError(err, "Waiting for height...")
height = next
s.T().Logf("Height now: %d", height)
}
}

func (s *E2ETestSuite) TestNewMsgClawbackCmd() {
pwd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}

val := s.network.Validators[0]
addr := sdk.AccAddress("addr30______________")

_, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cli.NewMsgCreateClawbackVestingAccountCmd(), []string{
_, err = clitestutil.ExecTestCLICmd(val.ClientCtx, cli.NewMsgCreateClawbackVestingAccountCmd(), []string{
addr.String(),
fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address),
fmt.Sprintf("--%s=%s", cli.FlagLockup, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagVesting, "testdata/periods1.json"),
fmt.Sprintf("--%s=%s", cli.FlagLockup, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=%s", cli.FlagVesting, fmt.Sprintf(pwd+"/testdata/periods1.json")),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync),
fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()),
})
s.Require().NoError(err)

// Synchronize height between test runs, to ensure sequence numbers are
// properly updated.
height, err := s.network.LatestHeight()
s.Require().NoError(err, "Getting initial latest height")
s.T().Logf("Initial latest height: %d", height)
next, err := s.network.WaitForHeight(height + 1)
s.Require().NoError(err, "Waiting for height...")
height = next
s.T().Logf("Height now: %d", height)

for _, tc := range []struct {
name string
args []string
Expand Down Expand Up @@ -433,6 +464,12 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() {
respType: &sdk.TxResponse{},
},
} {
// Synchronize height between test runs, to ensure sequence numbers are
// properly updated.
height, err := s.network.LatestHeight()
s.Require().NoError(err, "Getting initial latest height")
s.T().Logf("Initial latest height: %d", height)

s.Run(tc.name, func() {
clientCtx := val.ClientCtx

Expand All @@ -447,5 +484,9 @@ func (s *E2ETestSuite) TestNewMsgClawbackCmd() {
s.Require().Equal(tc.expectedCode, txResp.Code)
}
})
next, err := s.network.WaitForHeight(height + 1)
s.Require().NoError(err, "Waiting for height...")
height = next
s.T().Logf("Height now: %d", height)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"length_seconds": -500
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"periods": [
{
"coins": "10stake",
"length": 2592000
"length_seconds": 2592000
},
{
"coins": "10stake",
"length":2592000
"length_seconds":2592000
}
]
}
5 changes: 4 additions & 1 deletion tests/e2e/gov/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (s *E2ETestSuite) TestCmdParams() {
{
"json output",
[]string{fmt.Sprintf("--%s=json", flags.FlagOutput)},
`{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","proposal_cancel_ratio":"0.500000000000000000","proposal_cancel_dest":"","expedited_voting_period":"86400s","expedited_threshold":"0.667000000000000000","expedited_min_deposit":[{"denom":"stake","amount":"50000000"}]}}`,
`{"voting_params":{"voting_period":"172800s"},"deposit_params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s"},"tally_params":{"quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000"},"params":{"min_deposit":[{"denom":"stake","amount":"10000000"}],"max_deposit_period":"172800s","voting_period":"172800s","quorum":"0.334000000000000000","threshold":"0.500000000000000000","veto_threshold":"0.334000000000000000","min_initial_deposit_ratio":"0.000000000000000000","expedited_voting_period":"86400s","expedited_threshold":"0.667000000000000000","expedited_min_deposit":[{"denom":"stake","amount":"50000000"}],"burn_vote_quorum":false,"burn_proposal_deposit_prevote":false,"burn_vote_veto":true}}`,
},
{
"text output",
Expand All @@ -35,6 +35,9 @@ deposit_params:
- amount: "10000000"
denom: stake
params:
burn_proposal_deposit_prevote: false
burn_vote_quorum: false
burn_vote_veto: true
expedited_min_deposit:
- amount: "50000000"
denom: stake
Expand Down
1 change: 1 addition & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ replace (
// We always want to test against the latest version of the simapp.
cosmossdk.io/simapp => ../simapp
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/cometbft/cometbft => github.com/osmosis-labs/cometbft v0.0.0-20240103055822-28da358e3146
// We always want to test against the latest version of the SDK.
github.com/cosmos/cosmos-sdk => ../.
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
Expand Down
4 changes: 2 additions & 2 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA=
github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c=
github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc=
github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4=
Expand Down Expand Up @@ -807,6 +805,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/osmosis-labs/cometbft v0.0.0-20240103055822-28da358e3146 h1:Qkshh58fZCRoHSzbyW8NJf1wBhf9bg1MPFZEuyuI9lE=
github.com/osmosis-labs/cometbft v0.0.0-20240103055822-28da358e3146/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
Expand Down
Loading