Documentation
¶
Overview ¶
* * @file * @copyright defined in go-seele/LICENSE
* * This a temp file that mock the external APIs used in smart contract component. * It will be removed when blockchain infrastructure constructed, including account, * security, RPC, consensus and blockchain storage components. * * @file * @copyright defined in go-seele/LICENSE
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TxServ provide the transaction related service. // TODO initialize with the default implementation. TxServ TransactionService // ChainServ provide the blockchain related service. // TODO initialize with the default implementation. ChainServ BlockchainService )
Functions ¶
func Address ¶
func Address(privKey *ecdsa.PrivateKey) string
Address returns account public address for the specified private key.
func HandleTransaction ¶
func HandleTransaction(tx *Transaction)
HandleTransaction handles smart contract transation.
Types ¶
type BlockchainService ¶
type BlockchainService interface { // WriteContractAccount write contract account on blockchain. WriteContractAccount(account *Account) // GetContractAccount returns contract account of the specified address. GetContractAccount(address string) *Account // WriteCode write code on blockchain. WriteCode(codeAddress string, code []byte) // GetCode returns code of the specified address. GetCode(codeAddress string) []byte // WriteTransaction write transaction on blockchain. WriteTransaction(tx *Transaction) }
BlockchainService is the interface for blockchain related operations.
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
Operator wraps request operations of smart contract. All the operations should be signed.
func NewOperator ¶
func NewOperator(privKey *ecdsa.PrivateKey) *Operator
NewOperator return a operator for smart contract operations.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction wraps the smart contract transaction.
type TransactionService ¶
type TransactionService interface { // SendTransaction broadcast the smart contract transaction to P2P network for consensus. SendTransaction(tx *Transaction) // HandleTransaction handle the received smart contract transaction. HandleTransaction(tx *Transaction) }
TransactionService is the interface for all transaction related operations.