Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 6, 2024
2 parents cb11122 + d548017 commit 263e0d1
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 24 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/docs/swagger_legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -524,7 +524,7 @@ paths:
sequence:
type: string
500:
description: Server internel error
description: Server internal error
/staking/delegators/{delegatorAddr}/delegations:
parameters:
- in: path
Expand Down
4 changes: 2 additions & 2 deletions app/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
34 changes: 33 additions & 1 deletion integration_tests/test_gov.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
2 changes: 1 addition & 1 deletion nix/build_overlay.nix
Original file line number Diff line number Diff line change
@@ -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 { };
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p align="center">
<a href="https://github.com/crypto-org-chain/chain-main/actions/workflows/build.yml"><img label="Build Status" src="https://github.com/crypto-org-chain/chain-main/actions/workflows/build.yml/badge.svg" /></a>
<a href="https://codecov.io/gh/crypto-org-chain/chain-main"><img label="Code Coverage" src="https://codecov.io/gh/crypto-org-chain/chain-main/branch/master/graph/badge.svg" /></a>
<a href="https://discord.gg/pahqHz26q4"><img label="Discord" src="https://img.shields.io/discord/783264383978569728.svg" /></a>
<a href="https://discord.gg/pahqHz26q4"><img label="Discord" src="https://img.shields.io/discord/783264383978569728.svg?color=7289da&label=Cronos.org%20Chain&logo=discord&style=flat-square" /></a>
</p>

## Table of Contents
Expand Down
2 changes: 1 addition & 1 deletion x/nft-transfer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
2 changes: 1 addition & 1 deletion x/nft-transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion x/nft/keeper/nft.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 263e0d1

Please sign in to comment.