Documentation
¶
Index ¶
- Constants
- Variables
- func MockChainParams(chainID int64, confirmation uint64) observertypes.ChainParams
- func MockConnectorNonEth(t *testing.T, chainID int64) *zetaconnector.ZetaConnectorNonEth
- func MockERC20Custody(t *testing.T, chainID int64) *erc20custody.ERC20Custody
- func NewKeyring() ckeys.Keyring
- type BTCObserver
- func (ob *BTCObserver) GetChainParams() observertypes.ChainParams
- func (ob *BTCObserver) GetTxID(_ uint64) string
- func (ob *BTCObserver) IsOutboundProcessed(_ context.Context, _ *crosschaintypes.CrossChainTx, _ zerolog.Logger) (bool, bool, error)
- func (ob *BTCObserver) SetChainParams(chainParams observertypes.ChainParams)
- func (ob *BTCObserver) Start(_ context.Context)
- func (ob *BTCObserver) Stop()
- func (ob *BTCObserver) WatchInboundTracker(_ context.Context) error
- type BTCSigner
- func (s *BTCSigner) GetERC20CustodyAddress() ethcommon.Address
- func (s *BTCSigner) GetZetaConnectorAddress() ethcommon.Address
- func (s *BTCSigner) SetERC20CustodyAddress(_ ethcommon.Address)
- func (s *BTCSigner) SetZetaConnectorAddress(_ ethcommon.Address)
- func (s *BTCSigner) TryProcessOutbound(_ context.Context, _ *crosschaintypes.CrossChainTx, ...)
- type CometBFTClient
- func (c *CometBFTClient) Block(_ context.Context, _ *int64) (*coretypes.ResultBlock, error)
- func (c *CometBFTClient) BroadcastTxAsync(_ context.Context, _ tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
- func (c *CometBFTClient) BroadcastTxCommit(_ context.Context, _ tmtypes.Tx) (*coretypes.ResultBroadcastTxCommit, error)
- func (c *CometBFTClient) BroadcastTxSync(_ context.Context, _ tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
- func (c *CometBFTClient) SetBroadcastTxHash(hash string) *CometBFTClient
- func (c *CometBFTClient) SetError(err error) *CometBFTClient
- func (c *CometBFTClient) Tx(_ context.Context, _ []byte, _ bool) (*coretypes.ResultTx, error)
- type EVMObserver
- func (ob *EVMObserver) GetChainParams() observertypes.ChainParams
- func (ob *EVMObserver) GetTxID(_ uint64) string
- func (ob *EVMObserver) IsOutboundProcessed(_ context.Context, _ *crosschaintypes.CrossChainTx, _ zerolog.Logger) (bool, bool, error)
- func (ob *EVMObserver) SetChainParams(chainParams observertypes.ChainParams)
- func (ob *EVMObserver) Start(_ context.Context)
- func (ob *EVMObserver) Stop()
- func (ob *EVMObserver) WatchInboundTracker(_ context.Context) error
- type EVMSigner
- func (s *EVMSigner) GetERC20CustodyAddress() ethcommon.Address
- func (s *EVMSigner) GetZetaConnectorAddress() ethcommon.Address
- func (s *EVMSigner) SetERC20CustodyAddress(address ethcommon.Address)
- func (s *EVMSigner) SetZetaConnectorAddress(address ethcommon.Address)
- func (s *EVMSigner) TryProcessOutbound(_ context.Context, _ *crosschaintypes.CrossChainTx, ...)
- type Keyring
- func (m Keyring) Backend() string
- func (m Keyring) Delete(_ string) error
- func (m Keyring) DeleteByAddress(_ sdk.Address) error
- func (m Keyring) ExportPrivKeyArmor(_, _ string) (armor string, err error)
- func (m Keyring) ExportPrivKeyArmorByAddress(_ sdk.Address, _ string) (armor string, err error)
- func (m Keyring) ExportPubKeyArmor(_ string) (string, error)
- func (m Keyring) ExportPubKeyArmorByAddress(_ sdk.Address) (string, error)
- func (m Keyring) ImportPrivKey(_, _, _ string) error
- func (m Keyring) ImportPrivKeyHex(_, _, _ string) error
- func (m Keyring) ImportPubKey(_ string, _ string) error
- func (m Keyring) Key(uid string) (*ckeys.Record, error)
- func (m Keyring) KeyByAddress(_ sdk.Address) (*ckeys.Record, error)
- func (m Keyring) List() ([]*ckeys.Record, error)
- func (m Keyring) MigrateAll() ([]*ckeys.Record, error)
- func (m Keyring) NewAccount(_, _, _, _ string, _ ckeys.SignatureAlgo) (*ckeys.Record, error)
- func (m Keyring) NewMnemonic(_ string, _ ckeys.Language, _, _ string, _ ckeys.SignatureAlgo) (*ckeys.Record, string, error)
- func (m Keyring) Rename(_ string, _ string) error
- func (m Keyring) SaveLedgerKey(_ string, _ ckeys.SignatureAlgo, _ string, _, _, _ uint32) (*ckeys.Record, error)
- func (m Keyring) SaveMultisig(_ string, _ cryptotypes.PubKey) (*ckeys.Record, error)
- func (m Keyring) SaveOfflineKey(_ string, _ cryptotypes.PubKey) (*ckeys.Record, error)
- func (m Keyring) Sign(_ string, _ []byte) ([]byte, cryptotypes.PubKey, error)
- func (m Keyring) SignByAddress(_ sdk.Address, _ []byte) ([]byte, cryptotypes.PubKey, error)
- func (m Keyring) SupportedAlgorithms() (ckeys.SigningAlgoList, ckeys.SigningAlgoList)
- type MockBTCRPCClient
- func (c *MockBTCRPCClient) CreateWallet(_ string, _ ...rpcclient.CreateWalletOpt) (*btcjson.CreateWalletResult, error)
- func (c *MockBTCRPCClient) EstimateSmartFee(_ int64, _ *btcjson.EstimateSmartFeeMode) (*btcjson.EstimateSmartFeeResult, error)
- func (c *MockBTCRPCClient) GenerateToAddress(_ int64, _ btcutil.Address, _ *int64) ([]*chainhash.Hash, error)
- func (c *MockBTCRPCClient) GetBalance(_ string) (btcutil.Amount, error)
- func (c *MockBTCRPCClient) GetBlockCount() (int64, error)
- func (c *MockBTCRPCClient) GetBlockHash(_ int64) (*chainhash.Hash, error)
- func (c *MockBTCRPCClient) GetBlockHeader(_ *chainhash.Hash) (*wire.BlockHeader, error)
- func (c *MockBTCRPCClient) GetBlockVerbose(_ *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
- func (c *MockBTCRPCClient) GetBlockVerboseTx(_ *chainhash.Hash) (*btcjson.GetBlockVerboseTxResult, error)
- func (c *MockBTCRPCClient) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)
- func (c *MockBTCRPCClient) GetNewAddress(_ string) (btcutil.Address, error)
- func (c *MockBTCRPCClient) GetRawTransaction(_ *chainhash.Hash) (*btcutil.Tx, error)
- func (c *MockBTCRPCClient) GetRawTransactionVerbose(_ *chainhash.Hash) (*btcjson.TxRawResult, error)
- func (c *MockBTCRPCClient) GetTransaction(_ *chainhash.Hash) (*btcjson.GetTransactionResult, error)
- func (c *MockBTCRPCClient) ListUnspent() ([]btcjson.ListUnspentResult, error)
- func (c *MockBTCRPCClient) ListUnspentMinMaxAddresses(_ int, _ int, _ []btcutil.Address) ([]btcjson.ListUnspentResult, error)
- func (c *MockBTCRPCClient) Reset() *MockBTCRPCClient
- func (c *MockBTCRPCClient) SendRawTransaction(_ *wire.MsgTx, _ bool) (*chainhash.Hash, error)
- func (c *MockBTCRPCClient) WithBlockCount(blkCnt int64) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithBlockHash(hash *chainhash.Hash) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithBlockHeader(header *wire.BlockHeader) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithBlockVerboseTx(block *btcjson.GetBlockVerboseTxResult) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithError(err error) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithRawTransaction(tx *btcutil.Tx) *MockBTCRPCClient
- func (c *MockBTCRPCClient) WithRawTransactions(txs []*btcutil.Tx) *MockBTCRPCClient
- type MockEvmClient
- func (e *MockEvmClient) BlockByNumber(_ context.Context, _ *big.Int) (*ethtypes.Block, error)
- func (e *MockEvmClient) BlockNumber(_ context.Context) (uint64, error)
- func (e *MockEvmClient) CallContract(_ context.Context, _ ethereum.CallMsg, _ *big.Int) ([]byte, error)
- func (e *MockEvmClient) CodeAt(_ context.Context, _ ethcommon.Address, _ *big.Int) ([]byte, error)
- func (e *MockEvmClient) EstimateGas(_ context.Context, _ ethereum.CallMsg) (gas uint64, err error)
- func (e *MockEvmClient) FilterLogs(_ context.Context, _ ethereum.FilterQuery) ([]ethtypes.Log, error)
- func (e *MockEvmClient) HeaderByNumber(_ context.Context, _ *big.Int) (*ethtypes.Header, error)
- func (e *MockEvmClient) PendingCodeAt(_ context.Context, _ ethcommon.Address) ([]byte, error)
- func (e *MockEvmClient) PendingNonceAt(_ context.Context, _ ethcommon.Address) (uint64, error)
- func (e *MockEvmClient) Reset() *MockEvmClient
- func (e *MockEvmClient) SendTransaction(_ context.Context, _ *ethtypes.Transaction) error
- func (e *MockEvmClient) SubscribeFilterLogs(_ context.Context, _ ethereum.FilterQuery, _ chan<- ethtypes.Log) (ethereum.Subscription, error)
- func (e *MockEvmClient) SuggestGasPrice(_ context.Context) (*big.Int, error)
- func (e *MockEvmClient) SuggestGasTipCap(_ context.Context) (*big.Int, error)
- func (e *MockEvmClient) TransactionByHash(_ context.Context, _ ethcommon.Hash) (tx *ethtypes.Transaction, isPending bool, err error)
- func (e *MockEvmClient) TransactionReceipt(_ context.Context, _ ethcommon.Hash) (*ethtypes.Receipt, error)
- func (e *MockEvmClient) TransactionSender(_ context.Context, _ *ethtypes.Transaction, _ ethcommon.Hash, _ uint) (ethcommon.Address, error)
- func (e *MockEvmClient) WithBlockNumber(blockNumber uint64) *MockEvmClient
- func (e *MockEvmClient) WithError(err error) *MockEvmClient
- func (e *MockEvmClient) WithHeader(header *ethtypes.Header) *MockEvmClient
- func (e *MockEvmClient) WithReceipt(receipt *ethtypes.Receipt) *MockEvmClient
- func (e *MockEvmClient) WithReceipts(receipts []*ethtypes.Receipt) *MockEvmClient
- type MockJSONRPCClient
- func (e *MockJSONRPCClient) EthGetBlockByNumber(_ int, _ bool) (*ethrpc.Block, error)
- func (e *MockJSONRPCClient) EthGetTransactionByHash(_ string) (*ethrpc.Transaction, error)
- func (e *MockJSONRPCClient) Reset() *MockJSONRPCClient
- func (e *MockJSONRPCClient) WithBlock(block *ethrpc.Block) *MockJSONRPCClient
- func (e *MockJSONRPCClient) WithBlocks(blocks []*ethrpc.Block) *MockJSONRPCClient
- func (e *MockJSONRPCClient) WithTransaction(tx *ethrpc.Transaction) *MockJSONRPCClient
- func (e *MockJSONRPCClient) WithTransactions(txs []*ethrpc.Transaction) *MockJSONRPCClient
- type TSS
- func (s *TSS) BTCAddress() string
- func (s *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash
- func (s *TSS) EVMAddress() ethcommon.Address
- func (s *TSS) EVMAddressList() []ethcommon.Address
- func (s *TSS) Pause()
- func (s *TSS) PubKeyCompressedBytes() []byte
- func (s *TSS) Pubkey() []byte
- func (s *TSS) Sign(_ context.Context, data []byte, _ uint64, _ uint64, _ int64, _ string) ([65]byte, error)
- func (s *TSS) SignBatch(_ context.Context, _ [][]byte, _ uint64, _ uint64, _ int64) ([][65]byte, error)
- func (s *TSS) Unpause()
- func (s *TSS) WithPrivKey(privKey *ecdsa.PrivateKey) *TSS
- type ZetacoreClient
- func (_m *ZetacoreClient) AddOutboundTracker(ctx context.Context, chainID int64, nonce uint64, txHash string, ...) (string, error)
- func (_m *ZetacoreClient) Chain() chains.Chain
- func (_m *ZetacoreClient) GetAllOutboundTrackerByChain(ctx context.Context, chainID int64, order interfaces.Order) ([]types.OutboundTracker, error)
- func (_m *ZetacoreClient) GetBTCTSSAddress(ctx context.Context, chainID int64) (string, error)
- func (_m *ZetacoreClient) GetBlockHeaderChainState(ctx context.Context, chainID int64) (*lightclienttypes.ChainState, error)
- func (_m *ZetacoreClient) GetBlockHeight(ctx context.Context) (int64, error)
- func (_m *ZetacoreClient) GetCctxByNonce(ctx context.Context, chainID int64, nonce uint64) (*types.CrossChainTx, error)
- func (_m *ZetacoreClient) GetCrosschainFlags(ctx context.Context) (observertypes.CrosschainFlags, error)
- func (_m *ZetacoreClient) GetInboundTrackersForChain(ctx context.Context, chainID int64) ([]types.InboundTracker, error)
- func (_m *ZetacoreClient) GetKeyGen(ctx context.Context) (*observertypes.Keygen, error)
- func (_m *ZetacoreClient) GetKeys() keysinterfaces.ObserverKeys
- func (_m *ZetacoreClient) GetLogger() *zerolog.Logger
- func (_m *ZetacoreClient) GetObserverList(ctx context.Context) ([]string, error)
- func (_m *ZetacoreClient) GetOutboundTracker(ctx context.Context, chain chains.Chain, nonce uint64) (*types.OutboundTracker, error)
- func (_m *ZetacoreClient) GetPendingNoncesByChain(ctx context.Context, chainID int64) (observertypes.PendingNonces, error)
- func (_m *ZetacoreClient) GetRateLimiterFlags(ctx context.Context) (types.RateLimiterFlags, error)
- func (_m *ZetacoreClient) GetRateLimiterInput(ctx context.Context, window int64) (*types.QueryRateLimiterInputResponse, error)
- func (_m *ZetacoreClient) GetZetaHotKeyBalance(ctx context.Context) (math.Int, error)
- func (_m *ZetacoreClient) ListPendingCCTX(ctx context.Context, chainID int64) ([]*types.CrossChainTx, uint64, error)
- func (_m *ZetacoreClient) ListPendingCCTXWithinRateLimit(ctx context.Context) (*types.QueryListPendingCctxWithinRateLimitResponse, error)
- func (_m *ZetacoreClient) OnBeforeStop(callback func())
- func (_m *ZetacoreClient) PostVoteBlameData(ctx context.Context, _a1 *blame.Blame, chainID int64, index string) (string, error)
- func (_m *ZetacoreClient) PostVoteBlockHeader(ctx context.Context, chainID int64, txhash []byte, height int64, ...) (string, error)
- func (_m *ZetacoreClient) PostVoteGasPrice(ctx context.Context, chain chains.Chain, gasPrice uint64, supply string, ...) (string, error)
- func (_m *ZetacoreClient) PostVoteInbound(ctx context.Context, gasLimit uint64, retryGasLimit uint64, ...) (string, string, error)
- func (_m *ZetacoreClient) PostVoteOutbound(ctx context.Context, gasLimit uint64, retryGasLimit uint64, ...) (string, string, error)
- func (_m *ZetacoreClient) Stop()
- func (_m *ZetacoreClient) WithKeys(keys keyinterfaces.ObserverKeys) *ZetacoreClient
- func (_m *ZetacoreClient) WithPendingCctx(chainID int64, cctxs []*crosschaintypes.CrossChainTx) *ZetacoreClient
- func (_m *ZetacoreClient) WithPostVoteInbound(zetaTxHash string, ballotIndex string) *ZetacoreClient
- func (_m *ZetacoreClient) WithPostVoteOutbound(zetaTxHash string, ballotIndex string) *ZetacoreClient
- func (_m *ZetacoreClient) WithRateLimiterFlags(flags *crosschaintypes.RateLimiterFlags) *ZetacoreClient
- func (_m *ZetacoreClient) WithRateLimiterInput(in *crosschaintypes.QueryRateLimiterInputResponse) *ZetacoreClient
- func (_m *ZetacoreClient) WithZetaChain() *ZetacoreClient
Constants ¶
const EVMRPCEnabled = "MockEVMRPCEnabled"
Variables ¶
var TestKeyringPair cryptotypes.PrivKey
var TestPrivateKey *ecdsa.PrivateKey
TestPrivateKey is a random private key for testing
Functions ¶
func MockChainParams ¶
func MockChainParams(chainID int64, confirmation uint64) observertypes.ChainParams
func MockConnectorNonEth ¶
func MockERC20Custody ¶
func NewKeyring ¶
Types ¶
type BTCObserver ¶
type BTCObserver struct {
ChainParams observertypes.ChainParams
}
BTCObserver is a mock of btc chain observer for testing
func NewBTCObserver ¶
func NewBTCObserver(chainParams *observertypes.ChainParams) *BTCObserver
func (*BTCObserver) GetChainParams ¶
func (ob *BTCObserver) GetChainParams() observertypes.ChainParams
func (*BTCObserver) GetTxID ¶
func (ob *BTCObserver) GetTxID(_ uint64) string
func (*BTCObserver) IsOutboundProcessed ¶
func (ob *BTCObserver) IsOutboundProcessed( _ context.Context, _ *crosschaintypes.CrossChainTx, _ zerolog.Logger, ) (bool, bool, error)
func (*BTCObserver) SetChainParams ¶
func (ob *BTCObserver) SetChainParams(chainParams observertypes.ChainParams)
func (*BTCObserver) Start ¶
func (ob *BTCObserver) Start(_ context.Context)
func (*BTCObserver) Stop ¶
func (ob *BTCObserver) Stop()
func (*BTCObserver) WatchInboundTracker ¶
func (ob *BTCObserver) WatchInboundTracker(_ context.Context) error
type BTCSigner ¶
type BTCSigner struct { }
BTCSigner is a mock of bitcoin chain signer for testing
func NewBTCSigner ¶
func NewBTCSigner() *BTCSigner
func (*BTCSigner) GetERC20CustodyAddress ¶
func (*BTCSigner) GetZetaConnectorAddress ¶
func (*BTCSigner) SetERC20CustodyAddress ¶
func (*BTCSigner) SetZetaConnectorAddress ¶
func (*BTCSigner) TryProcessOutbound ¶
func (s *BTCSigner) TryProcessOutbound( _ context.Context, _ *crosschaintypes.CrossChainTx, _ *outboundprocessor.Processor, _ string, _ interfaces.ChainObserver, _ interfaces.ZetacoreClient, _ uint64, )
type CometBFTClient ¶
func NewSDKClientWithErr ¶
func NewSDKClientWithErr(t *testing.T, err error, code uint32) *CometBFTClient
func (*CometBFTClient) Block ¶
func (c *CometBFTClient) Block(_ context.Context, _ *int64) (*coretypes.ResultBlock, error)
func (*CometBFTClient) BroadcastTxAsync ¶
func (c *CometBFTClient) BroadcastTxAsync(_ context.Context, _ tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
func (*CometBFTClient) BroadcastTxCommit ¶
func (c *CometBFTClient) BroadcastTxCommit( _ context.Context, _ tmtypes.Tx, ) (*coretypes.ResultBroadcastTxCommit, error)
func (*CometBFTClient) BroadcastTxSync ¶
func (c *CometBFTClient) BroadcastTxSync(_ context.Context, _ tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
func (*CometBFTClient) SetBroadcastTxHash ¶
func (c *CometBFTClient) SetBroadcastTxHash(hash string) *CometBFTClient
func (*CometBFTClient) SetError ¶
func (c *CometBFTClient) SetError(err error) *CometBFTClient
type EVMObserver ¶
type EVMObserver struct {
ChainParams observertypes.ChainParams
}
EVMObserver is a mock of evm chain observer for testing
func NewEVMObserver ¶
func NewEVMObserver(chainParams *observertypes.ChainParams) *EVMObserver
func (*EVMObserver) GetChainParams ¶
func (ob *EVMObserver) GetChainParams() observertypes.ChainParams
func (*EVMObserver) GetTxID ¶
func (ob *EVMObserver) GetTxID(_ uint64) string
func (*EVMObserver) IsOutboundProcessed ¶
func (ob *EVMObserver) IsOutboundProcessed( _ context.Context, _ *crosschaintypes.CrossChainTx, _ zerolog.Logger, ) (bool, bool, error)
func (*EVMObserver) SetChainParams ¶
func (ob *EVMObserver) SetChainParams(chainParams observertypes.ChainParams)
func (*EVMObserver) Start ¶
func (ob *EVMObserver) Start(_ context.Context)
func (*EVMObserver) Stop ¶
func (ob *EVMObserver) Stop()
func (*EVMObserver) WatchInboundTracker ¶
func (ob *EVMObserver) WatchInboundTracker(_ context.Context) error
type EVMSigner ¶
type EVMSigner struct { Chain chains.Chain ZetaConnectorAddress ethcommon.Address ERC20CustodyAddress ethcommon.Address }
EVMSigner is a mock of evm chain signer for testing
func NewEVMSigner ¶
func (*EVMSigner) GetERC20CustodyAddress ¶
func (*EVMSigner) GetZetaConnectorAddress ¶
func (*EVMSigner) SetERC20CustodyAddress ¶
func (*EVMSigner) SetZetaConnectorAddress ¶
func (*EVMSigner) TryProcessOutbound ¶
func (s *EVMSigner) TryProcessOutbound( _ context.Context, _ *crosschaintypes.CrossChainTx, _ *outboundprocessor.Processor, _ string, _ interfaces.ChainObserver, _ interfaces.ZetacoreClient, _ uint64, )
type Keyring ¶
type Keyring struct { }
func (Keyring) ExportPrivKeyArmor ¶
func (Keyring) ExportPrivKeyArmorByAddress ¶
func (Keyring) ExportPubKeyArmorByAddress ¶
func (Keyring) ImportPrivKey ¶
func (Keyring) ImportPrivKeyHex ¶
func (Keyring) NewAccount ¶
func (Keyring) NewMnemonic ¶
func (Keyring) SaveLedgerKey ¶
func (Keyring) SaveMultisig ¶
func (Keyring) SaveOfflineKey ¶
func (Keyring) SignByAddress ¶
func (Keyring) SupportedAlgorithms ¶
func (m Keyring) SupportedAlgorithms() (ckeys.SigningAlgoList, ckeys.SigningAlgoList)
type MockBTCRPCClient ¶
MockBTCRPCClient is a mock implementation of the BTCRPCClient interface
func NewMockBTCRPCClient ¶
func NewMockBTCRPCClient() *MockBTCRPCClient
NewMockBTCRPCClient creates a new mock BTC RPC client
func (*MockBTCRPCClient) CreateWallet ¶
func (c *MockBTCRPCClient) CreateWallet(_ string, _ ...rpcclient.CreateWalletOpt) (*btcjson.CreateWalletResult, error)
func (*MockBTCRPCClient) EstimateSmartFee ¶
func (c *MockBTCRPCClient) EstimateSmartFee( _ int64, _ *btcjson.EstimateSmartFeeMode, ) (*btcjson.EstimateSmartFeeResult, error)
func (*MockBTCRPCClient) GenerateToAddress ¶
func (*MockBTCRPCClient) GetBalance ¶
func (c *MockBTCRPCClient) GetBalance(_ string) (btcutil.Amount, error)
func (*MockBTCRPCClient) GetBlockCount ¶
func (c *MockBTCRPCClient) GetBlockCount() (int64, error)
func (*MockBTCRPCClient) GetBlockHash ¶
func (c *MockBTCRPCClient) GetBlockHash(_ int64) (*chainhash.Hash, error)
func (*MockBTCRPCClient) GetBlockHeader ¶
func (c *MockBTCRPCClient) GetBlockHeader(_ *chainhash.Hash) (*wire.BlockHeader, error)
func (*MockBTCRPCClient) GetBlockVerbose ¶
func (c *MockBTCRPCClient) GetBlockVerbose(_ *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
func (*MockBTCRPCClient) GetBlockVerboseTx ¶
func (c *MockBTCRPCClient) GetBlockVerboseTx(_ *chainhash.Hash) (*btcjson.GetBlockVerboseTxResult, error)
func (*MockBTCRPCClient) GetNetworkInfo ¶
func (c *MockBTCRPCClient) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)
func (*MockBTCRPCClient) GetNewAddress ¶
func (c *MockBTCRPCClient) GetNewAddress(_ string) (btcutil.Address, error)
func (*MockBTCRPCClient) GetRawTransaction ¶
GetRawTransaction returns a pre-loaded transaction or nil
func (*MockBTCRPCClient) GetRawTransactionVerbose ¶
func (c *MockBTCRPCClient) GetRawTransactionVerbose(_ *chainhash.Hash) (*btcjson.TxRawResult, error)
func (*MockBTCRPCClient) GetTransaction ¶
func (c *MockBTCRPCClient) GetTransaction(_ *chainhash.Hash) (*btcjson.GetTransactionResult, error)
func (*MockBTCRPCClient) ListUnspent ¶
func (c *MockBTCRPCClient) ListUnspent() ([]btcjson.ListUnspentResult, error)
func (*MockBTCRPCClient) ListUnspentMinMaxAddresses ¶
func (c *MockBTCRPCClient) ListUnspentMinMaxAddresses( _ int, _ int, _ []btcutil.Address, ) ([]btcjson.ListUnspentResult, error)
func (*MockBTCRPCClient) Reset ¶
func (c *MockBTCRPCClient) Reset() *MockBTCRPCClient
Reset clears the mock data
func (*MockBTCRPCClient) SendRawTransaction ¶
func (*MockBTCRPCClient) WithBlockCount ¶
func (c *MockBTCRPCClient) WithBlockCount(blkCnt int64) *MockBTCRPCClient
func (*MockBTCRPCClient) WithBlockHash ¶
func (c *MockBTCRPCClient) WithBlockHash(hash *chainhash.Hash) *MockBTCRPCClient
func (*MockBTCRPCClient) WithBlockHeader ¶
func (c *MockBTCRPCClient) WithBlockHeader(header *wire.BlockHeader) *MockBTCRPCClient
func (*MockBTCRPCClient) WithBlockVerboseTx ¶
func (c *MockBTCRPCClient) WithBlockVerboseTx(block *btcjson.GetBlockVerboseTxResult) *MockBTCRPCClient
func (*MockBTCRPCClient) WithError ¶
func (c *MockBTCRPCClient) WithError(err error) *MockBTCRPCClient
func (*MockBTCRPCClient) WithRawTransaction ¶
func (c *MockBTCRPCClient) WithRawTransaction(tx *btcutil.Tx) *MockBTCRPCClient
func (*MockBTCRPCClient) WithRawTransactions ¶
func (c *MockBTCRPCClient) WithRawTransactions(txs []*btcutil.Tx) *MockBTCRPCClient
type MockEvmClient ¶
type MockEvmClient struct { Receipts []*ethtypes.Receipt // contains filtered or unexported fields }
func NewMockEvmClient ¶
func NewMockEvmClient() *MockEvmClient
func (*MockEvmClient) BlockByNumber ¶
func (*MockEvmClient) BlockNumber ¶
func (e *MockEvmClient) BlockNumber(_ context.Context) (uint64, error)
func (*MockEvmClient) CallContract ¶
func (*MockEvmClient) EstimateGas ¶
func (e *MockEvmClient) EstimateGas(_ context.Context, _ ethereum.CallMsg) (gas uint64, err error)
func (*MockEvmClient) FilterLogs ¶
func (*MockEvmClient) HeaderByNumber ¶
func (*MockEvmClient) PendingCodeAt ¶
func (*MockEvmClient) PendingNonceAt ¶
func (*MockEvmClient) Reset ¶
func (e *MockEvmClient) Reset() *MockEvmClient
func (*MockEvmClient) SendTransaction ¶
func (e *MockEvmClient) SendTransaction(_ context.Context, _ *ethtypes.Transaction) error
func (*MockEvmClient) SubscribeFilterLogs ¶
func (*MockEvmClient) SuggestGasPrice ¶
func (*MockEvmClient) SuggestGasTipCap ¶
func (*MockEvmClient) TransactionByHash ¶
func (e *MockEvmClient) TransactionByHash( _ context.Context, _ ethcommon.Hash, ) (tx *ethtypes.Transaction, isPending bool, err error)
func (*MockEvmClient) TransactionReceipt ¶
func (*MockEvmClient) TransactionSender ¶
func (*MockEvmClient) WithBlockNumber ¶
func (e *MockEvmClient) WithBlockNumber(blockNumber uint64) *MockEvmClient
func (*MockEvmClient) WithError ¶
func (e *MockEvmClient) WithError(err error) *MockEvmClient
---------------------------------------------------------------------------- Feed data to the mock evm client for testing ----------------------------------------------------------------------------
func (*MockEvmClient) WithHeader ¶
func (e *MockEvmClient) WithHeader(header *ethtypes.Header) *MockEvmClient
func (*MockEvmClient) WithReceipt ¶
func (e *MockEvmClient) WithReceipt(receipt *ethtypes.Receipt) *MockEvmClient
func (*MockEvmClient) WithReceipts ¶
func (e *MockEvmClient) WithReceipts(receipts []*ethtypes.Receipt) *MockEvmClient
type MockJSONRPCClient ¶
type MockJSONRPCClient struct { Blocks []*ethrpc.Block Transactions []*ethrpc.Transaction }
MockJSONRPCClient is a mock implementation of the EVMJSONRPCClient interface
func NewMockJSONRPCClient ¶
func NewMockJSONRPCClient() *MockJSONRPCClient
NewMockJSONRPCClient creates a new mock JSON RPC client
func (*MockJSONRPCClient) EthGetBlockByNumber ¶
EthGetBlockByNumber returns a pre-loaded block or nil
func (*MockJSONRPCClient) EthGetTransactionByHash ¶
func (e *MockJSONRPCClient) EthGetTransactionByHash(_ string) (*ethrpc.Transaction, error)
EthGetTransactionByHash returns a pre-loaded transaction or nil
func (*MockJSONRPCClient) Reset ¶
func (e *MockJSONRPCClient) Reset() *MockJSONRPCClient
Reset clears the mock data
func (*MockJSONRPCClient) WithBlock ¶
func (e *MockJSONRPCClient) WithBlock(block *ethrpc.Block) *MockJSONRPCClient
---------------------------------------------------------------------------- Feed data to the mock JSON RPC client for testing ----------------------------------------------------------------------------
func (*MockJSONRPCClient) WithBlocks ¶
func (e *MockJSONRPCClient) WithBlocks(blocks []*ethrpc.Block) *MockJSONRPCClient
func (*MockJSONRPCClient) WithTransaction ¶
func (e *MockJSONRPCClient) WithTransaction(tx *ethrpc.Transaction) *MockJSONRPCClient
func (*MockJSONRPCClient) WithTransactions ¶
func (e *MockJSONRPCClient) WithTransactions(txs []*ethrpc.Transaction) *MockJSONRPCClient
type TSS ¶
type TSS struct { // set PrivKey if you want to use a specific private key PrivKey *ecdsa.PrivateKey // contains filtered or unexported fields }
TSS is a mock of TSS signer for testing
func NewTSSAthens3 ¶
func NewTSSAthens3() *TSS
func NewTSSMainnet ¶
func NewTSSMainnet() *TSS
func (*TSS) BTCAddress ¶
func (*TSS) BTCAddressWitnessPubkeyHash ¶
func (s *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash
func (*TSS) EVMAddress ¶
func (*TSS) EVMAddressList ¶
func (*TSS) Pause ¶
func (s *TSS) Pause()
---------------------------------------------------------------------------- methods to control the mock for testing ----------------------------------------------------------------------------
func (*TSS) PubKeyCompressedBytes ¶
PubKeyCompressedBytes returns 33B compressed pubkey
func (*TSS) Sign ¶
func (s *TSS) Sign(_ context.Context, data []byte, _ uint64, _ uint64, _ int64, _ string) ([65]byte, error)
Sign uses test key unrelated to any tss key in production
func (*TSS) SignBatch ¶
func (s *TSS) SignBatch(_ context.Context, _ [][]byte, _ uint64, _ uint64, _ int64) ([][65]byte, error)
SignBatch uses test key unrelated to any tss key in production
func (*TSS) WithPrivKey ¶
func (s *TSS) WithPrivKey(privKey *ecdsa.PrivateKey) *TSS
WithPrivKey sets the private key for the TSS
type ZetacoreClient ¶
ZetacoreClient is an autogenerated mock type for the ZetacoreClient type
func NewZetacoreClient ¶
func NewZetacoreClient(t interface { mock.TestingT Cleanup(func()) }) *ZetacoreClient
NewZetacoreClient creates a new instance of ZetacoreClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ZetacoreClient) AddOutboundTracker ¶
func (_m *ZetacoreClient) AddOutboundTracker(ctx context.Context, chainID int64, nonce uint64, txHash string, proof *proofs.Proof, blockHash string, txIndex int64) (string, error)
AddOutboundTracker provides a mock function with given fields: ctx, chainID, nonce, txHash, proof, blockHash, txIndex
func (*ZetacoreClient) Chain ¶
func (_m *ZetacoreClient) Chain() chains.Chain
Chain provides a mock function with given fields:
func (*ZetacoreClient) GetAllOutboundTrackerByChain ¶
func (_m *ZetacoreClient) GetAllOutboundTrackerByChain(ctx context.Context, chainID int64, order interfaces.Order) ([]types.OutboundTracker, error)
GetAllOutboundTrackerByChain provides a mock function with given fields: ctx, chainID, order
func (*ZetacoreClient) GetBTCTSSAddress ¶
GetBTCTSSAddress provides a mock function with given fields: ctx, chainID
func (*ZetacoreClient) GetBlockHeaderChainState ¶
func (_m *ZetacoreClient) GetBlockHeaderChainState(ctx context.Context, chainID int64) (*lightclienttypes.ChainState, error)
GetBlockHeaderChainState provides a mock function with given fields: ctx, chainID
func (*ZetacoreClient) GetBlockHeight ¶
func (_m *ZetacoreClient) GetBlockHeight(ctx context.Context) (int64, error)
GetBlockHeight provides a mock function with given fields: ctx
func (*ZetacoreClient) GetCctxByNonce ¶
func (_m *ZetacoreClient) GetCctxByNonce(ctx context.Context, chainID int64, nonce uint64) (*types.CrossChainTx, error)
GetCctxByNonce provides a mock function with given fields: ctx, chainID, nonce
func (*ZetacoreClient) GetCrosschainFlags ¶
func (_m *ZetacoreClient) GetCrosschainFlags(ctx context.Context) (observertypes.CrosschainFlags, error)
GetCrosschainFlags provides a mock function with given fields: ctx
func (*ZetacoreClient) GetInboundTrackersForChain ¶
func (_m *ZetacoreClient) GetInboundTrackersForChain(ctx context.Context, chainID int64) ([]types.InboundTracker, error)
GetInboundTrackersForChain provides a mock function with given fields: ctx, chainID
func (*ZetacoreClient) GetKeyGen ¶
func (_m *ZetacoreClient) GetKeyGen(ctx context.Context) (*observertypes.Keygen, error)
GetKeyGen provides a mock function with given fields: ctx
func (*ZetacoreClient) GetKeys ¶
func (_m *ZetacoreClient) GetKeys() keysinterfaces.ObserverKeys
GetKeys provides a mock function with given fields:
func (*ZetacoreClient) GetLogger ¶
func (_m *ZetacoreClient) GetLogger() *zerolog.Logger
GetLogger provides a mock function with given fields:
func (*ZetacoreClient) GetObserverList ¶
func (_m *ZetacoreClient) GetObserverList(ctx context.Context) ([]string, error)
GetObserverList provides a mock function with given fields: ctx
func (*ZetacoreClient) GetOutboundTracker ¶
func (_m *ZetacoreClient) GetOutboundTracker(ctx context.Context, chain chains.Chain, nonce uint64) (*types.OutboundTracker, error)
GetOutboundTracker provides a mock function with given fields: ctx, chain, nonce
func (*ZetacoreClient) GetPendingNoncesByChain ¶
func (_m *ZetacoreClient) GetPendingNoncesByChain(ctx context.Context, chainID int64) (observertypes.PendingNonces, error)
GetPendingNoncesByChain provides a mock function with given fields: ctx, chainID
func (*ZetacoreClient) GetRateLimiterFlags ¶
func (_m *ZetacoreClient) GetRateLimiterFlags(ctx context.Context) (types.RateLimiterFlags, error)
GetRateLimiterFlags provides a mock function with given fields: ctx
func (*ZetacoreClient) GetRateLimiterInput ¶
func (_m *ZetacoreClient) GetRateLimiterInput(ctx context.Context, window int64) (*types.QueryRateLimiterInputResponse, error)
GetRateLimiterInput provides a mock function with given fields: ctx, window
func (*ZetacoreClient) GetZetaHotKeyBalance ¶
GetZetaHotKeyBalance provides a mock function with given fields: ctx
func (*ZetacoreClient) ListPendingCCTX ¶
func (_m *ZetacoreClient) ListPendingCCTX(ctx context.Context, chainID int64) ([]*types.CrossChainTx, uint64, error)
ListPendingCCTX provides a mock function with given fields: ctx, chainID
func (*ZetacoreClient) ListPendingCCTXWithinRateLimit ¶
func (_m *ZetacoreClient) ListPendingCCTXWithinRateLimit(ctx context.Context) (*types.QueryListPendingCctxWithinRateLimitResponse, error)
ListPendingCCTXWithinRateLimit provides a mock function with given fields: ctx
func (*ZetacoreClient) OnBeforeStop ¶
func (_m *ZetacoreClient) OnBeforeStop(callback func())
OnBeforeStop provides a mock function with given fields: callback
func (*ZetacoreClient) PostVoteBlameData ¶
func (_m *ZetacoreClient) PostVoteBlameData(ctx context.Context, _a1 *blame.Blame, chainID int64, index string) (string, error)
PostVoteBlameData provides a mock function with given fields: ctx, _a1, chainID, index
func (*ZetacoreClient) PostVoteBlockHeader ¶
func (_m *ZetacoreClient) PostVoteBlockHeader(ctx context.Context, chainID int64, txhash []byte, height int64, header proofs.HeaderData) (string, error)
PostVoteBlockHeader provides a mock function with given fields: ctx, chainID, txhash, height, header
func (*ZetacoreClient) PostVoteGasPrice ¶
func (_m *ZetacoreClient) PostVoteGasPrice(ctx context.Context, chain chains.Chain, gasPrice uint64, supply string, blockNum uint64) (string, error)
PostVoteGasPrice provides a mock function with given fields: ctx, chain, gasPrice, supply, blockNum
func (*ZetacoreClient) PostVoteInbound ¶
func (_m *ZetacoreClient) PostVoteInbound(ctx context.Context, gasLimit uint64, retryGasLimit uint64, msg *types.MsgVoteInbound) (string, string, error)
PostVoteInbound provides a mock function with given fields: ctx, gasLimit, retryGasLimit, msg
func (*ZetacoreClient) PostVoteOutbound ¶
func (_m *ZetacoreClient) PostVoteOutbound(ctx context.Context, gasLimit uint64, retryGasLimit uint64, msg *types.MsgVoteOutbound) (string, string, error)
PostVoteOutbound provides a mock function with given fields: ctx, gasLimit, retryGasLimit, msg
func (*ZetacoreClient) Stop ¶
func (_m *ZetacoreClient) Stop()
Stop provides a mock function with given fields:
func (*ZetacoreClient) WithKeys ¶
func (_m *ZetacoreClient) WithKeys(keys keyinterfaces.ObserverKeys) *ZetacoreClient
func (*ZetacoreClient) WithPendingCctx ¶
func (_m *ZetacoreClient) WithPendingCctx(chainID int64, cctxs []*crosschaintypes.CrossChainTx) *ZetacoreClient
func (*ZetacoreClient) WithPostVoteInbound ¶
func (_m *ZetacoreClient) WithPostVoteInbound(zetaTxHash string, ballotIndex string) *ZetacoreClient
func (*ZetacoreClient) WithPostVoteOutbound ¶
func (_m *ZetacoreClient) WithPostVoteOutbound(zetaTxHash string, ballotIndex string) *ZetacoreClient
func (*ZetacoreClient) WithRateLimiterFlags ¶
func (_m *ZetacoreClient) WithRateLimiterFlags(flags *crosschaintypes.RateLimiterFlags) *ZetacoreClient
func (*ZetacoreClient) WithRateLimiterInput ¶
func (_m *ZetacoreClient) WithRateLimiterInput(in *crosschaintypes.QueryRateLimiterInputResponse) *ZetacoreClient
func (*ZetacoreClient) WithZetaChain ¶
func (_m *ZetacoreClient) WithZetaChain() *ZetacoreClient