fakes

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcaster

type Broadcaster struct {
	// contains filtered or unexported fields
}

func (*Broadcaster) BroadcastTransaction

func (m *Broadcaster) BroadcastTransaction(
	_ context.Context,
	chain money.Blockchain,
	raw string,
	isTest bool,
) (string, error)

func (*Broadcaster) GetTransactionReceipt

func (m *Broadcaster) GetTransactionReceipt(
	_ context.Context, chain money.Blockchain, txID string, isTest bool,
) (*blockchain.TransactionReceipt, error)

func (*Broadcaster) SetupBroadcastTransaction

func (m *Broadcaster) SetupBroadcastTransaction(
	chain money.Blockchain,
	rawTransaction string,
	isTest bool,
	txHash string,
	err error,
)

func (*Broadcaster) SetupGetTransactionReceipt

func (m *Broadcaster) SetupGetTransactionReceipt(
	chain money.Blockchain,
	txID string,
	isTest bool,
	receipt *blockchain.TransactionReceipt,
	err error,
)

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

func (*Bus) Clear

func (b *Bus) Clear()

func (*Bus) GetBusCalls

func (b *Bus) GetBusCalls() []lo.Tuple2[bus.Topic, any]

func (*Bus) Publish

func (b *Bus) Publish(topic bus.Topic, message any) error

type ConvertorProxy

type ConvertorProxy struct {
	// contains filtered or unexported fields
}

ConvertorProxy represents proxy for real implementation of blockchain.Convertor that uses fake tatum http server that can we mocked as well.

func (*ConvertorProxy) Convert

func (c *ConvertorProxy) Convert(ctx context.Context, from, to, amount string) (blockchain.Conversion, error)

func (*ConvertorProxy) CryptoToFiat

func (*ConvertorProxy) FiatToCrypto

func (*ConvertorProxy) FiatToFiat

func (*ConvertorProxy) GetExchangeRate

func (c *ConvertorProxy) GetExchangeRate(ctx context.Context, from, to string) (blockchain.ExchangeRate, error)

type Fakes

Fakes global faker struct. Supported mocks: - Most of blockchain.Service - bus.PubSub

func New

func New(t *testing.T, blockchainService *blockchain.Service) *Fakes

New Fakes constructor

type FeeCalculator

type FeeCalculator struct {
	// contains filtered or unexported fields
}

func (*FeeCalculator) CalculateFee

func (m *FeeCalculator) CalculateFee(
	_ context.Context,
	baseCurrency, currency money.CryptoCurrency,
	isTest bool,
) (blockchain.Fee, error)

func (*FeeCalculator) CalculateWithdrawalFeeUSD

func (m *FeeCalculator) CalculateWithdrawalFeeUSD(
	_ context.Context,
	baseCurrency, currency money.CryptoCurrency,
	isTest bool,
) (money.Money, error)

func (*FeeCalculator) SetupAllFees

func (m *FeeCalculator) SetupAllFees(t *testing.T, service *blockchain.Service)

func (*FeeCalculator) SetupCalculateFee

func (m *FeeCalculator) SetupCalculateFee(
	baseCurrency, currency money.CryptoCurrency,
	isTest bool,
	fee blockchain.Fee,
)

func (*FeeCalculator) SetupCalculateWithdrawalFeeUSD

func (m *FeeCalculator) SetupCalculateWithdrawalFeeUSD(
	baseCurrency, currency money.CryptoCurrency,
	isTest bool,
	fee money.Money,
)

type Trongrid

type Trongrid struct {
	// contains filtered or unexported fields
}

func NewTrongrid

func NewTrongrid(logger *zerolog.Logger) (*trongrid.Provider, *Trongrid)

func (*Trongrid) SetupCreateTransaction

func (m *Trongrid) SetupCreateTransaction(req trongrid.TransactionRequest, res trongrid.Transaction)

func (*Trongrid) SetupTriggerSmartContract

func (m *Trongrid) SetupTriggerSmartContract(req trongrid.ContractCallRequest, res trongrid.Transaction)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL