Documentation ¶
Index ¶
- type Block
- type BlockChain
- type IReceiptLog
- type MockBlockchain
- func (m *MockBlockchain) GetBlockByNumber(blockNumber uint64) (Block, error)
- func (m *MockBlockchain) GetBlockNumber() (uint64, error)
- func (m *MockBlockchain) GetHotFeeDiscount(address string) decimal.Decimal
- func (m *MockBlockchain) GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
- func (m *MockBlockchain) GetTokenBalance(tokenAddress string, address string) decimal.Decimal
- func (m *MockBlockchain) GetTransaction(ID string) (Transaction, error)
- func (m *MockBlockchain) GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error)
- func (m *MockBlockchain) GetTransactionReceipt(ID string) (TransactionReceipt, error)
- func (m *MockBlockchain) IsValidSignature(address string, message string, signature string) (bool, error)
- func (m *MockBlockchain) SendRawTransaction(tx interface{}) (string, error)
- func (m *MockBlockchain) SendTransaction(to string, amount *big.Int, data []byte, privateKey *ecdsa.PrivateKey) (transactionHash string, err error)
- type MockNova
- type MockNovaProtocol
- type Nova
- type NovaProtocol
- type Order
- type OrderAddressSet
- type OrderParam
- type OrderSignature
- type Transaction
- type TransactionReceipt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block interface { Number() uint64 Timestamp() uint64 GetTransactions() []Transaction Hash() string ParentHash() string }
type BlockChain ¶
type BlockChain interface { GetTokenBalance(tokenAddress, address string) decimal.Decimal GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal GetHotFeeDiscount(address string) decimal.Decimal GetBlockNumber() (uint64, error) GetBlockByNumber(blockNumber uint64) (Block, error) GetTransaction(ID string) (Transaction, error) GetTransactionReceipt(ID string) (TransactionReceipt, error) GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error) IsValidSignature(address string, message string, signature string) (bool, error) SendTransaction(to string, amount *big.Int, data []byte, privateKey *ecdsa.PrivateKey) (transactionHash string, err error) SendRawTransaction(tx interface{}) (string, error) // from orderbook protocol GetOrderbook(pairName, orderID string) []byte ProcessOrderbook(payload map[string]string) []byte CancelOrderbook(payload map[string]string) bool BestAskList(pairName string) []byte BestBidList(pairName string) []byte }
type IReceiptLog ¶
type MockBlockchain ¶
type MockBlockchain struct { BlockChain mock.Mock }
func (*MockBlockchain) GetBlockByNumber ¶
func (m *MockBlockchain) GetBlockByNumber(blockNumber uint64) (Block, error)
func (*MockBlockchain) GetBlockNumber ¶
func (m *MockBlockchain) GetBlockNumber() (uint64, error)
func (*MockBlockchain) GetHotFeeDiscount ¶
func (m *MockBlockchain) GetHotFeeDiscount(address string) decimal.Decimal
func (*MockBlockchain) GetTokenAllowance ¶
func (m *MockBlockchain) GetTokenAllowance(tokenAddress, proxyAddress, address string) decimal.Decimal
func (*MockBlockchain) GetTokenBalance ¶
func (m *MockBlockchain) GetTokenBalance(tokenAddress string, address string) decimal.Decimal
func (*MockBlockchain) GetTransaction ¶
func (m *MockBlockchain) GetTransaction(ID string) (Transaction, error)
func (*MockBlockchain) GetTransactionAndReceipt ¶
func (m *MockBlockchain) GetTransactionAndReceipt(ID string) (Transaction, TransactionReceipt, error)
func (*MockBlockchain) GetTransactionReceipt ¶
func (m *MockBlockchain) GetTransactionReceipt(ID string) (TransactionReceipt, error)
func (*MockBlockchain) IsValidSignature ¶
func (*MockBlockchain) SendRawTransaction ¶
func (m *MockBlockchain) SendRawTransaction(tx interface{}) (string, error)
func (*MockBlockchain) SendTransaction ¶
func (m *MockBlockchain) SendTransaction(to string, amount *big.Int, data []byte, privateKey *ecdsa.PrivateKey) (transactionHash string, err error)
type MockNova ¶
type MockNova struct { NovaProtocol BlockChain }
func NewMockNova ¶
func NewMockNova() *MockNova
type MockNovaProtocol ¶
type MockNovaProtocol struct { NovaProtocol mock.Mock }
func (*MockNovaProtocol) GenerateOrderData ¶
func (*MockNovaProtocol) GetMatchOrderCallData ¶
func (*MockNovaProtocol) GetOrderHash ¶
func (m *MockNovaProtocol) GetOrderHash(order *Order) []byte
type Nova ¶
type Nova interface { NovaProtocol BlockChain }
type NovaProtocol ¶
type NovaProtocol interface { GenerateOrderData(version, expiredAtSeconds, salt int64, asMakerFeeRate, asTakerFeeRate, makerRebateRate decimal.Decimal, isSell, isMarket, isMakerOnly bool) string GetOrderHash(*Order) []byte GetMatchOrderCallData(*Order, []*Order, []*big.Int) []byte IsValidOrderSignature(address string, orderID string, signature string) bool }
type Order ¶
type OrderAddressSet ¶
type OrderParam ¶
type OrderSignature ¶
type Transaction ¶
type TransactionReceipt ¶
Click to show internal directories.
Click to hide internal directories.