Documentation
¶
Index ¶
- type ArwenMessenger
- type ArwenPart
- type BlockchainHookGateway
- func (blockchain *BlockchainHookGateway) AccountExists(address []byte) (bool, error)
- func (blockchain *BlockchainHookGateway) CurrentEpoch() uint32
- func (blockchain *BlockchainHookGateway) CurrentNonce() uint64
- func (blockchain *BlockchainHookGateway) CurrentRandomSeed() []byte
- func (blockchain *BlockchainHookGateway) CurrentRound() uint64
- func (blockchain *BlockchainHookGateway) CurrentTimeStamp() uint64
- func (blockchain *BlockchainHookGateway) GetBalance(address []byte) (*big.Int, error)
- func (blockchain *BlockchainHookGateway) GetBlockhash(nonce uint64) ([]byte, error)
- func (blockchain *BlockchainHookGateway) GetCode(address []byte) ([]byte, error)
- func (blockchain *BlockchainHookGateway) GetNonce(address []byte) (uint64, error)
- func (blockchain *BlockchainHookGateway) GetStateRootHash() []byte
- func (blockchain *BlockchainHookGateway) GetStorageData(address []byte, index []byte) ([]byte, error)
- func (blockchain *BlockchainHookGateway) IsCodeEmpty(address []byte) (bool, error)
- func (blockchain *BlockchainHookGateway) LastEpoch() uint32
- func (blockchain *BlockchainHookGateway) LastNonce() uint64
- func (blockchain *BlockchainHookGateway) LastRandomSeed() []byte
- func (blockchain *BlockchainHookGateway) LastRound() uint64
- func (blockchain *BlockchainHookGateway) LastTimeStamp() uint64
- func (blockchain *BlockchainHookGateway) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
- type CryptoHookGateway
- func (hook *CryptoHookGateway) Ecrecover(hash []byte, recoveryID []byte, r []byte, s []byte) ([]byte, error)
- func (hook *CryptoHookGateway) Keccak256(data []byte) ([]byte, error)
- func (hook *CryptoHookGateway) Ripemd160(data []byte) ([]byte, error)
- func (hook *CryptoHookGateway) Sha256(data []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArwenMessenger ¶
ArwenMessenger is the messenger on Arwen's part of the pipe
func NewArwenMessenger ¶
func NewArwenMessenger(logger logger.Logger, reader *os.File, writer *os.File, marshalizer marshaling.Marshalizer) *ArwenMessenger
NewArwenMessenger creates a new messenger
func (*ArwenMessenger) ReceiveNodeRequest ¶
func (messenger *ArwenMessenger) ReceiveNodeRequest() (common.MessageHandler, error)
ReceiveNodeRequest waits for a request from Node
func (*ArwenMessenger) SendContractResponse ¶
func (messenger *ArwenMessenger) SendContractResponse(response common.MessageHandler) error
SendContractResponse sends a contract response to the Node
func (*ArwenMessenger) SendHookCallRequest ¶
func (messenger *ArwenMessenger) SendHookCallRequest(request common.MessageHandler) (common.MessageHandler, error)
SendHookCallRequest makes a hook call (over the pipe) and waits for the response
type ArwenPart ¶
type ArwenPart struct { Messenger *ArwenMessenger Logger logger.Logger VMHost vmcommon.VMExecutionHandler Repliers []common.MessageReplier }
ArwenPart is the endpoint that implements the message loop on Arwen's side
func NewArwenPart ¶
func NewArwenPart( mainLogger logger.Logger, dialogueLogger logger.Logger, input *os.File, output *os.File, vmHostArguments *common.VMHostArguments, marshalizer marshaling.Marshalizer, ) (*ArwenPart, error)
NewArwenPart creates the Arwen part
type BlockchainHookGateway ¶
type BlockchainHookGateway struct {
// contains filtered or unexported fields
}
BlockchainHookGateway forwards requests to the actual hook
func NewBlockchainHookGateway ¶
func NewBlockchainHookGateway(messenger *ArwenMessenger) *BlockchainHookGateway
NewBlockchainHookGateway creates a new gateway
func (*BlockchainHookGateway) AccountExists ¶
func (blockchain *BlockchainHookGateway) AccountExists(address []byte) (bool, error)
AccountExists forwards a message to the actual hook
func (*BlockchainHookGateway) CurrentEpoch ¶
func (blockchain *BlockchainHookGateway) CurrentEpoch() uint32
CurrentEpoch forwards a message to the actual hook
func (*BlockchainHookGateway) CurrentNonce ¶
func (blockchain *BlockchainHookGateway) CurrentNonce() uint64
CurrentNonce forwards a message to the actual hook
func (*BlockchainHookGateway) CurrentRandomSeed ¶
func (blockchain *BlockchainHookGateway) CurrentRandomSeed() []byte
CurrentRandomSeed forwards a message to the actual hook
func (*BlockchainHookGateway) CurrentRound ¶
func (blockchain *BlockchainHookGateway) CurrentRound() uint64
CurrentRound forwards a message to the actual hook
func (*BlockchainHookGateway) CurrentTimeStamp ¶
func (blockchain *BlockchainHookGateway) CurrentTimeStamp() uint64
CurrentTimeStamp forwards a message to the actual hook
func (*BlockchainHookGateway) GetBalance ¶
func (blockchain *BlockchainHookGateway) GetBalance(address []byte) (*big.Int, error)
GetBalance forwards a message to the actual hook
func (*BlockchainHookGateway) GetBlockhash ¶
func (blockchain *BlockchainHookGateway) GetBlockhash(nonce uint64) ([]byte, error)
GetBlockhash forwards a message to the actual hook
func (*BlockchainHookGateway) GetCode ¶
func (blockchain *BlockchainHookGateway) GetCode(address []byte) ([]byte, error)
GetCode forwards a message to the actual hook
func (*BlockchainHookGateway) GetNonce ¶
func (blockchain *BlockchainHookGateway) GetNonce(address []byte) (uint64, error)
GetNonce forwards a message to the actual hook
func (*BlockchainHookGateway) GetStateRootHash ¶
func (blockchain *BlockchainHookGateway) GetStateRootHash() []byte
GetStateRootHash forwards a message to the actual hook
func (*BlockchainHookGateway) GetStorageData ¶
func (blockchain *BlockchainHookGateway) GetStorageData(address []byte, index []byte) ([]byte, error)
GetStorageData forwards a message to the actual hook
func (*BlockchainHookGateway) IsCodeEmpty ¶
func (blockchain *BlockchainHookGateway) IsCodeEmpty(address []byte) (bool, error)
IsCodeEmpty forwards a message to the actual hook
func (*BlockchainHookGateway) LastEpoch ¶
func (blockchain *BlockchainHookGateway) LastEpoch() uint32
LastEpoch forwards a message to the actual hook
func (*BlockchainHookGateway) LastNonce ¶
func (blockchain *BlockchainHookGateway) LastNonce() uint64
LastNonce forwards a message to the actual hook
func (*BlockchainHookGateway) LastRandomSeed ¶
func (blockchain *BlockchainHookGateway) LastRandomSeed() []byte
LastRandomSeed forwards a message to the actual hook
func (*BlockchainHookGateway) LastRound ¶
func (blockchain *BlockchainHookGateway) LastRound() uint64
LastRound forwards a message to the actual hook
func (*BlockchainHookGateway) LastTimeStamp ¶
func (blockchain *BlockchainHookGateway) LastTimeStamp() uint64
LastTimeStamp forwards a message to the actual hook
func (*BlockchainHookGateway) NewAddress ¶
func (blockchain *BlockchainHookGateway) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
NewAddress forwards a message to the actual hook
type CryptoHookGateway ¶
type CryptoHookGateway struct { }
CryptoHookGateway is a copy of the CryptoHook implementation from the node TODO: Remove this implementation and reference ElrondNetwork/common/crypto when it becomes available
func NewCryptoHookGateway ¶
func NewCryptoHookGateway() *CryptoHookGateway
NewCryptoHookGateway creates a new crypto hook gateway
func (*CryptoHookGateway) Ecrecover ¶
func (hook *CryptoHookGateway) Ecrecover(hash []byte, recoveryID []byte, r []byte, s []byte) ([]byte, error)
Ecrecover calculates the corresponding Ethereum address for the public key which created the given signature https://ewasm.readthedocs.io/en/mkdocs/system_contracts/
func (*CryptoHookGateway) Keccak256 ¶
func (hook *CryptoHookGateway) Keccak256(data []byte) ([]byte, error)
Keccak256 returns a keccak 256 hash of the input string. Should return in hex format