Skip to content

Commit

Permalink
Merge branch 'main' into feat/cosmos-sdk-v0.45.15
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0n00gler committed Apr 18, 2023
2 parents 38f81fa + 86f32b3 commit 7d488c5
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 46 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ init-golang-rly: kill-dev install
@echo "Initializing relayer..."
./network/relayer/interchain-acc-config/rly.sh

start:
@echo "Starting up test network"
./network/start.sh
start: kill-dev install
@echo "Starting up neutrond alone..."
BINARY=neutrond CHAINID=test-1 P2PPORT=26656 RPCPORT=26657 RESTPORT=1317 ROSETTA=8080 GRPCPORT=8090 GRPCWEB=8091 STAKEDENOM=untrn \
./network/init.sh && ./network/init-neutrond.sh && ./network/start.sh

start-rly:
./network/hermes/start.sh
Expand Down
Binary file modified contracts/cwd_core.wasm
Binary file not shown.
Binary file modified contracts/cwd_pre_propose_multiple.wasm
Binary file not shown.
Binary file modified contracts/cwd_pre_propose_overrule.wasm
Binary file not shown.
Binary file modified contracts/cwd_pre_propose_single.wasm
Binary file not shown.
Binary file modified contracts/cwd_proposal_multiple.wasm
100644 → 100755
Binary file not shown.
Binary file modified contracts/cwd_proposal_single.wasm
Binary file not shown.
Binary file modified contracts/cwd_subdao_core.wasm
Binary file not shown.
Binary file modified contracts/cwd_subdao_pre_propose_single.wasm
Binary file not shown.
Binary file modified contracts/cwd_subdao_proposal_single.wasm
Binary file not shown.
Binary file modified contracts/cwd_subdao_timelock_single.wasm
Binary file not shown.
Binary file modified contracts/lockdrop_vault.wasm
Binary file not shown.
Binary file modified contracts/neutron_reserve.wasm
Binary file not shown.
Binary file modified contracts/neutron_vault.wasm
Binary file not shown.
Binary file modified contracts/neutron_voting_registry.wasm
Binary file not shown.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/neutron-org/neutron
go 1.18

require (
github.com/CosmWasm/wasmd v0.30.0
github.com/CosmWasm/wasmvm v1.1.1
github.com/CosmWasm/wasmd v0.31.0
github.com/CosmWasm/wasmvm v1.2.1
github.com/armon/go-metrics v0.4.1
github.com/confio/ics23/go v0.9.0
github.com/cosmos/admin-module v0.0.0-00010101000000-000000000000
Expand Down Expand Up @@ -155,7 +155,7 @@ require (
)

replace (
github.com/CosmWasm/wasmd v0.30.0 => github.com/neutron-org/wasmd v0.30.0-ics-removed-genesis-checks
github.com/CosmWasm/wasmd v0.31.0 => github.com/neutron-org/wasmd v0.31.0-neutron-fixes
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2
github.com/cosmos/admin-module => github.com/Ethernal-Tech/admin-module v0.0.0-20221102105340-e693f4d379c3
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.15-ics
Expand Down
10 changes: 5 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3
github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w=
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
github.com/CloudyKit/jet/v6 v6.1.0/go.mod h1:d3ypHeIRNo2+XyqnGA8s+aphtcVpjP5hPwP/Lzo7Ro4=
github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4=
github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A=
github.com/CosmWasm/wasmvm v1.2.1 h1:si0tRsRDdUShV0k51Wn6zRKlmj3/WWP9Yr4cLmDTf+8=
github.com/CosmWasm/wasmvm v1.2.1/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
Expand Down Expand Up @@ -998,7 +998,7 @@ github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgn
github.com/cosmos/ibc-go/v3 v3.0.0/go.mod h1:Mb+1NXiPOLd+CPFlOC6BKeAUaxXlhuWenMmRiUiSmwY=
github.com/cosmos/ibc-go/v4 v4.3.0 h1:yOzVsyZzsv4XPBux8gq+D0LhZn45yGWKjvT+6Vyo5no=
github.com/cosmos/ibc-go/v4 v4.3.0/go.mod h1:CcLvIoi9NNtIbNsxs4KjBGjYhlwqtsmXy1AKARKiMzQ=
github.com/cosmos/interchain-accounts v0.2.4 h1:7UrroFQsCRSp17980mk6anx4YteveIJVkU+a0wlsHQI=
github.com/cosmos/interchain-accounts v0.2.6 h1:TV2M2g1/Rb9MCNw1YePdBKE0rcEczNj1RGHT+2iRYas=
github.com/cosmos/interchain-security v1.2.0 h1:DHC00F3diTXDBgTgLSB+O8qbs1p7DtTfUeO8XBEXsZo=
github.com/cosmos/interchain-security v1.2.0/go.mod h1:Y4onDsQuqkemGS7UqfyohahlBLt5gh1i8OVbPeMcuhA=
github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY=
Expand Down Expand Up @@ -2145,8 +2145,8 @@ github.com/neelance/sourcemap v0.0.0-20200213170602-2833bce08e4c/go.mod h1:Qr6/a
github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
github.com/networkplumbing/go-nft v0.2.0/go.mod h1:HnnM+tYvlGAsMU7yoYwXEVLLiDW9gdMmb5HoGcwpuQs=
github.com/neutron-org/wasmd v0.30.0-ics-removed-genesis-checks h1:YWDWEHobuZMMipP0rTItE/uN4Xs75GLQK1CKrgfn6ss=
github.com/neutron-org/wasmd v0.30.0-ics-removed-genesis-checks/go.mod h1:umLGeYyowAMMEdOYfDOf8jsDrQ75Qkm1+ogBXT/w01c=
github.com/neutron-org/wasmd v0.31.0-neutron-fixes h1:XvxPbxdtfWl/uH6eeZkN6FmfZbySjsToM6lIR/umNUE=
github.com/neutron-org/wasmd v0.31.0-neutron-fixes/go.mod h1:VcyDGk/ISVlMUeW+1GGL0zdHWBS2FPwLEV2qZ86l7l8=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nishanths/exhaustive v0.8.3/go.mod h1:qj+zJJUgJ76tR92+25+03oYUhzF4R7/2Wk7fGTfCHmg=
github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ=
Expand Down
33 changes: 5 additions & 28 deletions network/init-neutrond.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ PROPOSAL_MULTIPLE_CONTRACT=$CONTRACTS_BINARIES_DIR/cwd_proposal_multiple.wasm
VOTING_REGISTRY_CONTRACT=$CONTRACTS_BINARIES_DIR/neutron_voting_registry.wasm
# VAULTS
NEUTRON_VAULT_CONTRACT=$CONTRACTS_BINARIES_DIR/neutron_vault.wasm
LOCKDROP_VAULT_CONTRACT=$CONTRACTS_BINARIES_DIR/lockdrop_vault.wasm
# TREASURY
RESERVE_CONTRACT=$CONTRACTS_BINARIES_DIR/neutron_reserve.wasm
DISTRIBUTION_CONTRACT=$CONTRACTS_BINARIES_DIR/neutron_distribution.wasm
Expand Down Expand Up @@ -105,11 +104,6 @@ DAO_VOTING_REGISTRY_LABEL="neutron voting registry"
NEUTRON_VAULT_NAME="voting vault"
NEUTRON_VAULT_DESCRIPTION="simple voting vault for testing purposes"


## Lockdrop vault
LOCKDROP_VAULT_NAME="lockdrop vault"
LOCKDROP_VAULT_DESCRIPTION="simple voting vault for testing purposes"

## Basic vault
NEUTRON_VAULT_NAME="voting vault"
NEUTRON_VAULT_DESCRIPTION="simple voting vault for testing purposes"
Expand All @@ -128,12 +122,11 @@ GRANTS_SUBDAO_VOTING_MODULE_LABEL="grants voting module"
GRANTS_SUBDAO_PROPOSAL_LABEL="grants single proposal"

## Timelock
GRANTS_SUBDAO_TIMELOCK_DURATION=1200
GRANTS_SUBDAO_TIMELOCK_LABEL="subDAO timelock contract"

## Security subdao
SECURITY_SUBDAO_CORE_LABEL="neutron grants subdao"
SECURITY_SUBDAO_CORE_NAME="GRANTS"
SECURITY_SUBDAO_CORE_LABEL="neutron security subdao"
SECURITY_SUBDAO_CORE_NAME="SECURITY"
SECURITY_SUBDAO_CORE_DESCRIPTION="subdao that secures neutron"
SECURITY_SUBDAO_PROPOSAL_LABEL="security subdao single proposal"
SECURITY_SUBDAO_PREPROPOSAL_LABEL="security prerpopose"
Expand All @@ -160,7 +153,6 @@ PROPOSAL_MULTIPLE_CONTRACT_BINARY_ID=$(store_binary "$PROPOSAL_MULTIPLE_CONT
VOTING_REGISTRY_CONTRACT_BINARY_ID=$(store_binary "$VOTING_REGISTRY_CONTRACT")
# VAULTS
NEUTRON_VAULT_CONTRACT_BINARY_ID=$(store_binary "$NEUTRON_VAULT_CONTRACT")
LOCKDROP_VAULT_CONTRACT_BINARY_ID=$(store_binary "$LOCKDROP_VAULT_CONTRACT")
# TREASURY & RESERVE
TREASURY_CONTRACT_BINARY_ID=$(store_binary "$TREASURY_CONTRACT")
DISTRIBUTION_CONTRACT_BINARY_ID=$(store_binary "$DISTRIBUTION_CONTRACT")
Expand All @@ -184,7 +176,6 @@ INSTANCE_ID_COUNTER=1

# VAULTS
NEUTRON_VAULT_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$NEUTRON_VAULT_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
LOCKDROP_VAULT_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$LOCKDROP_VAULT_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))

# MAIN_DAO
DAO_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$DAO_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
Expand All @@ -202,8 +193,8 @@ DISTRIBUTION_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTAN
TREASURY_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$TREASURY_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
# SUBDAOS
SECURITY_SUBDAO_CORE_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$SUBDAO_CORE_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
SECURITY_SUBDAO_PRE_PROPOSE_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$PRE_PROPOSAL_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
SECURITY_SUBDAO_PROPOSAL_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$SUBDAO_PROPOSAL_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
SECURITY_SUBDAO_PRE_PROPOSE_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$SUBDAO_PROPOSAL_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
SECURITY_SUBDAO_VOTING_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$CW4_VOTING_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
SECURITY_SUBDAO_GROUP_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$CW4_GROUP_CONTRACT_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
GRANTS_SUBDAO_CORE_CONTRACT_ADDRESS=$($BINARY debug generate-contract-address "$INSTANCE_ID_COUNTER" "$SUBDAO_CORE_BINARY_ID") && (( INSTANCE_ID_COUNTER++ ))
Expand Down Expand Up @@ -341,8 +332,7 @@ VOTING_REGISTRY_INIT_MSG='{
}
},
"voting_vaults": [
"'"$NEUTRON_VAULT_CONTRACT_ADDRESS"'",
"'"$LOCKDROP_VAULT_CONTRACT_ADDRESS"'"
"'"$NEUTRON_VAULT_CONTRACT_ADDRESS"'"
]
}'
VOTING_REGISTRY_INIT_MSG_BASE64=$(echo "$VOTING_REGISTRY_INIT_MSG" | base64 | tr -d "\n")
Expand Down Expand Up @@ -423,18 +413,6 @@ NEUTRON_VAULT_INIT='{
"description": "'"$NEUTRON_VAULT_DESCRIPTION"'"
}'

# since the lockdrop_contract is still a mock, the address is a random valid one just to pass instantiation TODO: get rid of mock
LOCKDROP_VAULT_INIT='{
"owner": {
"address": {
"addr": "'"$ADMIN_ADDRESS"'"
}
},
"name": "'"$LOCKDROP_VAULT_NAME"'",
"description": "'"$LOCKDROP_VAULT_DESCRIPTION"'",
"lockdrop_contract": "neutron17zayzl5d0daqa89csvv8kqayxzke6jd6zh00tq"
}'

# CW4 MODULES FOR SUBDAOS

CW4_VOTE_INIT_MSG='{
Expand Down Expand Up @@ -519,7 +497,7 @@ SECURITY_SUBDAO_CORE_INIT_MSG='{
# GRANTS_SUBDAO

GRANTS_SUBDAO_TIMELOCK_INIT_MSG='{
"timelock_duration": '"$GRANTS_SUBDAO_TIMELOCK_DURATION"'
"overrule_pre_propose": "'"$PROPOSAL_OVERRULE_CONTRACT_ADDRESS"'"
}'
GRANTS_SUBDAO_TIMELOCK_INIT_MSG_BASE64=$(echo "$GRANTS_SUBDAO_TIMELOCK_INIT_MSG" | base64 | tr -d "\n")

Expand Down Expand Up @@ -603,7 +581,6 @@ echo "Instantiate contracts"
# It affects the section of predicting contracts addresses at the beginning of the script
# If you're to do any changes, please do it consistently in both sections
$BINARY add-wasm-message instantiate-contract "$NEUTRON_VAULT_CONTRACT_BINARY_ID" "$NEUTRON_VAULT_INIT" --label "DAO_Neutron_voting_vault" --run-as "$ADMIN_ADDRESS" --admin "$DAO_CONTRACT_ADDRESS" --home "$CHAIN_DIR"
$BINARY add-wasm-message instantiate-contract "$LOCKDROP_VAULT_CONTRACT_BINARY_ID" "$LOCKDROP_VAULT_INIT" --label "DAO_Neutron_lockdrop_vault" --run-as "$ADMIN_ADDRESS" --admin "$DAO_CONTRACT_ADDRESS" --home "$CHAIN_DIR"
$BINARY add-wasm-message instantiate-contract "$DAO_CONTRACT_BINARY_ID" "$DAO_INIT" --label "DAO" --run-as "$ADMIN_ADDRESS" --admin "$DAO_CONTRACT_ADDRESS" --home "$CHAIN_DIR"
$BINARY add-wasm-message instantiate-contract "$RESERVE_CONTRACT_BINARY_ID" "$RESERVE_INIT" --label "Reserve" --run-as "$ADMIN_ADDRESS" --admin "$DAO_CONTRACT_ADDRESS" --home "$CHAIN_DIR"
$BINARY add-wasm-message instantiate-contract "$DISTRIBUTION_CONTRACT_BINARY_ID" "$DISTRIBUTION_INIT" --label "Distribution" --run-as "$ADMIN_ADDRESS" --admin "$DAO_CONTRACT_ADDRESS" --home "$CHAIN_DIR"
Expand Down
7 changes: 4 additions & 3 deletions x/interchaintxs/keeper/ibc_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Pack
cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx)
defer k.outOfGasRecovery(ctx, newGasMeter, icaOwner.GetContract(), packet, "ack")

k.feeKeeper.DistributeAcknowledgementFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence))

// Actually we have only one kind of error returned from acknowledgement
// maybe later we'll retrieve actual errors from events
errorText := ack.GetError()
Expand All @@ -87,8 +89,6 @@ func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Pack
_, err = k.contractManagerKeeper.SudoResponse(cacheCtx, icaOwner.GetContract(), packet, ack.GetResult())
}

k.feeKeeper.DistributeAcknowledgementFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence))

if err != nil {
k.contractManagerKeeper.AddContractFailure(ctx, packet.SourceChannel, icaOwner.GetContract().String(), packet.GetSequence(), "ack")
k.Logger(ctx).Debug("HandleAcknowledgement: failed to Sudo contract on packet acknowledgement", "error", err)
Expand Down Expand Up @@ -117,6 +117,8 @@ func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, rela
cacheCtx, writeFn, newGasMeter := k.createCachedContext(ctx)
defer k.outOfGasRecovery(ctx, newGasMeter, icaOwner.GetContract(), packet, "timeout")

k.feeKeeper.DistributeTimeoutFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence))

_, err = k.contractManagerKeeper.SudoTimeout(cacheCtx, icaOwner.GetContract(), packet)
if err != nil {
k.contractManagerKeeper.AddContractFailure(ctx, packet.SourceChannel, icaOwner.GetContract().String(), packet.GetSequence(), "timeout")
Expand All @@ -125,7 +127,6 @@ func (k *Keeper) HandleTimeout(ctx sdk.Context, packet channeltypes.Packet, rela
writeFn()
}

k.feeKeeper.DistributeTimeoutFee(ctx, relayer, feetypes.NewPacketID(packet.SourcePort, packet.SourceChannel, packet.Sequence))
ctx.GasMeter().ConsumeGas(newGasMeter.GasConsumed(), "consume from cached context")

return nil
Expand Down
9 changes: 5 additions & 4 deletions x/interchaintxs/keeper/ibc_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import (
icatypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"
channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"

"github.com/neutron-org/neutron/testutil"
testkeeper "github.com/neutron-org/neutron/testutil/interchaintxs/keeper"
mock_types "github.com/neutron-org/neutron/testutil/mocks/interchaintxs/types"
"github.com/neutron-org/neutron/x/contractmanager/types"
feetypes "github.com/neutron-org/neutron/x/feerefunder/types"
"github.com/neutron-org/neutron/x/interchaintxs/keeper"
"github.com/stretchr/testify/require"
)

func TestHandleAcknowledgement(t *testing.T) {
Expand Down Expand Up @@ -78,7 +79,7 @@ func TestHandleAcknowledgement(t *testing.T) {
ctx.GasMeter().ConsumeGas(ctx.GasMeter().Limit()+1, "out of gas test")
}).Return(nil, fmt.Errorf("SudoError error"))
cmKeeper.EXPECT().AddContractFailure(ctx, "channel-0", contractAddress.String(), p.GetSequence(), "ack")
// feeKeeper.EXPECT().DistributeAcknowledgementFee(ctx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
feeKeeper.EXPECT().DistributeAcknowledgementFee(ctx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
err = icak.HandleAcknowledgement(ctx, p, errAckData, relayerAddress)
require.NoError(t, err)

Expand All @@ -104,7 +105,7 @@ func TestHandleAcknowledgement(t *testing.T) {
cmKeeper.EXPECT().SudoResponse(gomock.AssignableToTypeOf(lowGasCtx), contractAddress, p, resACK.GetResult()).Do(func(cachedCtx sdk.Context, senderAddress sdk.AccAddress, request channeltypes.Packet, msg []byte) {
cachedCtx.GasMeter().ConsumeGas(1, "Sudo response consumption")
}).Return(nil, nil)
// feeKeeper.EXPECT().DistributeAcknowledgementFee(lowGasCtx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
feeKeeper.EXPECT().DistributeAcknowledgementFee(lowGasCtx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
cmKeeper.EXPECT().AddContractFailure(lowGasCtx, "channel-0", contractAddress.String(), p.GetSequence(), "ack").Do(func(ctx sdk.Context, channelId string, address string, ackID uint64, ackType string) {
ctx.GasMeter().ConsumeGas(keeper.GasReserve, "out of gas")
})
Expand Down Expand Up @@ -157,7 +158,7 @@ func TestHandleTimeout(t *testing.T) {
ctx.GasMeter().ConsumeGas(ctx.GasMeter().Limit()+1, "out of gas test")
}).Return(nil, fmt.Errorf("SudoTimeout error"))
cmKeeper.EXPECT().AddContractFailure(ctx, "channel-0", contractAddress.String(), p.GetSequence(), "timeout")
// feeKeeper.EXPECT().DistributeTimeoutFee(ctx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
feeKeeper.EXPECT().DistributeTimeoutFee(ctx, relayerAddress, feetypes.NewPacketID(p.SourcePort, p.SourceChannel, p.Sequence))
err = icak.HandleTimeout(ctx, p, relayerAddress)
require.NoError(t, err)
}
Expand Down

0 comments on commit 7d488c5

Please sign in to comment.