diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8568ad1f2..6aa1fea27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,12 +70,17 @@ jobs: if: github.event_name == 'issue_comment' env: COMMENT_BODY: ${{ github.event.comment.body }} + COMMENT_DATE: ${{ github.event.comment.created_at }} run: | - echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT + PR_PUSHED_AT="${{ fromJson(steps.request.outputs.data).pushed_at }}" comment_hash=`echo "$COMMENT_BODY" | cut -d' ' -f2` # get commit hash if any if [[ "${comment_hash}" == "/runsim" ]]; then - # use default head ref - echo "ref=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT + # use default head ref, if the PR hasn't changed since the comment + if [[ $(date -d "$PR_PUSHED_AT" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then + echo "The PR has changed since the comment, and is therefore not safe to use. Exiting." + exit 1 + fi + echo "ref=${{ fromJson(steps.request.outputs.data).head.sha }}" >> $GITHUB_OUTPUT else # use comment provided ref echo "ref=${comment_hash}" >> $GITHUB_OUTPUT @@ -90,7 +95,6 @@ jobs: with: submodules: true token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ steps.pr_data.outputs.repo_name }} ref: ${{ steps.pr_data.outputs.ref }} - name: Normal check out code uses: actions/checkout@v3 @@ -210,7 +214,6 @@ jobs: with: submodules: true token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} ref: ${{ needs.build.outputs.ref }} - name: Normal check out code uses: actions/checkout@v3 @@ -257,7 +260,6 @@ jobs: with: submodules: true token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} ref: ${{ needs.build.outputs.ref }} - name: Normal check out code uses: actions/checkout@v3 @@ -304,7 +306,6 @@ jobs: with: submodules: true token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ needs.build.outputs.repo_name }} ref: ${{ needs.build.outputs.ref }} - name: Normal check out code uses: actions/checkout@v3 @@ -346,27 +347,27 @@ jobs: if: always() && github.event_name == 'issue_comment' && needs.member.outputs.valid == 'true' steps: - name: Download artifact pass_status_build - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4.1.7 continue-on-error: true with: name: pass_status_build - name: Download artifact pass_status_install - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4.1.7 continue-on-error: true with: name: pass_status_install - name: Download artifact pass_status_sim1 - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4.1.7 continue-on-error: true with: name: pass_status_sim1 - name: Download artifact pass_status_sim2 - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4.1.7 continue-on-error: true with: name: pass_status_sim2 - name: Download artifact pass_status_sim3 - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4.1.7 continue-on-error: true with: name: pass_status_sim3 diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 05194711c..0d1c8f9e3 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -95,6 +95,8 @@ jobs: test-upgrade: runs-on: ubuntu-latest steps: + - name: Create more disk space + run: sudo rm -rf /usr/share/dotnet && sudo rm -rf /opt/ghc && sudo rm -rf "/usr/local/share/boost" && sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: submodules: true diff --git a/app/app.go b/app/app.go index d42337b9a..ee43ee0f4 100644 --- a/app/app.go +++ b/app/app.go @@ -782,7 +782,7 @@ func New( v1 := app.qms.LatestVersion() v2 := app.LastBlockHeight() if v1 > 0 && v1 != v2 { - tmos.Exit(fmt.Sprintf("versiondb lastest version %d don't match iavl latest version %d", v1, v2)) + tmos.Exit(fmt.Sprintf("versiondb latest version %d don't match iavl latest version %d", v1, v2)) } } } diff --git a/app/docs/swagger_legacy.yaml b/app/docs/swagger_legacy.yaml index 48f5021d5..ec9cd030b 100644 --- a/app/docs/swagger_legacy.yaml +++ b/app/docs/swagger_legacy.yaml @@ -301,7 +301,7 @@ paths: parameters: - in: body name: txBroadcast - description: The tx must be a signed StdTx. The supported broadcast modes include `"block"`(return after tx commit), `"sync"`(return afer CheckTx) and `"async"`(return right away). + description: The tx must be a signed StdTx. The supported broadcast modes include `"block"`(return after tx commit), `"sync"`(return after CheckTx) and `"async"`(return right away). required: true schema: type: object @@ -524,7 +524,7 @@ paths: sequence: type: string 500: - description: Server internel error + description: Server internal error /staking/delegators/{delegatorAddr}/delegations: parameters: - in: path diff --git a/app/types.go b/app/types.go index 00cb0b05b..02b13e057 100644 --- a/app/types.go +++ b/app/types.go @@ -16,7 +16,7 @@ type App interface { Name() string // The application types codec. - // NOTE: This shoult be sealed before being returned. + // NOTE: This should be sealed before being returned. LegacyAmino() *codec.LegacyAmino // Application updates every begin block. @@ -36,6 +36,6 @@ type App interface { forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string, ) (servertypes.ExportedApp, error) - // All the registered module account addreses. + // All the registered module account addresses. ModuleAccountAddrs() map[string]bool } diff --git a/integration_tests/test_basic.py b/integration_tests/test_basic.py index 4b679b40f..79eacf33f 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -103,4 +103,4 @@ def test_statesync(cluster): # discovery_time is set to 5 seconds, add extra seconds for processing wait_for_block(cluster.cosmos_cli(i), 10) - print("succesfully syncing") + print("successfully syncing") diff --git a/integration_tests/test_gov.py b/integration_tests/test_gov.py index edebc944a..e9b8e1248 100644 --- a/integration_tests/test_gov.py +++ b/integration_tests/test_gov.py @@ -222,7 +222,7 @@ def test_inherit_vote(cluster, tmp_path): def test_host_enabled(cluster, tmp_path): cli = cluster.cosmos_cli() - p = cluster.cosmos_cli().query_host_params() + p = cli.query_host_params() assert p["host_enabled"] p["host_enabled"] = False proposal = tmp_path / "proposal.json" @@ -247,3 +247,35 @@ def test_host_enabled(cluster, tmp_path): approve_proposal(cluster, rsp, msg=msg) p = cli.query_host_params() assert not p["host_enabled"] + + +def test_gov_voting(cluster, tmp_path): + """ + - change voting_period from default 10s to 3m36s + """ + cli = cluster.cosmos_cli() + p = cli.query_params("gov") + assert p["params"]["voting_period"] == "10s" + updated = "3m36s" + p["params"]["voting_period"] = updated + proposal = tmp_path / "proposal.json" + authority = module_address("gov") + type = "/cosmos.gov.v1.MsgUpdateParams" + proposal_src = { + "messages": [ + { + "@type": type, + "authority": authority, + "params": p["params"], + } + ], + "deposit": "10000000basecro", + "title": "title", + "summary": "summary", + } + proposal.write_text(json.dumps(proposal_src)) + rsp = cluster.submit_gov_proposal(proposal, from_="community") + assert rsp["code"] == 0, rsp["raw_log"] + approve_proposal(cluster, rsp, msg=f",{type}") + p = cli.query_params("gov") + assert p["params"]["voting_period"] == updated diff --git a/nix/build_overlay.nix b/nix/build_overlay.nix index 476654e66..2870eae80 100644 --- a/nix/build_overlay.nix +++ b/nix/build_overlay.nix @@ -1,4 +1,4 @@ -# some basic overlays nessesary for the build +# some basic overlays necessary for the build final: super: { rocksdb = final.callPackage ./rocksdb.nix { }; } diff --git a/readme.md b/readme.md index 71ad446a7..c6f7f209e 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@
## Table of Contents diff --git a/x/nft-transfer/client/cli/query.go b/x/nft-transfer/client/cli/query.go index a8347c3c7..6c2fc3c8c 100644 --- a/x/nft-transfer/client/cli/query.go +++ b/x/nft-transfer/client/cli/query.go @@ -11,7 +11,7 @@ import ( "github.com/crypto-org-chain/chain-main/v4/x/nft-transfer/types" ) -// GetCmdQueryClassTrace defines the command to query a a class trace from a given trace hash or ibc class. +// GetCmdQueryClassTrace defines the command to query a class trace from a given trace hash or ibc class. func GetCmdQueryClassTrace() *cobra.Command { cmd := &cobra.Command{ Use: "class-trace [hash/class]", diff --git a/x/nft-transfer/keeper/relay.go b/x/nft-transfer/keeper/relay.go index 0b8163a15..4139d0686 100644 --- a/x/nft-transfer/keeper/relay.go +++ b/x/nft-transfer/keeper/relay.go @@ -131,7 +131,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, return k.processReceivedPacket(ctx, packet, data) } -// OnAcknowledgementPacket responds to the the success or failure of a packet +// OnAcknowledgementPacket responds to the success or failure of a packet // acknowledgement written on the receiving chain. If the acknowledgement // was a success then nothing occurs. If the acknowledgement failed, then // the sender is refunded their tokens using the refundPacketToken function. diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index 08381f45e..c633d6d37 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -10,7 +10,7 @@ import ( "github.com/crypto-org-chain/chain-main/v4/x/nft/types" ) -// GetNFT gets the the specified NFT +// GetNFT gets the specified NFT func (k Keeper) GetNFT(ctx sdk.Context, denomID, tokenID string) (nft exported.NFT, err error) { store := ctx.KVStore(k.storeKey)