Documentation ¶
Index ¶
- type Broadcaster
- func (m *Broadcaster) BroadcastTransaction(_ context.Context, chain money.Blockchain, raw string, isTest bool) (string, error)
- func (m *Broadcaster) GetTransactionReceipt(_ context.Context, chain money.Blockchain, txID string, isTest bool) (*blockchain.TransactionReceipt, error)
- func (m *Broadcaster) SetupBroadcastTransaction(chain money.Blockchain, rawTransaction string, isTest bool, txHash string, ...)
- func (m *Broadcaster) SetupGetTransactionReceipt(chain money.Blockchain, txID string, isTest bool, ...)
- type Bus
- type ConvertorProxy
- func (c *ConvertorProxy) Convert(ctx context.Context, from, to, amount string) (blockchain.Conversion, error)
- func (c *ConvertorProxy) CryptoToFiat(ctx context.Context, from money.Money, to money.FiatCurrency) (blockchain.Conversion, error)
- func (c *ConvertorProxy) FiatToCrypto(ctx context.Context, from money.Money, to money.CryptoCurrency) (blockchain.Conversion, error)
- func (c *ConvertorProxy) FiatToFiat(ctx context.Context, from money.Money, to money.FiatCurrency) (blockchain.Conversion, error)
- func (c *ConvertorProxy) GetExchangeRate(ctx context.Context, from, to string) (blockchain.ExchangeRate, error)
- type Fakes
- type FeeCalculator
- func (m *FeeCalculator) CalculateFee(_ context.Context, baseCurrency, currency money.CryptoCurrency, isTest bool) (blockchain.Fee, error)
- func (m *FeeCalculator) CalculateWithdrawalFeeUSD(_ context.Context, baseCurrency, currency money.CryptoCurrency, isTest bool) (money.Money, error)
- func (m *FeeCalculator) SetupAllFees(t *testing.T, service *blockchain.Service)
- func (m *FeeCalculator) SetupCalculateFee(baseCurrency, currency money.CryptoCurrency, isTest bool, fee blockchain.Fee)
- func (m *FeeCalculator) SetupCalculateWithdrawalFeeUSD(baseCurrency, currency money.CryptoCurrency, isTest bool, fee money.Money)
- type Trongrid
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 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 (c *ConvertorProxy) CryptoToFiat(ctx context.Context, from money.Money, to money.FiatCurrency) (blockchain.Conversion, error)
func (*ConvertorProxy) FiatToCrypto ¶
func (c *ConvertorProxy) FiatToCrypto(ctx context.Context, from money.Money, to money.CryptoCurrency) (blockchain.Conversion, error)
func (*ConvertorProxy) FiatToFiat ¶
func (c *ConvertorProxy) FiatToFiat(ctx context.Context, from money.Money, to money.FiatCurrency) (blockchain.Conversion, error)
func (*ConvertorProxy) GetExchangeRate ¶
func (c *ConvertorProxy) GetExchangeRate(ctx context.Context, from, to string) (blockchain.ExchangeRate, error)
type Fakes ¶
type Fakes struct { *Broadcaster *FeeCalculator *ConvertorProxy *blockchain.CurrencyResolver *Bus }
Fakes global faker struct. Supported mocks: - Most of blockchain.Service - bus.PubSub
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 (*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)
Click to show internal directories.
Click to hide internal directories.