diff --git a/tests/e2e/bcd_consumer_integration_test.go b/tests/e2e/bcd_consumer_integration_test.go index 727153d..8f0ef00 100644 --- a/tests/e2e/bcd_consumer_integration_test.go +++ b/tests/e2e/bcd_consumer_integration_test.go @@ -297,7 +297,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewardsGeneration() { s.NotNil(czActivatedBlock) // Ensure the staking contract balance is initially empty - rewards, err := s.cosmwasmController.QueryStakingContractBalances() + rewards, err := s.cosmwasmController.QueryFinalityContractBalances() s.NoError(err) s.Empty(rewards) @@ -344,7 +344,7 @@ func (s *BCDConsumerIntegrationTestSuite) Test6ConsumerFPRewardsGeneration() { // Ensure consumer rewards are generated and sent to the staking contract s.Eventually(func() bool { - rewards, err := s.cosmwasmController.QueryStakingContractBalances() + rewards, err := s.cosmwasmController.QueryFinalityContractBalances() if err != nil { s.T().Logf("failed to query rewards: %s", err.Error()) return false diff --git a/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go b/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go index c92ce71..3f88f44 100644 --- a/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go +++ b/tests/e2e/cosmos-integration-e2e/clientcontroller/cosmwasm/cosmwasm.go @@ -584,6 +584,10 @@ func (cc *CosmwasmConsumerController) QueryDelegations() (*ConsumerDelegationsRe return &resp, nil } +func (cc *CosmwasmConsumerController) QueryFinalityContractBalances() (sdk.Coins, error) { + return cc.QueryBalances(cc.cfg.BtcFinalityContractAddress) +} + func (cc *CosmwasmConsumerController) QueryStakingContractBalances() (sdk.Coins, error) { return cc.QueryBalances(cc.cfg.BtcStakingContractAddress) } diff --git a/tests/testdata/btc_finality.wasm b/tests/testdata/btc_finality.wasm index 6c377b5..1266820 100644 Binary files a/tests/testdata/btc_finality.wasm and b/tests/testdata/btc_finality.wasm differ diff --git a/tests/testdata/version.txt b/tests/testdata/version.txt index 4a037da..c08d334 100644 --- a/tests/testdata/version.txt +++ b/tests/testdata/version.txt @@ -1 +1 @@ -4e0214702fc01ebbbf0e966a88ac115726180a5b +84130eb706e1fb60e16cecf9ce8ade94b66ffa62 diff --git a/x/babylon/keeper/mint_rewards.go b/x/babylon/keeper/mint_rewards.go index eb742d9..871b9e0 100644 --- a/x/babylon/keeper/mint_rewards.go +++ b/x/babylon/keeper/mint_rewards.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/errors" ) -// MintBlockRewards mints new tokens and sends them to the staking contract for distribution. +// MintBlockRewards mints new tokens and sends them to the finality contract for distribution. // Authorization of the actor should be handled before entering this method. // Authorization of the recipient is being handled within the method for safety, but can // be removed for flexibility @@ -26,9 +26,9 @@ func (k Keeper) MintBlockRewards(pCtx sdk.Context, recipient sdk.AccAddress, amt } // FIXME? Remove this constraint for flexibility params := k.GetParams(pCtx) - if recipient.String() != params.BtcStakingContractAddress { - return sdkmath.ZeroInt(), errors.ErrUnauthorized.Wrapf("invalid recipient: got %s, expected staking contract (%s)", - recipient, params.BtcStakingContractAddress) + if recipient.String() != params.BtcFinalityContractAddress { + return sdkmath.ZeroInt(), errors.ErrUnauthorized.Wrapf("invalid recipient: got %s, expected finality contract (%s)", + recipient, params.BtcFinalityContractAddress) } // TODO?: Ensure Babylon constraints