Skip to content

Commit

Permalink
Fixes after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Mar 22, 2024
1 parent 0155866 commit e481cd9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions cmd/zetatool/filterdeposit/btc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/spf13/cobra"
"github.com/zeta-chain/zetacore/cmd/zetatool/config"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
)

func NewBtcCmd() *cobra.Command {
Expand Down Expand Up @@ -162,7 +162,7 @@ func getHashList(cfg *config.Config, tssAddress string) ([]Deposit, error) {
if err != nil {
continue
}
if bytes.Equal(memoBytes, []byte(common.DonationMessage)) {
if bytes.Equal(memoBytes, []byte(pkg.DonationMessage)) {
continue
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetatool/filterdeposit/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/erc20custody.sol"
"github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.non-eth.sol"
"github.com/zeta-chain/zetacore/cmd/zetatool/config"
zetacommon "github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
)

const (
Expand Down Expand Up @@ -202,7 +202,7 @@ func getTSSDeposits(tssAddress string, startBlock uint64, endBlock uint64, apiKe

for _, tx := range txns {
if tx.To == tssAddress {
if strings.Compare(tx.Input, zetacommon.DonationMessage) == 0 {
if strings.Compare(tx.Input, pkg.DonationMessage) == 0 {
continue // skip donation tx
}
if tx.TxReceiptStatus != "1" {
Expand Down
4 changes: 2 additions & 2 deletions x/observer/keeper/msg_server_reset_chain_nonces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types"
"github.com/zeta-chain/zetacore/x/observer/types"
)
Expand All @@ -22,7 +22,7 @@ func (k msgServer) ResetChainNonces(goCtx context.Context, msg *types.MsgResetCh
return nil, types.ErrTssNotFound
}

chain := common.GetChainFromChainID(msg.ChainId)
chain := pkg.GetChainFromChainID(msg.ChainId)
if chain == nil {
return nil, types.ErrSupportedChains
}
Expand Down
10 changes: 5 additions & 5 deletions x/observer/keeper/msg_server_reset_chain_nonces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
keepertest "github.com/zeta-chain/zetacore/testutil/keeper"
"github.com/zeta-chain/zetacore/testutil/sample"
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types"
Expand All @@ -19,7 +19,7 @@ func TestMsgServer_ResetChainNonces(t *testing.T) {
UseAuthorityMock: true,
})
srv := keeper.NewMsgServerImpl(*k)
chainId := common.GoerliLocalnetChain().ChainId
chainId := pkg.GoerliLocalnetChain().ChainId

admin := sample.AccAddress()
authorityMock := keepertest.GetObserverAuthorityMock(t, k)
Expand All @@ -44,7 +44,7 @@ func TestMsgServer_ResetChainNonces(t *testing.T) {
authorityMock := keepertest.GetObserverAuthorityMock(t, k)
keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupAdmin, true)

chainId := common.GoerliLocalnetChain().ChainId
chainId := pkg.GoerliLocalnetChain().ChainId
_, err := srv.ResetChainNonces(sdk.WrapSDKContext(ctx), &types.MsgResetChainNonces{
Creator: admin,
ChainId: chainId,
Expand Down Expand Up @@ -88,8 +88,8 @@ func TestMsgServer_ResetChainNonces(t *testing.T) {
keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupAdmin, true)
keepertest.MockIsAuthorized(&authorityMock.Mock, admin, authoritytypes.PolicyType_groupAdmin, true)

chainId := common.GoerliLocalnetChain().ChainId
index := common.GoerliLocalnetChain().ChainName.String()
chainId := pkg.GoerliLocalnetChain().ChainId
index := pkg.GoerliLocalnetChain().ChainName.String()

// check existing chain nonces
_, found := k.GetChainNonces(ctx, index)
Expand Down
4 changes: 2 additions & 2 deletions x/observer/types/message_reset_chain_nonces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"

cosmoserrors "cosmossdk.io/errors"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -51,7 +51,7 @@ func (msg *MsgResetChainNonces) ValidateBasic() error {
}

// Check if chain exists
chain := common.GetChainFromChainID(msg.ChainId)
chain := pkg.GetChainFromChainID(msg.ChainId)
if chain == nil {
return cosmoserrors.Wrapf(sdkerrors.ErrInvalidChainID, "invalid chain id (%d)", msg.ChainId)
}
Expand Down
14 changes: 7 additions & 7 deletions x/observer/types/message_reset_chain_nonces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
"github.com/zeta-chain/zetacore/testutil/sample"
"github.com/zeta-chain/zetacore/x/observer/types"
)
Expand All @@ -20,7 +20,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "valid message chain nonce high greater than nonce low",
msg: types.MsgResetChainNonces{
Creator: sample.AccAddress(),
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
ChainNonceLow: 1,
ChainNonceHigh: 5,
},
Expand All @@ -30,7 +30,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "valid message chain nonce high same as nonce low",
msg: types.MsgResetChainNonces{
Creator: sample.AccAddress(),
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
ChainNonceLow: 1,
ChainNonceHigh: 1,
},
Expand All @@ -40,7 +40,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "invalid address",
msg: types.MsgResetChainNonces{
Creator: "invalid_address",
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
},
wantErr: true,
},
Expand All @@ -56,7 +56,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "invalid chain nonce low",
msg: types.MsgResetChainNonces{
Creator: sample.AccAddress(),
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
ChainNonceLow: -1,
},
wantErr: true,
Expand All @@ -65,7 +65,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "invalid chain nonce high",
msg: types.MsgResetChainNonces{
Creator: sample.AccAddress(),
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
ChainNonceLow: 1,
ChainNonceHigh: -1,
},
Expand All @@ -75,7 +75,7 @@ func TestMsgResetChainNonces_ValidateBasic(t *testing.T) {
name: "invalid chain nonce low greater than chain nonce high",
msg: types.MsgResetChainNonces{
Creator: sample.AccAddress(),
ChainId: common.ExternalChainList()[0].ChainId,
ChainId: pkg.ExternalChainList()[0].ChainId,
ChainNonceLow: 1,
ChainNonceHigh: 0,
},
Expand Down
6 changes: 3 additions & 3 deletions zetaclient/testutils/stub/chain_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package stub

import (
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/pkg"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
"github.com/zeta-chain/zetacore/zetaclient/interfaces"
"github.com/zeta-chain/zetacore/zetaclient/outtxprocessor"
Expand All @@ -15,13 +15,13 @@ var _ interfaces.ChainSigner = (*EVMSigner)(nil)

// EVMSigner is a mock of evm chain signer for testing
type EVMSigner struct {
Chain common.Chain
Chain pkg.Chain
ZetaConnectorAddress ethcommon.Address
ERC20CustodyAddress ethcommon.Address
}

func NewEVMSigner(
chain common.Chain,
chain pkg.Chain,
zetaConnectorAddress ethcommon.Address,
erc20CustodyAddress ethcommon.Address,
) *EVMSigner {
Expand Down

0 comments on commit e481cd9

Please sign in to comment.