Documentation ¶
Index ¶
- Constants
- Variables
- type Chainnode
- type ExtAccountTransaction
- type ExtUtxoTransaction
- type MockChainnode
- func (m *MockChainnode) BroadcastTransaction(chain, symbol string, signedTxData []byte) (string, error)
- func (m *MockChainnode) ConvertAddress(chain string, publicKey []byte) (string, error)
- func (m *MockChainnode) ConvertAddressFromSerializedPubKey(chain string, publicKey []byte) (string, error)
- func (m *MockChainnode) CreateAccountSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys []byte) ([]byte, []byte, error)
- func (m *MockChainnode) CreateAccountTransaction(chain, symbol, contractAddress string, transaction *ExtAccountTransaction) ([]byte, []byte, error)
- func (m *MockChainnode) CreateUtxoSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys [][]byte) ([]byte, []byte, error)
- func (m *MockChainnode) CreateUtxoTransaction(chain, symbol string, transaction *ExtUtxoTransaction) ([]byte, [][]byte, error)
- func (m *MockChainnode) QueryAccountTransaction(chain, symbol, hash string, asynMode bool) (*ExtAccountTransaction, error)
- func (m *MockChainnode) QueryAccountTransactionFromData(chain, symbol string, rawData []byte) (*ExtAccountTransaction, []byte, error)
- func (m *MockChainnode) QueryAccountTransactionFromSignedData(chain, symbol string, signedTxData []byte) (*ExtAccountTransaction, error)
- func (m *MockChainnode) QueryBalance(chain, symbol string, address, contractAddress string, blockHeight uint64) (sdk.Int, error)
- func (m *MockChainnode) QueryGasPrice(chain string) (sdk.Int, error)
- func (m *MockChainnode) QueryNonce(chain, address string) (uint64, error)
- func (m *MockChainnode) QueryUtxo(chain, symbol string, vin *sdk.UtxoIn) (bool, error)
- func (m *MockChainnode) QueryUtxoInsFromData(chain, symbol string, data []byte) ([]*sdk.UtxoIn, error)
- func (m *MockChainnode) QueryUtxoTransaction(chain, symbol, hash string, asynMode bool) (*ExtUtxoTransaction, error)
- func (m *MockChainnode) QueryUtxoTransactionFromData(chain, symbol string, rawData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, [][]byte, error)
- func (m *MockChainnode) QueryUtxoTransactionFromSignedData(chain, symbol string, signedTxData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, error)
- func (m *MockChainnode) SupportChain(chain string) bool
- func (m *MockChainnode) ValidAddress(chain, symbol, address string) (bool, string)
- func (m *MockChainnode) VerifyAccountSignedTransaction(chain, symbol, address string, signedTxData []byte) (bool, error)
- func (m *MockChainnode) VerifyUtxoSignedTransaction(chain, symbol string, address []string, signedTxData []byte, ...) (bool, error)
Constants ¶
View Source
const ( StatusNotFound = 0 StatusPending = 1 StatusFailed = 2 StatusSuccess = 3 StatusContractExecuteFailed = 4 StatusOther = 5 )
Transaction status
Variables ¶
View Source
var ( ErrorNotSupported = errors.New("Chain is not supported") ErrorInvalidSignature = errors.New("Signature is invalid") ErrorInvalidInput = errors.New("invalid input") )
Errors
Functions ¶
This section is empty.
Types ¶
type Chainnode ¶
type Chainnode interface { SupportChain(chain string) bool ConvertAddress(chain string, pubKey []byte) (string, error) ValidAddress(chain, symbol, address string) (bool, string) QueryBalance(chain, symbol, address, contractAddress string, blockHeight uint64) (sdk.Int, error) //will be obsoleted later, please use ValidateAsset QueryUtxo(chain, symbol string, vin *sdk.UtxoIn) (bool, error) QueryNonce(chain, address string) (uint64, error) QueryGasPrice(chain string) (sdk.Int, error) QueryUtxoTransaction(chain, symbol, hash string, asynMode bool) (*ExtUtxoTransaction, error) QueryAccountTransaction(chain, symbol, hash string, asynMode bool) (*ExtAccountTransaction, error) CreateUtxoTransaction(chain, symbol string, transaction *ExtUtxoTransaction) ([]byte, [][]byte, error) CreateAccountTransaction(chain, symbol, contractAddress string, transaction *ExtAccountTransaction) ([]byte, []byte, error) CreateUtxoSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys [][]byte) ([]byte, []byte, error) CreateAccountSignedTransaction(chain, symbol string, raw []byte, signatures, pubKeys []byte) ([]byte, []byte, error) VerifyUtxoSignedTransaction(chain, symbol string, address []string, signedTxData []byte, vins []*sdk.UtxoIn) (bool, error) VerifyAccountSignedTransaction(chain, symbol string, address string, signedTxData []byte) (bool, error) QueryAccountTransactionFromSignedData(chain, symbol string, signedTxData []byte) (*ExtAccountTransaction, error) QueryUtxoTransactionFromSignedData(chain, symbol string, signedTxData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, error) QueryAccountTransactionFromData(chain, symbol string, rawData []byte) (*ExtAccountTransaction, []byte, error) QueryUtxoTransactionFromData(chain, symbol string, rawData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, [][]byte, error) BroadcastTransaction(chain, symbol string, signedTxData []byte) (transactionHash string, err error) QueryUtxoInsFromData(chain, symbol string, data []byte) ([]*sdk.UtxoIn, error) }
Chainnode interface
type ExtAccountTransaction ¶
type ExtUtxoTransaction ¶
type ExtUtxoTransaction struct { Hash string Status uint64 Vins []*sdk.UtxoIn Vouts []*sdk.UtxoOut CostFee sdk.Int BlockHeight uint64 BlockTime uint64 }
ExtTransaction for external chain connected by the chainnode
type MockChainnode ¶
func (*MockChainnode) BroadcastTransaction ¶
func (m *MockChainnode) BroadcastTransaction(chain, symbol string, signedTxData []byte) (string, error)
func (*MockChainnode) ConvertAddress ¶
func (m *MockChainnode) ConvertAddress(chain string, publicKey []byte) (string, error)
func (*MockChainnode) ConvertAddressFromSerializedPubKey ¶
func (m *MockChainnode) ConvertAddressFromSerializedPubKey(chain string, publicKey []byte) (string, error)
func (*MockChainnode) CreateAccountSignedTransaction ¶
func (*MockChainnode) CreateAccountTransaction ¶
func (m *MockChainnode) CreateAccountTransaction(chain, symbol, contractAddress string, transaction *ExtAccountTransaction) ( []byte, []byte, error)
func (*MockChainnode) CreateUtxoSignedTransaction ¶
func (*MockChainnode) CreateUtxoTransaction ¶
func (m *MockChainnode) CreateUtxoTransaction(chain, symbol string, transaction *ExtUtxoTransaction) ([]byte, [][]byte, error)
func (*MockChainnode) QueryAccountTransaction ¶
func (m *MockChainnode) QueryAccountTransaction(chain, symbol, hash string, asynMode bool) (*ExtAccountTransaction, error)
func (*MockChainnode) QueryAccountTransactionFromData ¶
func (m *MockChainnode) QueryAccountTransactionFromData(chain, symbol string, rawData []byte) (*ExtAccountTransaction, []byte, error)
func (*MockChainnode) QueryAccountTransactionFromSignedData ¶
func (m *MockChainnode) QueryAccountTransactionFromSignedData(chain, symbol string, signedTxData []byte) (*ExtAccountTransaction, error)
func (*MockChainnode) QueryBalance ¶
func (*MockChainnode) QueryGasPrice ¶
func (m *MockChainnode) QueryGasPrice(chain string) (sdk.Int, error)
func (*MockChainnode) QueryNonce ¶
func (m *MockChainnode) QueryNonce(chain, address string) (uint64, error)
func (*MockChainnode) QueryUtxoInsFromData ¶
func (*MockChainnode) QueryUtxoTransaction ¶
func (m *MockChainnode) QueryUtxoTransaction(chain, symbol, hash string, asynMode bool) (*ExtUtxoTransaction, error)
func (*MockChainnode) QueryUtxoTransactionFromData ¶
func (m *MockChainnode) QueryUtxoTransactionFromData(chain, symbol string, rawData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, [][]byte, error)
func (*MockChainnode) QueryUtxoTransactionFromSignedData ¶
func (m *MockChainnode) QueryUtxoTransactionFromSignedData(chain, symbol string, signedTxData []byte, vins []*sdk.UtxoIn) (*ExtUtxoTransaction, error)
func (*MockChainnode) SupportChain ¶
func (m *MockChainnode) SupportChain(chain string) bool
func (*MockChainnode) ValidAddress ¶
func (m *MockChainnode) ValidAddress(chain, symbol, address string) (bool, string)
func (*MockChainnode) VerifyAccountSignedTransaction ¶
func (m *MockChainnode) VerifyAccountSignedTransaction(chain, symbol, address string, signedTxData []byte) (bool, error)
func (*MockChainnode) VerifyUtxoSignedTransaction ¶
Click to show internal directories.
Click to hide internal directories.