Documentation ¶
Index ¶
- Constants
- Variables
- func IsContractResponse(message MessageHandler) bool
- func IsCriticalError(err error) bool
- func IsDiagnose(message MessageHandler) bool
- func IsGasScheduleChangeResponse(message MessageHandler) bool
- func IsHookCall(message MessageHandler) bool
- func IsStopRequest(message MessageHandler) bool
- func IsVersionResponse(message MessageHandler) bool
- func SendVMArguments(pipe *os.File, pipeArguments VMArguments) error
- type Account
- func (a *Account) AccountDataHandler() vmcommon.AccountDataHandler
- func (a *Account) AddToBalance(_ *big.Int) error
- func (a *Account) AddressBytes() []byte
- func (a *Account) ChangeOwnerAddress(_ []byte, _ []byte) error
- func (a *Account) ClaimDeveloperRewards(_ []byte) (*big.Int, error)
- func (a *Account) GetBalance() *big.Int
- func (a *Account) GetCodeHash() []byte
- func (a *Account) GetCodeMetadata() []byte
- func (a *Account) GetDeveloperReward() *big.Int
- func (a *Account) GetNonce() uint64
- func (a *Account) GetOwnerAddress() []byte
- func (a *Account) GetRootHash() []byte
- func (a *Account) GetUserName() []byte
- func (a *Account) IncreaseNonce(_ uint64)
- func (a *Account) IsInterfaceNil() bool
- func (a *Account) SetCodeMetadata(_ []byte)
- func (a *Account) SetOwnerAddress(_ []byte)
- func (a *Account) SetUserName(_ []byte)
- type CriticalError
- type Message
- func (message *Message) DebugString() string
- func (message *Message) GetError() error
- func (message *Message) GetKind() MessageKind
- func (message *Message) GetKindName() string
- func (message *Message) GetNonce() uint32
- func (message *Message) SetError(err error)
- func (message *Message) SetKind(kind MessageKind)
- func (message *Message) SetNonce(nonce uint32)
- type MessageBlockchainClearCompiledCodesRequest
- type MessageBlockchainClearCompiledCodesResponse
- type MessageBlockchainCurrentEpochRequest
- type MessageBlockchainCurrentEpochResponse
- type MessageBlockchainCurrentNonceRequest
- type MessageBlockchainCurrentNonceResponse
- type MessageBlockchainCurrentRandomSeedRequest
- type MessageBlockchainCurrentRandomSeedResponse
- type MessageBlockchainCurrentRoundRequest
- type MessageBlockchainCurrentRoundResponse
- type MessageBlockchainCurrentTimeStampRequest
- type MessageBlockchainCurrentTimeStampResponse
- type MessageBlockchainGetAllStateRequest
- type MessageBlockchainGetAllStateResponse
- type MessageBlockchainGetBlockhashRequest
- type MessageBlockchainGetBlockhashResponse
- type MessageBlockchainGetBuiltinFunctionNamesRequest
- type MessageBlockchainGetBuiltinFunctionNamesResponse
- type MessageBlockchainGetCodeRequest
- type MessageBlockchainGetCodeResponse
- type MessageBlockchainGetCompiledCodeRequest
- type MessageBlockchainGetCompiledCodeResponse
- type MessageBlockchainGetDCDTTokenRequest
- type MessageBlockchainGetDCDTTokenResponse
- type MessageBlockchainGetShardOfAddressRequest
- type MessageBlockchainGetShardOfAddressResponse
- type MessageBlockchainGetSnapshotRequest
- type MessageBlockchainGetSnapshotResponse
- type MessageBlockchainGetStateRootHashRequest
- type MessageBlockchainGetStateRootHashResponse
- type MessageBlockchainGetStorageDataRequest
- type MessageBlockchainGetStorageDataResponse
- type MessageBlockchainGetUserAccountRequest
- type MessageBlockchainGetUserAccountResponse
- type MessageBlockchainIsInterfaceNilRequest
- type MessageBlockchainIsInterfaceNilResponse
- type MessageBlockchainIsPayableRequest
- type MessageBlockchainIsPayableResponse
- type MessageBlockchainIsSmartContractRequest
- type MessageBlockchainIsSmartContractResponse
- type MessageBlockchainLastEpochRequest
- type MessageBlockchainLastEpochResponse
- type MessageBlockchainLastNonceRequest
- type MessageBlockchainLastNonceResponse
- type MessageBlockchainLastRandomSeedRequest
- type MessageBlockchainLastRandomSeedResponse
- type MessageBlockchainLastRoundRequest
- type MessageBlockchainLastRoundResponse
- type MessageBlockchainLastTimeStampRequest
- type MessageBlockchainLastTimeStampResponse
- type MessageBlockchainNewAddressRequest
- type MessageBlockchainNewAddressResponse
- type MessageBlockchainProcessBuiltInFunctionRequest
- type MessageBlockchainProcessBuiltInFunctionResponse
- type MessageBlockchainRevertToSnapshotRequest
- type MessageBlockchainRevertToSnapshotResponse
- type MessageBlockchainSaveCompiledCodeRequest
- type MessageBlockchainSaveCompiledCodeResponse
- type MessageContractCallRequest
- type MessageContractDeployRequest
- type MessageContractResponse
- type MessageDiagnoseWaitRequest
- type MessageDiagnoseWaitResponse
- type MessageGasScheduleChangeRequest
- type MessageHandler
- type MessageInitialize
- type MessageKind
- type MessageReplier
- type MessageStop
- type MessageVersionRequest
- type MessageVersionResponse
- type Messenger
- type Receiver
- type Sender
- type SerializableMapStringBytes
- type SerializableOutputAccount
- type SerializableOutputTransfer
- type SerializableVMOutput
- type UndefinedMessage
- type VMArguments
Constants ¶
const ( // ErrCodeSuccess signals success ErrCodeSuccess = iota // ErrCodeCannotCreateFile signals a critical error ErrCodeCannotCreateFile // ErrCodeInit signals a critical error ErrCodeInit // ErrCodeTerminated signals a critical error ErrCodeTerminated )
const EnvVarVMPath = "VM_PATH"
EnvVarVMPath is an environment variable
Variables ¶
var ErrBadHookResponseFromNode = &CriticalError{InnerErr: fmt.Errorf("bad hook response from node")}
ErrBadHookResponseFromNode signals a critical error
var ErrBadMessageFromVM = &CriticalError{InnerErr: fmt.Errorf("bad message from vm")}
ErrBadMessageFromVM signals a critical error
var ErrBadRequestFromNode = &CriticalError{InnerErr: fmt.Errorf("bad message from node")}
ErrBadRequestFromNode signals a critical error
var ErrBadVMArguments = &CriticalError{InnerErr: fmt.Errorf("bad arguments passed to vm")}
ErrBadVMArguments signals a critical error
var ErrCannotReceiveHookCallResponse = &CriticalError{InnerErr: fmt.Errorf("cannot receive hook call response")}
ErrCannotReceiveHookCallResponse signals a critical error
var ErrCannotSendContractRequest = &CriticalError{InnerErr: fmt.Errorf("cannot send contract request")}
ErrCannotSendContractRequest signals a critical error
var ErrCannotSendHookCallRequest = &CriticalError{InnerErr: fmt.Errorf("cannot send hook call request")}
ErrCannotSendHookCallRequest signals a critical error
var ErrCannotSendHookCallResponse = &CriticalError{InnerErr: fmt.Errorf("cannot send hook call response")}
ErrCannotSendHookCallResponse signals a critical error
var ErrInvalidMessageNonce = &CriticalError{InnerErr: fmt.Errorf("invalid dialogue nonce")}
ErrInvalidMessageNonce signals a critical error
var ErrStopPerNodeRequest = &CriticalError{InnerErr: fmt.Errorf("vm will stop, as requested")}
ErrStopPerNodeRequest signals a critical error
var ErrVMClosed = &CriticalError{InnerErr: fmt.Errorf("vm closed")}
ErrVMClosed signals a critical error
var ErrVMNotFound = &CriticalError{InnerErr: fmt.Errorf("vm binary not found")}
ErrVMNotFound signals a critical error
var ErrVMTimeExpired = &CriticalError{InnerErr: fmt.Errorf("vm time expired")}
ErrVMTimeExpired signals a critical error
Functions ¶
func IsContractResponse ¶
func IsContractResponse(message MessageHandler) bool
IsContractResponse returns whether a message is a contract response
func IsCriticalError ¶
IsCriticalError returns whether the error is critical
func IsDiagnose ¶
func IsDiagnose(message MessageHandler) bool
IsDiagnose returns whether a message is a diagnose request
func IsGasScheduleChangeResponse ¶
func IsGasScheduleChangeResponse(message MessageHandler) bool
IsGasScheduleChangeResponse returns a message with gas schedule response
func IsHookCall ¶
func IsHookCall(message MessageHandler) bool
IsHookCall returns whether a message is a hook call
func IsStopRequest ¶
func IsStopRequest(message MessageHandler) bool
IsStopRequest returns whether a message is a stop request
func IsVersionResponse ¶
func IsVersionResponse(message MessageHandler) bool
IsVersionResponse returns version response
func SendVMArguments ¶
func SendVMArguments(pipe *os.File, pipeArguments VMArguments) error
SendVMArguments sends initialization arguments through a pipe
Types ¶
type Account ¶
type Account struct { Nonce uint64 Balance *big.Int CodeHash []byte RootHash []byte Address []byte DeveloperReward *big.Int OwnerAddress []byte UserName []byte CodeMetadata []byte }
Account holds the account info (is a substructure of an IPC message)
func (*Account) AccountDataHandler ¶
func (a *Account) AccountDataHandler() vmcommon.AccountDataHandler
AccountDataHandler -
func (*Account) AddressBytes ¶
AddressBytes gets the address
func (*Account) ChangeOwnerAddress ¶
ChangeOwnerAddress -
func (*Account) ClaimDeveloperRewards ¶
ClaimDeveloperRewards -
func (*Account) GetCodeMetadata ¶
GetCodeMetadata gets the code metadata
func (*Account) GetDeveloperReward ¶
GetDeveloperReward gets the developer reward
func (*Account) GetOwnerAddress ¶
GetOwnerAddress gets the owner's address
func (*Account) GetUserName ¶
GetOwnerAddress gets the username
func (*Account) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
type CriticalError ¶
type CriticalError struct {
InnerErr error
}
CriticalError signals a critical error
func WrapCriticalError ¶
func WrapCriticalError(err error) *CriticalError
WrapCriticalError wraps an error
func (*CriticalError) Error ¶
func (err *CriticalError) Error() string
func (*CriticalError) Unwrap ¶
func (err *CriticalError) Unwrap() error
Unwrap unwraps the inner error
type Message ¶
type Message struct { DialogueNonce uint32 Kind MessageKind ErrorMessage string }
Message is the implementation of the abstraction
func NewGasScheduleChangeResponse ¶
func NewGasScheduleChangeResponse() *Message
NewGasScheduleChangeResponse creates a message to respond
func (*Message) DebugString ¶
DebugString is a debug representation of the message
func (*Message) GetKind ¶
func (message *Message) GetKind() MessageKind
GetKind gets the message kind
func (*Message) GetKindName ¶
GetKindName gets the kind name
func (*Message) SetKind ¶
func (message *Message) SetKind(kind MessageKind)
SetKind sets the message kind
type MessageBlockchainClearCompiledCodesRequest ¶
type MessageBlockchainClearCompiledCodesRequest struct {
Message
}
MessageBlockchainClearCompiledCodesRequest represents a request message
func NewMessageBlockchainClearCompiledCodesRequest ¶
func NewMessageBlockchainClearCompiledCodesRequest() *MessageBlockchainClearCompiledCodesRequest
NewMessageBlockchainClearCompiledCodesRequest creates a request message
type MessageBlockchainClearCompiledCodesResponse ¶
type MessageBlockchainClearCompiledCodesResponse struct {
Message
}
MessageBlockchainClearCompiledCodesResponse represents a response message
func NewMessageBlockchainClearCompiledCodesResponse ¶
func NewMessageBlockchainClearCompiledCodesResponse() *MessageBlockchainClearCompiledCodesResponse
NewMessageBlockchainClearCompiledCodesResponse creates a response message
type MessageBlockchainCurrentEpochRequest ¶
type MessageBlockchainCurrentEpochRequest struct {
Message
}
MessageBlockchainCurrentEpochRequest represents a request message
func NewMessageBlockchainCurrentEpochRequest ¶
func NewMessageBlockchainCurrentEpochRequest() *MessageBlockchainCurrentEpochRequest
NewMessageBlockchainCurrentEpochRequest creates a request message
type MessageBlockchainCurrentEpochResponse ¶
MessageBlockchainCurrentEpochResponse represents a response message
func NewMessageBlockchainCurrentEpochResponse ¶
func NewMessageBlockchainCurrentEpochResponse(result uint32) *MessageBlockchainCurrentEpochResponse
NewMessageBlockchainCurrentEpochResponse creates a response message
type MessageBlockchainCurrentNonceRequest ¶
type MessageBlockchainCurrentNonceRequest struct {
Message
}
MessageBlockchainCurrentNonceRequest represents a request message
func NewMessageBlockchainCurrentNonceRequest ¶
func NewMessageBlockchainCurrentNonceRequest() *MessageBlockchainCurrentNonceRequest
NewMessageBlockchainCurrentNonceRequest creates a request message
type MessageBlockchainCurrentNonceResponse ¶
MessageBlockchainCurrentNonceResponse represents a response message
func NewMessageBlockchainCurrentNonceResponse ¶
func NewMessageBlockchainCurrentNonceResponse(result uint64) *MessageBlockchainCurrentNonceResponse
NewMessageBlockchainCurrentNonceResponse creates a response message
type MessageBlockchainCurrentRandomSeedRequest ¶
type MessageBlockchainCurrentRandomSeedRequest struct {
Message
}
MessageBlockchainCurrentRandomSeedRequest represents a request message
func NewMessageBlockchainCurrentRandomSeedRequest ¶
func NewMessageBlockchainCurrentRandomSeedRequest() *MessageBlockchainCurrentRandomSeedRequest
NewMessageBlockchainCurrentRandomSeedRequest creates a request message
type MessageBlockchainCurrentRandomSeedResponse ¶
MessageBlockchainCurrentRandomSeedResponse represents a response message
func NewMessageBlockchainCurrentRandomSeedResponse ¶
func NewMessageBlockchainCurrentRandomSeedResponse(result []byte) *MessageBlockchainCurrentRandomSeedResponse
NewMessageBlockchainCurrentRandomSeedResponse creates a response message
type MessageBlockchainCurrentRoundRequest ¶
type MessageBlockchainCurrentRoundRequest struct {
Message
}
MessageBlockchainCurrentRoundRequest represents a request message
func NewMessageBlockchainCurrentRoundRequest ¶
func NewMessageBlockchainCurrentRoundRequest() *MessageBlockchainCurrentRoundRequest
NewMessageBlockchainCurrentRoundRequest creates a request message
type MessageBlockchainCurrentRoundResponse ¶
MessageBlockchainCurrentRoundResponse represents a response message
func NewMessageBlockchainCurrentRoundResponse ¶
func NewMessageBlockchainCurrentRoundResponse(result uint64) *MessageBlockchainCurrentRoundResponse
NewMessageBlockchainCurrentRoundResponse creates a response message
type MessageBlockchainCurrentTimeStampRequest ¶
type MessageBlockchainCurrentTimeStampRequest struct {
Message
}
MessageBlockchainCurrentTimeStampRequest represents a request message
func NewMessageBlockchainCurrentTimeStampRequest ¶
func NewMessageBlockchainCurrentTimeStampRequest() *MessageBlockchainCurrentTimeStampRequest
NewMessageBlockchainCurrentTimeStampRequest creates a request message
type MessageBlockchainCurrentTimeStampResponse ¶
MessageBlockchainCurrentTimeStampResponse represents a response message
func NewMessageBlockchainCurrentTimeStampResponse ¶
func NewMessageBlockchainCurrentTimeStampResponse(result uint64) *MessageBlockchainCurrentTimeStampResponse
NewMessageBlockchainCurrentTimeStampResponse creates a response message
type MessageBlockchainGetAllStateRequest ¶
MessageBlockchainGetAllStateRequest represents a request message
func NewMessageBlockchainGetAllStateRequest ¶
func NewMessageBlockchainGetAllStateRequest(address []byte) *MessageBlockchainGetAllStateRequest
NewMessageBlockchainGetAllStateRequest creates a request message
type MessageBlockchainGetAllStateResponse ¶
type MessageBlockchainGetAllStateResponse struct { Message Result *SerializableMapStringBytes }
MessageBlockchainGetAllStateResponse represents a response message
func NewMessageBlockchainGetAllStateResponse ¶
func NewMessageBlockchainGetAllStateResponse(result map[string][]byte, err error) *MessageBlockchainGetAllStateResponse
NewMessageBlockchainGetAllStateResponse creates a response message
type MessageBlockchainGetBlockhashRequest ¶
MessageBlockchainGetBlockhashRequest represents a request message
func NewMessageBlockchainGetBlockhashRequest ¶
func NewMessageBlockchainGetBlockhashRequest(nonce uint64) *MessageBlockchainGetBlockhashRequest
NewMessageBlockchainGetBlockhashRequest creates a request message
type MessageBlockchainGetBlockhashResponse ¶
MessageBlockchainGetBlockhashResponse represents a response message
func NewMessageBlockchainGetBlockhashResponse ¶
func NewMessageBlockchainGetBlockhashResponse(result []byte, err error) *MessageBlockchainGetBlockhashResponse
NewMessageBlockchainGetBlockhashResponse creates a response message
type MessageBlockchainGetBuiltinFunctionNamesRequest ¶
type MessageBlockchainGetBuiltinFunctionNamesRequest struct {
Message
}
MessageBlockchainGetBuiltinFunctionNamesRequest represents a request message
func NewMessageBlockchainGetBuiltinFunctionNamesRequest ¶
func NewMessageBlockchainGetBuiltinFunctionNamesRequest() *MessageBlockchainGetBuiltinFunctionNamesRequest
NewMessageBlockchainGetBuiltinFunctionNamesRequest creates a request message
type MessageBlockchainGetBuiltinFunctionNamesResponse ¶
type MessageBlockchainGetBuiltinFunctionNamesResponse struct { Message Result vmcommon.FunctionNames }
MessageBlockchainGetBuiltinFunctionNamesResponse represents a response message
func NewMessageBlockchainGetBuiltinFunctionNamesResponse ¶
func NewMessageBlockchainGetBuiltinFunctionNamesResponse(result vmcommon.FunctionNames) *MessageBlockchainGetBuiltinFunctionNamesResponse
NewMessageBlockchainGetBuiltinFunctionNamesResponse creates a response message
type MessageBlockchainGetCodeRequest ¶
MessageBlockchainGetCodeRequest represents a request message
func NewMessageBlockchainGetCodeRequest ¶
func NewMessageBlockchainGetCodeRequest(account *Account) *MessageBlockchainGetCodeRequest
NewMessageBlockchainGetCodeRequest creates a request message
type MessageBlockchainGetCodeResponse ¶
MessageBlockchainGetCodeResponse represents a response message
func NewMessageBlockchainGetCodeResponse ¶
func NewMessageBlockchainGetCodeResponse(code []byte) *MessageBlockchainGetCodeResponse
NewMessageBlockchainGetCodeResponse creates a response message
type MessageBlockchainGetCompiledCodeRequest ¶
MessageBlockchainGetCompiledCodeRequest represents a request message
func NewMessageBlockchainGetCompiledCodeRequest ¶
func NewMessageBlockchainGetCompiledCodeRequest(codeHash []byte) *MessageBlockchainGetCompiledCodeRequest
NewMessageBlockchainGetCompiledCodeRequest creates a request message
type MessageBlockchainGetCompiledCodeResponse ¶
MessageBlockchainGetCompiledCodeResponse represents a response message
func NewMessageBlockchainGetCompiledCodeResponse ¶
func NewMessageBlockchainGetCompiledCodeResponse(found bool, code []byte) *MessageBlockchainGetCompiledCodeResponse
NewMessageBlockchainGetCompiledCodeResponse creates a response message
type MessageBlockchainGetDCDTTokenRequest ¶
type MessageBlockchainGetDCDTTokenRequest struct { Message Address []byte TokenID []byte Nonce uint64 }
MessageBlockchainGetDCDTTokenRequest represents a request message
func NewMessageBlockchainGetDCDTTokenRequest ¶
func NewMessageBlockchainGetDCDTTokenRequest(address []byte, tokenID []byte, nonce uint64) *MessageBlockchainGetDCDTTokenRequest
NewMessageBlockchainGetDCDTTokenRequest creates a request message
type MessageBlockchainGetDCDTTokenResponse ¶
type MessageBlockchainGetDCDTTokenResponse struct { Message Result *dcdt.DCDigitalToken }
MessageBlockchainGetDCDTTokenResponse represents a response message
func NewMessageBlockchainGetDCDTTokenResponse ¶
func NewMessageBlockchainGetDCDTTokenResponse(result *dcdt.DCDigitalToken, err error) *MessageBlockchainGetDCDTTokenResponse
NewMessageBlockchainGetDCDTTokenResponse creates a response message
type MessageBlockchainGetShardOfAddressRequest ¶
MessageBlockchainGetShardOfAddressRequest represents a request message
func NewMessageBlockchainGetShardOfAddressRequest ¶
func NewMessageBlockchainGetShardOfAddressRequest(address []byte) *MessageBlockchainGetShardOfAddressRequest
NewMessageBlockchainGetShardOfAddressRequest creates a request message
type MessageBlockchainGetShardOfAddressResponse ¶
MessageBlockchainGetShardOfAddressResponse represents a response message
func NewMessageBlockchainGetShardOfAddressResponse ¶
func NewMessageBlockchainGetShardOfAddressResponse(result uint32) *MessageBlockchainGetShardOfAddressResponse
NewMessageBlockchainGetShardOfAddressResponse creates a response message
type MessageBlockchainGetSnapshotRequest ¶
type MessageBlockchainGetSnapshotRequest struct {
Message
}
MessageBlockchainGetSnapshotRequest represents a request message
func NewMessageBlockchainGetSnapshotRequest ¶
func NewMessageBlockchainGetSnapshotRequest() *MessageBlockchainGetSnapshotRequest
NewMessageBlockchainGetSnapshotRequest creates a request message
type MessageBlockchainGetSnapshotResponse ¶
MessageBlockchainGetSnapshotResponse represents a response message
func NewMessageBlockchainGetSnapshotResponse ¶
func NewMessageBlockchainGetSnapshotResponse(result int) *MessageBlockchainGetSnapshotResponse
NewMessageBlockchainGetSnapshotResponse creates a response message
type MessageBlockchainGetStateRootHashRequest ¶
type MessageBlockchainGetStateRootHashRequest struct {
Message
}
MessageBlockchainGetStateRootHashRequest represents a request message
func NewMessageBlockchainGetStateRootHashRequest ¶
func NewMessageBlockchainGetStateRootHashRequest() *MessageBlockchainGetStateRootHashRequest
NewMessageBlockchainGetStateRootHashRequest creates a request message
type MessageBlockchainGetStateRootHashResponse ¶
MessageBlockchainGetStateRootHashResponse represents a response message
func NewMessageBlockchainGetStateRootHashResponse ¶
func NewMessageBlockchainGetStateRootHashResponse(result []byte) *MessageBlockchainGetStateRootHashResponse
NewMessageBlockchainGetStateRootHashResponse creates a response message
type MessageBlockchainGetStorageDataRequest ¶
MessageBlockchainGetStorageDataRequest represents a request message
func NewMessageBlockchainGetStorageDataRequest ¶
func NewMessageBlockchainGetStorageDataRequest(accountAddress []byte, index []byte) *MessageBlockchainGetStorageDataRequest
NewMessageBlockchainGetStorageDataRequest creates a request message
type MessageBlockchainGetStorageDataResponse ¶
MessageBlockchainGetStorageDataResponse represents a response message
func NewMessageBlockchainGetStorageDataResponse ¶
func NewMessageBlockchainGetStorageDataResponse(data []byte, err error) *MessageBlockchainGetStorageDataResponse
NewMessageBlockchainGetStorageDataResponse creates a response message
type MessageBlockchainGetUserAccountRequest ¶
MessageBlockchainGetUserAccountRequest represents a request message
func NewMessageBlockchainGetUserAccountRequest ¶
func NewMessageBlockchainGetUserAccountRequest(address []byte) *MessageBlockchainGetUserAccountRequest
NewMessageBlockchainGetUserAccountRequest creates a request message
type MessageBlockchainGetUserAccountResponse ¶
MessageBlockchainGetUserAccountResponse represents a response message
func NewMessageBlockchainGetUserAccountResponse ¶
func NewMessageBlockchainGetUserAccountResponse(result *Account, err error) *MessageBlockchainGetUserAccountResponse
NewMessageBlockchainGetUserAccountResponse creates a response message
type MessageBlockchainIsInterfaceNilRequest ¶
type MessageBlockchainIsInterfaceNilRequest struct {
Message
}
MessageBlockchainIsInterfaceNilRequest represents a request message
func NewMessageBlockchainIsInterfaceNilRequest ¶
func NewMessageBlockchainIsInterfaceNilRequest() *MessageBlockchainIsInterfaceNilRequest
NewMessageBlockchainIsInterfaceNilRequest creates a request message
type MessageBlockchainIsInterfaceNilResponse ¶
MessageBlockchainIsInterfaceNilResponse represents a response message
func NewMessageBlockchainIsInterfaceNilResponse ¶
func NewMessageBlockchainIsInterfaceNilResponse(result bool) *MessageBlockchainIsInterfaceNilResponse
NewMessageBlockchainIsInterfaceNilResponse creates a response message
type MessageBlockchainIsPayableRequest ¶
MessageBlockchainIsPayableRequest represents a request message
func NewMessageBlockchainIsPayableRequest ¶
func NewMessageBlockchainIsPayableRequest(address []byte) *MessageBlockchainIsPayableRequest
NewMessageBlockchainIsPayableRequest creates a request message
type MessageBlockchainIsPayableResponse ¶
MessageBlockchainIsPayableResponse represents a response message
func NewMessageBlockchainIsPayableResponse ¶
func NewMessageBlockchainIsPayableResponse(result bool, err error) *MessageBlockchainIsPayableResponse
NewMessageBlockchainIsPayableResponse creates a response message
type MessageBlockchainIsSmartContractRequest ¶
MessageBlockchainIsSmartContractRequest represents a request message
func NewMessageBlockchainIsSmartContractRequest ¶
func NewMessageBlockchainIsSmartContractRequest(address []byte) *MessageBlockchainIsSmartContractRequest
NewMessageBlockchainIsSmartContractRequest creates a request message
type MessageBlockchainIsSmartContractResponse ¶
MessageBlockchainIsSmartContractResponse represents a response message
func NewMessageBlockchainIsSmartContractResponse ¶
func NewMessageBlockchainIsSmartContractResponse(result bool) *MessageBlockchainIsSmartContractResponse
NewMessageBlockchainIsSmartContractResponse creates a response message
type MessageBlockchainLastEpochRequest ¶
type MessageBlockchainLastEpochRequest struct {
Message
}
MessageBlockchainLastEpochRequest represents a request message
func NewMessageBlockchainLastEpochRequest ¶
func NewMessageBlockchainLastEpochRequest() *MessageBlockchainLastEpochRequest
NewMessageBlockchainLastEpochRequest creates a request message
type MessageBlockchainLastEpochResponse ¶
MessageBlockchainLastEpochResponse represents a response message
func NewMessageBlockchainLastEpochResponse ¶
func NewMessageBlockchainLastEpochResponse(result uint32) *MessageBlockchainLastEpochResponse
NewMessageBlockchainLastEpochResponse creates a response message
type MessageBlockchainLastNonceRequest ¶
type MessageBlockchainLastNonceRequest struct {
Message
}
MessageBlockchainLastNonceRequest represents a request message
func NewMessageBlockchainLastNonceRequest ¶
func NewMessageBlockchainLastNonceRequest() *MessageBlockchainLastNonceRequest
NewMessageBlockchainLastNonceRequest creates a request message
type MessageBlockchainLastNonceResponse ¶
MessageBlockchainLastNonceResponse represents a response message
func NewMessageBlockchainLastNonceResponse ¶
func NewMessageBlockchainLastNonceResponse(result uint64) *MessageBlockchainLastNonceResponse
NewMessageBlockchainLastNonceResponse creates a response message
type MessageBlockchainLastRandomSeedRequest ¶
type MessageBlockchainLastRandomSeedRequest struct {
Message
}
MessageBlockchainLastRandomSeedRequest represents a request message
func NewMessageBlockchainLastRandomSeedRequest ¶
func NewMessageBlockchainLastRandomSeedRequest() *MessageBlockchainLastRandomSeedRequest
NewMessageBlockchainLastRandomSeedRequest creates a request message
type MessageBlockchainLastRandomSeedResponse ¶
MessageBlockchainLastRandomSeedResponse represents a response message
func NewMessageBlockchainLastRandomSeedResponse ¶
func NewMessageBlockchainLastRandomSeedResponse(result []byte) *MessageBlockchainLastRandomSeedResponse
NewMessageBlockchainLastRandomSeedResponse creates a response message
type MessageBlockchainLastRoundRequest ¶
type MessageBlockchainLastRoundRequest struct {
Message
}
MessageBlockchainLastRoundRequest represents a request message
func NewMessageBlockchainLastRoundRequest ¶
func NewMessageBlockchainLastRoundRequest() *MessageBlockchainLastRoundRequest
NewMessageBlockchainLastRoundRequest creates a request message
type MessageBlockchainLastRoundResponse ¶
MessageBlockchainLastRoundResponse represents a response message
func NewMessageBlockchainLastRoundResponse ¶
func NewMessageBlockchainLastRoundResponse(result uint64) *MessageBlockchainLastRoundResponse
NewMessageBlockchainLastRoundResponse creates a response message
type MessageBlockchainLastTimeStampRequest ¶
type MessageBlockchainLastTimeStampRequest struct {
Message
}
MessageBlockchainLastTimeStampRequest represents a request message
func NewMessageBlockchainLastTimeStampRequest ¶
func NewMessageBlockchainLastTimeStampRequest() *MessageBlockchainLastTimeStampRequest
NewMessageBlockchainLastTimeStampRequest creates a request message
type MessageBlockchainLastTimeStampResponse ¶
MessageBlockchainLastTimeStampResponse represents a response message
func NewMessageBlockchainLastTimeStampResponse ¶
func NewMessageBlockchainLastTimeStampResponse(result uint64) *MessageBlockchainLastTimeStampResponse
NewMessageBlockchainLastTimeStampResponse creates a response message
type MessageBlockchainNewAddressRequest ¶
type MessageBlockchainNewAddressRequest struct { Message CreatorAddress []byte CreatorNonce uint64 VmType []byte }
MessageBlockchainNewAddressRequest represents a request message
func NewMessageBlockchainNewAddressRequest ¶
func NewMessageBlockchainNewAddressRequest(creatorAddress []byte, creatorNonce uint64, vmType []byte) *MessageBlockchainNewAddressRequest
NewMessageBlockchainNewAddressRequest creates a request message
type MessageBlockchainNewAddressResponse ¶
MessageBlockchainNewAddressResponse represents a response message
func NewMessageBlockchainNewAddressResponse ¶
func NewMessageBlockchainNewAddressResponse(result []byte, err error) *MessageBlockchainNewAddressResponse
NewMessageBlockchainNewAddressResponse creates a response message
type MessageBlockchainProcessBuiltInFunctionRequest ¶
type MessageBlockchainProcessBuiltInFunctionRequest struct { Message Input *vmcommon.ContractCallInput }
MessageBlockchainProcessBuiltInFunctionRequest represents a request message
func NewMessageBlockchainProcessBuiltInFunctionRequest ¶
func NewMessageBlockchainProcessBuiltInFunctionRequest(input *vmcommon.ContractCallInput) *MessageBlockchainProcessBuiltInFunctionRequest
NewMessageBlockchainProcessBuiltInFunctionRequest creates a request message
type MessageBlockchainProcessBuiltInFunctionResponse ¶
type MessageBlockchainProcessBuiltInFunctionResponse struct { Message VmOutput *SerializableVMOutput }
MessageBlockchainProcessBuiltInFunctionResponse represents a response message
func NewMessageBlockchainProcessBuiltInFunctionResponse ¶
func NewMessageBlockchainProcessBuiltInFunctionResponse(vmOutput *vmcommon.VMOutput, err error) *MessageBlockchainProcessBuiltInFunctionResponse
NewMessageBlockchainProcessBuiltInFunctionResponse creates a response message
type MessageBlockchainRevertToSnapshotRequest ¶
MessageBlockchainRevertToSnapshotRequest represents a request message
func NewMessageBlockchainRevertToSnapshotRequest ¶
func NewMessageBlockchainRevertToSnapshotRequest(snapshot int) *MessageBlockchainRevertToSnapshotRequest
NewMessageBlockchainRevertToSnapshotRequest creates a request message
type MessageBlockchainRevertToSnapshotResponse ¶
type MessageBlockchainRevertToSnapshotResponse struct {
Message
}
MessageBlockchainRevertToSnapshotResponse represents a response message
func NewMessageBlockchainRevertToSnapshotResponse ¶
func NewMessageBlockchainRevertToSnapshotResponse(err error) *MessageBlockchainRevertToSnapshotResponse
NewMessageBlockchainRevertToSnapshotResponse creates a response message
type MessageBlockchainSaveCompiledCodeRequest ¶
MessageBlockchainSaveCompiledCodeRequest represents a request message
func NewMessageBlockchainSaveCompiledCodeRequest ¶
func NewMessageBlockchainSaveCompiledCodeRequest(codeHash []byte, code []byte) *MessageBlockchainSaveCompiledCodeRequest
NewMessageBlockchainSaveCompiledCodeRequest creates a request message
type MessageBlockchainSaveCompiledCodeResponse ¶
type MessageBlockchainSaveCompiledCodeResponse struct {
Message
}
MessageBlockchainSaveCompiledCodeResponse represents a response message
func NewMessageBlockchainSaveCompiledCodeResponse ¶
func NewMessageBlockchainSaveCompiledCodeResponse() *MessageBlockchainSaveCompiledCodeResponse
NewMessageBlockchainSaveCompiledCodeResponse creates a response message
type MessageContractCallRequest ¶
type MessageContractCallRequest struct { Message CallInput *vmcommon.ContractCallInput }
MessageContractCallRequest is a call request message (from the Node)
func NewMessageContractCallRequest ¶
func NewMessageContractCallRequest(input *vmcommon.ContractCallInput) *MessageContractCallRequest
NewMessageContractCallRequest creates a MessageContractCallRequest
type MessageContractDeployRequest ¶
type MessageContractDeployRequest struct { Message CreateInput *vmcommon.ContractCreateInput }
MessageContractDeployRequest is a deploy request message (from the Node)
func NewMessageContractDeployRequest ¶
func NewMessageContractDeployRequest(input *vmcommon.ContractCreateInput) *MessageContractDeployRequest
NewMessageContractDeployRequest creates a MessageContractDeployRequest
type MessageContractResponse ¶
type MessageContractResponse struct { Message SerializableVMOutput *SerializableVMOutput }
MessageContractResponse is a contract response message (from VM)
func NewMessageContractResponse ¶
func NewMessageContractResponse(vmOutput *vmcommon.VMOutput, err error) *MessageContractResponse
NewMessageContractResponse creates a MessageContractResponse
type MessageDiagnoseWaitRequest ¶
MessageDiagnoseWaitRequest is a diagnose request message (from Node)
func NewMessageDiagnoseWaitRequest ¶
func NewMessageDiagnoseWaitRequest(milliseconds uint32) *MessageDiagnoseWaitRequest
NewMessageDiagnoseWaitRequest creates a message
type MessageDiagnoseWaitResponse ¶
type MessageDiagnoseWaitResponse struct {
Message
}
MessageDiagnoseWaitResponse is a diagnose response message (from VM)
func NewMessageDiagnoseWaitResponse ¶
func NewMessageDiagnoseWaitResponse() *MessageDiagnoseWaitResponse
NewMessageDiagnoseWaitResponse creates a message
type MessageGasScheduleChangeRequest ¶
MessageGasScheduleChangeRequest is a deploy request message (from the Node)
func NewMessageGasScheduleChangeRequest ¶
func NewMessageGasScheduleChangeRequest(gasSchedule map[string]map[string]uint64) *MessageGasScheduleChangeRequest
NewMessageGasScheduleChangeRequest creates a MessageGasScheduleChangeRequest
type MessageHandler ¶
type MessageHandler interface { GetNonce() uint32 SetNonce(nonce uint32) GetKind() MessageKind SetKind(kind MessageKind) GetError() error SetError(err error) GetKindName() string DebugString() string }
MessageHandler is a message abstraction
func CreateMessage ¶
func CreateMessage(kind MessageKind) MessageHandler
CreateMessage creates a message given its kind
type MessageInitialize ¶
type MessageInitialize struct { Message Arguments VMArguments }
MessageInitialize is a message sent by Node to initialize VM
func NewMessageInitialize ¶
func NewMessageInitialize(arguments VMArguments) *MessageInitialize
NewMessageInitialize creates a new message
type MessageKind ¶
type MessageKind uint32
MessageKind is the kind of a message (that is passed between the Node and VM)
const ( FirstKind MessageKind = iota Initialize Stop ContractDeployRequest ContractCallRequest ContractResponse GasScheduleChangeRequest GasScheduleChangeResponse BlockchainNewAddressRequest BlockchainNewAddressResponse BlockchainGetStorageDataRequest BlockchainGetStorageDataResponse BlockchainGetBlockhashRequest BlockchainGetBlockhashResponse BlockchainLastNonceRequest BlockchainLastNonceResponse BlockchainLastRoundRequest BlockchainLastRoundResponse BlockchainLastTimeStampRequest BlockchainLastTimeStampResponse BlockchainLastRandomSeedRequest BlockchainLastRandomSeedResponse BlockchainLastEpochRequest BlockchainLastEpochResponse BlockchainGetStateRootHashRequest BlockchainGetStateRootHashResponse BlockchainCurrentNonceRequest BlockchainCurrentNonceResponse BlockchainCurrentRoundRequest BlockchainCurrentRoundResponse BlockchainCurrentTimeStampRequest BlockchainCurrentTimeStampResponse BlockchainCurrentRandomSeedRequest BlockchainCurrentRandomSeedResponse BlockchainCurrentEpochRequest BlockchainCurrentEpochResponse BlockchainProcessBuiltinFunctionRequest BlockchainProcessBuiltinFunctionResponse BlockchainGetDCDTTokenRequest BlockchainGetDCDTTokenResponse BlockchainGetBuiltinFunctionNamesRequest BlockchainGetBuiltinFunctionNamesResponse BlockchainGetAllStateRequest BlockchainGetAllStateResponse BlockchainGetUserAccountRequest BlockchainGetUserAccountResponse BlockchainGetCodeRequest BlockchainGetCodeResponse BlockchainGetShardOfAddressRequest BlockchainGetShardOfAddressResponse BlockchainIsPayableRequest BlockchainIsPayableResponse BlockchainIsSmartContractRequest BlockchainIsSmartContractResponse BlockchainSaveCompiledCodeRequest BlockchainSaveCompiledCodeResponse BlockchainGetCompiledCodeRequest BlockchainGetCompiledCodeResponse DiagnoseWaitRequest DiagnoseWaitResponse VersionRequest VersionResponse BlockchainClearCompiledCodesRequest BlockchainClearCompiledCodesResponse BlockchainGetSnapshotRequest BlockchainGetSnapshotResponse BlockchainIsInterfaceNilRequest BlockchainIsInterfaceNilResponse BlockchainRevertToSnapshotRequest BlockchainRevertToSnapshotResponse BlockchainProcessBuiltInFunctionRequest BlockchainProcessBuiltInFunctionResponse UndefinedRequestOrResponse LastKind )
type MessageReplier ¶
type MessageReplier func(MessageHandler) MessageHandler
MessageReplier is a callback signature
func CreateReplySlots ¶
func CreateReplySlots(noopReplier MessageReplier) []MessageReplier
CreateReplySlots creates a slice of no-operation repliers, to be substituted with actual repliers (by message listeners)
type MessageStop ¶
type MessageStop struct {
Message
}
MessageStop is a message sent by Node to stop VM
type MessageVersionRequest ¶
type MessageVersionRequest struct {
Message
}
MessageVersionRequest is a version request message (from the Node)
func NewMessageVersionRequest ¶
func NewMessageVersionRequest() *MessageVersionRequest
NewMessageVersionRequest creates a MessageVersionRequest
type MessageVersionResponse ¶
MessageVersionResponse is a version response message (from VM)
func NewMessageVersionResponse ¶
func NewMessageVersionResponse(version string) *MessageVersionResponse
NewMessageVersionResponse creates a MessageVersionResponse
type Messenger ¶
Messenger intermediates communication (message exchange) via pipes
func NewMessenger ¶
NewMessenger creates a new messenger
func NewMessengerPipes ¶
func NewMessengerPipes(name string, reader *os.File, writer *os.File, marshalizer marshaling.Marshalizer) *Messenger
NewMessengerPipes creates a new messenger from pipes
func (*Messenger) Receive ¶
func (messenger *Messenger) Receive(timeout int) (MessageHandler, error)
Receive receives a message, reads it from the pipe
func (*Messenger) ResetDialogue ¶
func (messenger *Messenger) ResetDialogue()
ResetDialogue resets the dialogue nonce
func (*Messenger) Send ¶
func (messenger *Messenger) Send(message MessageHandler) error
Send sends a message over the pipe
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver intermediates communication (message receiving) via pipes
func NewReceiver ¶
func NewReceiver(reader *os.File, marshalizer marshaling.Marshalizer) *Receiver
NewReceiver creates a new receiver
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender intermediates communication (message sending) via pipes
func NewSender ¶
func NewSender(writer *os.File, marshalizer marshaling.Marshalizer) *Sender
NewSender creates a new sender
type SerializableMapStringBytes ¶
func NewSerializableMapStringBytes ¶
func NewSerializableMapStringBytes(data map[string][]byte) *SerializableMapStringBytes
func (*SerializableMapStringBytes) ConvertToMap ¶
func (s *SerializableMapStringBytes) ConvertToMap() map[string][]byte
type SerializableOutputAccount ¶
type SerializableOutputAccount struct { Address []byte Nonce uint64 Balance *big.Int BalanceDelta *big.Int StorageUpdates []*vmcommon.StorageUpdate Code []byte CodeMetadata []byte GasUsed uint64 Transfers []SerializableOutputTransfer CodeDeployerAddress []byte }
func NewSerializableOutputAccount ¶
func NewSerializableOutputAccount(account *vmcommon.OutputAccount) *SerializableOutputAccount
func (*SerializableOutputAccount) ConvertToOutputAccount ¶
func (a *SerializableOutputAccount) ConvertToOutputAccount() *vmcommon.OutputAccount
type SerializableVMOutput ¶
type SerializableVMOutput struct { ReturnData [][]byte ReturnCode vmcommon.ReturnCode ReturnMessage string GasRemaining uint64 GasRefund *big.Int CorrectedOutputAccounts []*SerializableOutputAccount DeletedAccounts [][]byte TouchedAccounts [][]byte Logs []*vmcommon.LogEntry }
func NewSerializableVMOutput ¶
func NewSerializableVMOutput(vmOutput *vmcommon.VMOutput) *SerializableVMOutput
func (*SerializableVMOutput) ConvertToVMOutput ¶
func (o *SerializableVMOutput) ConvertToVMOutput() *vmcommon.VMOutput
type UndefinedMessage ¶
type UndefinedMessage struct {
Message
}
UndefinedMessage is an undefined message
func NewUndefinedMessage ¶
func NewUndefinedMessage() *UndefinedMessage
NewUndefinedMessage creates an undefined message
type VMArguments ¶
type VMArguments struct { vmhost.VMHostParameters LogsMarshalizer marshaling.MarshalizerKind MessagesMarshalizer marshaling.MarshalizerKind }
VMArguments represents the initialization arguments required by VM, passed through the initialization pipe
func GetVMArguments ¶
func GetVMArguments(pipe *os.File) (*VMArguments, error)
GetVMArguments reads initialization arguments from the pipe