From 8b63024a0c749c3c61c3daee3695f4546d8079ff Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sat, 25 Apr 2020 10:53:09 -0600 Subject: [PATCH] fix: minor cleanups --- packages/cosmic-swingset/app/app.go | 2 +- packages/cosmic-swingset/bin/ag-nchainz | 9 +++++++-- packages/cosmic-swingset/go.mod | 4 ++-- packages/cosmic-swingset/go.sum | 2 ++ packages/cosmic-swingset/x/swingset/ibc.go | 2 +- .../cosmic-swingset/x/swingset/internal/keeper/keeper.go | 3 +-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/cosmic-swingset/app/app.go b/packages/cosmic-swingset/app/app.go index 91d2131ecbb..f37c3443b14 100644 --- a/packages/cosmic-swingset/app/app.go +++ b/packages/cosmic-swingset/app/app.go @@ -329,7 +329,7 @@ func NewAgoricApp( distr.NewAppModule(appCodec, app.distrKeeper, app.accountKeeper, app.bankKeeper, app.stakingKeeper), staking.NewAppModule(appCodec, app.stakingKeeper, app.accountKeeper, app.bankKeeper), upgrade.NewAppModule(app.upgradeKeeper), - evidence.NewAppModule(app.evidenceKeeper), + evidence.NewAppModule(appCodec, app.evidenceKeeper), ibc.NewAppModule(app.ibcKeeper), params.NewAppModule(app.paramsKeeper), transferModule, diff --git a/packages/cosmic-swingset/bin/ag-nchainz b/packages/cosmic-swingset/bin/ag-nchainz index d12ae274b5b..aaff2d3dfd9 100755 --- a/packages/cosmic-swingset/bin/ag-nchainz +++ b/packages/cosmic-swingset/bin/ag-nchainz @@ -11,6 +11,8 @@ set -e progname=$(basename -- "$0") +trap 'kill $(jobs -p) 2>/dev/null' EXIT + BASE_PORT=8000 NUM_SOLOS=1 @@ -59,9 +61,10 @@ testnet) ag-solo 1000uag done # $thisdir/../../deployment/set-json.js $n0d/config/genesis.json --agoric-genesis-overrides - for node in `ls -d $chainid/n[1-9]* 2>/dev/null`; do + for node in `ls -d $chainid/n[1-9]* 2>/dev/null || :`; do cp $n0d/config/genesis.json $node/$DAEMON/config/genesis.json done + exit 0 ;; start-daemon) BASEDIR=$1 @@ -73,6 +76,7 @@ start-daemon) done echo "Starting BOOT_ADDRESS=$ba $DAEMON ${1+"$@"}" DEBUG=agoric ROLE=two_chain BOOT_ADDRESS=$ba $DAEMON ${1+"$@"} + exit 0 ;; start-solos) @@ -100,8 +104,9 @@ start-solos) ) >>nchainz/logs/$log 2>&1 & done sleep 2 - echo "Waiting for all solos (Hit Control-C to exit)..." + echo "Waiting for all ${1+"$@ "}solos (Hit Control-C to exit)..." wait + exit 0 ;; *) echo 1>&2 "$progname: unrecognized command \`$COMMAND'" diff --git a/packages/cosmic-swingset/go.mod b/packages/cosmic-swingset/go.mod index 0732b6236c2..2c3e5a91f26 100644 --- a/packages/cosmic-swingset/go.mod +++ b/packages/cosmic-swingset/go.mod @@ -6,8 +6,8 @@ require ( github.com/99designs/keyring v1.1.4 // indirect github.com/Agoric/agoric-sdk v0.0.0-00010101000000-000000000000 // indirect github.com/bartekn/go-bip39 v0.0.0-20171116152956-a05967ea095d // indirect - github.com/cosmos/cosmos-sdk v0.34.4-0.20200422222342-f6e9ee762358 - github.com/gibson042/canonicaljson-go v1.0.3 // indirect + github.com/cosmos/cosmos-sdk v0.34.4-0.20200423194215-1cd1d088df05 + github.com/gibson042/canonicaljson-go v1.0.3 // indirect github.com/golang/mock v1.4.3 // indirect github.com/gorilla/handlers v1.4.2 // indirect github.com/gorilla/mux v1.7.4 diff --git a/packages/cosmic-swingset/go.sum b/packages/cosmic-swingset/go.sum index f323156761c..6350c203679 100644 --- a/packages/cosmic-swingset/go.sum +++ b/packages/cosmic-swingset/go.sum @@ -87,6 +87,8 @@ github.com/cosmos/cosmos-sdk v0.34.4-0.20200417201027-11528d39594c h1:Yd7DVqfImC github.com/cosmos/cosmos-sdk v0.34.4-0.20200417201027-11528d39594c/go.mod h1:jngw1LJfwEAU+xc/tZwUGIXBAJHapckYGtXycsq8D+U= github.com/cosmos/cosmos-sdk v0.34.4-0.20200422222342-f6e9ee762358 h1:ZsII2yECeLh2jWqFz3bK8JInzzlHPhgB0ob2c9XMyz4= github.com/cosmos/cosmos-sdk v0.34.4-0.20200422222342-f6e9ee762358/go.mod h1:Kcgs8c2WWtO2Q+KmDogvGRw+sdEqpvHYXFhj/QiAoOg= +github.com/cosmos/cosmos-sdk v0.34.4-0.20200423194215-1cd1d088df05 h1:jaV9iTBaiYmNAMaDEhvWukIQWQ/NfBoHbgSqPgdKFmM= +github.com/cosmos/cosmos-sdk v0.34.4-0.20200423194215-1cd1d088df05/go.mod h1:Kcgs8c2WWtO2Q+KmDogvGRw+sdEqpvHYXFhj/QiAoOg= github.com/cosmos/cosmos-sdk v0.38.3 h1:qIBTiw+2T9POaSUJ5rvbBbXeq8C8btBlJxnSegPBd3Y= github.com/cosmos/cosmos-sdk v0.38.3/go.mod h1:rzWOofbKfRt3wxiylmYWEFHnxxGj0coyqgWl2I9obAw= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= diff --git a/packages/cosmic-swingset/x/swingset/ibc.go b/packages/cosmic-swingset/x/swingset/ibc.go index 01580fb4a06..cb43f2cc4a5 100644 --- a/packages/cosmic-swingset/x/swingset/ibc.go +++ b/packages/cosmic-swingset/x/swingset/ibc.go @@ -102,7 +102,7 @@ func (ch channelHandler) Receive(ctx *ControllerContext, str string) (ret string } case "bindPort": - err = ctx.Keeper.BindPort(ctx.Context, msg.PortID, ch.ibcModule) + err = ctx.Keeper.BindPort(ctx.Context, msg.PortID) if err == nil { ret = "true" } diff --git a/packages/cosmic-swingset/x/swingset/internal/keeper/keeper.go b/packages/cosmic-swingset/x/swingset/internal/keeper/keeper.go index cd25d87c2d1..63d0e1838fb 100644 --- a/packages/cosmic-swingset/x/swingset/internal/keeper/keeper.go +++ b/packages/cosmic-swingset/x/swingset/internal/keeper/keeper.go @@ -212,8 +212,7 @@ func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error { // BindPort defines a wrapper function for the port Keeper's function in // order to expose it to the SwingSet IBC handler. -// It also registers a route to the port. -func (k Keeper) BindPort(ctx sdk.Context, portID string, mod porttypes.IBCModule) error { +func (k Keeper) BindPort(ctx sdk.Context, portID string) error { cap := k.portKeeper.BindPort(ctx, portID) return k.ClaimCapability(ctx, cap, porttypes.PortPath(portID)) }