Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- func (a *Account) AddressBytes() []byte
- func (a *Account) GetBalance() *big.Int
- func (a *Account) GetCode() []byte
- 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) IsInterfaceNil() bool
- type AccountsMap
- type BlockchainHookMock
- func (b *BlockchainHookMock) AddAccount(account *Account)
- func (b *BlockchainHookMock) AddAccounts(accounts []*Account)
- func (b *BlockchainHookMock) CurrentEpoch() uint32
- func (b *BlockchainHookMock) CurrentNonce() uint64
- func (b *BlockchainHookMock) CurrentRandomSeed() []byte
- func (b *BlockchainHookMock) CurrentRound() uint64
- func (b *BlockchainHookMock) CurrentTimeStamp() uint64
- func (b *BlockchainHookMock) GetAllState(address []byte) (map[string][]byte, error)
- func (b *BlockchainHookMock) GetBlockhash(nonce uint64) ([]byte, error)
- func (b *BlockchainHookMock) GetBuiltinFunctionNames() vmcommon.FunctionNames
- func (b *BlockchainHookMock) GetShardOfAddress(address []byte) uint32
- func (b *BlockchainHookMock) GetStateRootHash() []byte
- func (b *BlockchainHookMock) GetStorageData(address []byte, index []byte) ([]byte, error)
- func (b *BlockchainHookMock) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)
- func (b *BlockchainHookMock) IsPayable(address []byte) (bool, error)
- func (b *BlockchainHookMock) IsSmartContract(address []byte) bool
- func (b *BlockchainHookMock) LastEpoch() uint32
- func (b *BlockchainHookMock) LastNonce() uint64
- func (b *BlockchainHookMock) LastRandomSeed() []byte
- func (b *BlockchainHookMock) LastRound() uint64
- func (b *BlockchainHookMock) LastTimeStamp() uint64
- func (b *BlockchainHookMock) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
- func (b *BlockchainHookMock) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (b *BlockchainHookMock) UpdateAccounts(outputAccounts map[string]*vmcommon.OutputAccount)
- type ContractRequestBase
- type ContractResponseBase
- type CreateAccountRequest
- type CreateAccountResponse
- type DebugFacade
- func (f *DebugFacade) CreateAccount(request CreateAccountRequest) (*CreateAccountResponse, error)
- func (f *DebugFacade) DeploySmartContract(request DeployRequest) (*DeployResponse, error)
- func (f *DebugFacade) QuerySmartContract(request QueryRequest) (*QueryResponse, error)
- func (f *DebugFacade) RunSmartContract(request RunRequest) (*RunResponse, error)
- func (f *DebugFacade) UpgradeSmartContract(request UpgradeRequest) (*UpgradeResponse, error)
- type DebugServer
- type DeployRequest
- type DeployResponse
- type QueryRequest
- type QueryResponse
- type RequestBase
- type RequestError
- type ResponseBase
- type RunRequest
- type RunResponse
- type UpgradeRequest
- type UpgradeResponse
Constants ¶
const DefaultGasPrice = 200000000000
DefaultGasPrice is the default gas price for debugging
Variables ¶
var ErrAccountDoesntExist = errors.New("account does not exist")
ErrAccountDoesntExist signals an error
var ErrInvalidArgumentEncoding = errors.New("invalid contract argument encoding")
ErrInvalidArgumentEncoding signals an error
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { AddressHex string Nonce uint64 Balance *big.Int CodeHex string CodeMetadataHex string OwnerAddressHex string UserNameHex string Storage map[string]string ShardID uint32 }
Account is a debug account
func NewAccount ¶
NewAccount creates a new debug account
func (*Account) GetDeveloperReward ¶
GetDeveloperReward -
type AccountsMap ¶
AccountsMap is a map from address to account
type BlockchainHookMock ¶
type BlockchainHookMock struct { Accounts AccountsMap BlockHash []byte LNonce uint64 LRound uint64 CNonce uint64 CRound uint64 LTimeStamp uint64 CTimeStamp uint64 LRandomSeed []byte CRandomSeed []byte LEpoch uint32 CEpoch uint32 StateRootHash []byte Value *big.Int Gas uint64 LastCreatedContractAddress []byte }
BlockchainHookMock -
func NewBlockchainHookMock ¶
func NewBlockchainHookMock() *BlockchainHookMock
NewBlockchainHookMock -
func (*BlockchainHookMock) AddAccount ¶
func (b *BlockchainHookMock) AddAccount(account *Account)
AddAccount -
func (*BlockchainHookMock) AddAccounts ¶
func (b *BlockchainHookMock) AddAccounts(accounts []*Account)
AddAccounts -
func (*BlockchainHookMock) CurrentEpoch ¶
func (b *BlockchainHookMock) CurrentEpoch() uint32
CurrentEpoch -
func (*BlockchainHookMock) CurrentNonce ¶
func (b *BlockchainHookMock) CurrentNonce() uint64
CurrentNonce -
func (*BlockchainHookMock) CurrentRandomSeed ¶
func (b *BlockchainHookMock) CurrentRandomSeed() []byte
CurrentRandomSeed -
func (*BlockchainHookMock) CurrentRound ¶
func (b *BlockchainHookMock) CurrentRound() uint64
CurrentRound -
func (*BlockchainHookMock) CurrentTimeStamp ¶
func (b *BlockchainHookMock) CurrentTimeStamp() uint64
CurrentTimeStamp -
func (*BlockchainHookMock) GetAllState ¶
func (b *BlockchainHookMock) GetAllState(address []byte) (map[string][]byte, error)
GetAllState -
func (*BlockchainHookMock) GetBlockhash ¶
func (b *BlockchainHookMock) GetBlockhash(nonce uint64) ([]byte, error)
GetBlockhash -
func (*BlockchainHookMock) GetBuiltinFunctionNames ¶
func (b *BlockchainHookMock) GetBuiltinFunctionNames() vmcommon.FunctionNames
GetBuiltinFunctionNames -
func (*BlockchainHookMock) GetShardOfAddress ¶
func (b *BlockchainHookMock) GetShardOfAddress(address []byte) uint32
GetShardOfAddress -
func (*BlockchainHookMock) GetStateRootHash ¶
func (b *BlockchainHookMock) GetStateRootHash() []byte
GetStateRootHash -
func (*BlockchainHookMock) GetStorageData ¶
func (b *BlockchainHookMock) GetStorageData(address []byte, index []byte) ([]byte, error)
GetStorageData -
func (*BlockchainHookMock) GetUserAccount ¶
func (b *BlockchainHookMock) GetUserAccount(address []byte) (vmcommon.UserAccountHandler, error)
GetUserAccount -
func (*BlockchainHookMock) IsPayable ¶ added in v0.3.30
func (b *BlockchainHookMock) IsPayable(address []byte) (bool, error)
IsSmartContract -
func (*BlockchainHookMock) IsSmartContract ¶
func (b *BlockchainHookMock) IsSmartContract(address []byte) bool
IsSmartContract -
func (*BlockchainHookMock) LastRandomSeed ¶
func (b *BlockchainHookMock) LastRandomSeed() []byte
LastRandomSeed -
func (*BlockchainHookMock) LastTimeStamp ¶
func (b *BlockchainHookMock) LastTimeStamp() uint64
LastTimeStamp -
func (*BlockchainHookMock) NewAddress ¶
func (b *BlockchainHookMock) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
NewAddress -
func (*BlockchainHookMock) ProcessBuiltInFunction ¶
func (b *BlockchainHookMock) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
ProcessBuiltInFunction -
func (*BlockchainHookMock) UpdateAccounts ¶
func (b *BlockchainHookMock) UpdateAccounts(outputAccounts map[string]*vmcommon.OutputAccount)
UpdateAccounts -
type ContractRequestBase ¶
type ContractRequestBase struct { RequestBase ImpersonatedHex string Impersonated []byte Value string ValueAsBigInt *big.Int GasPrice uint64 GasLimit uint64 }
ContractRequestBase is a CLI / REST request message
type ContractResponseBase ¶
type ContractResponseBase struct { ResponseBase Input *vmcommon.VMInput Output *vmcommon.VMOutput ReturnCodeString string }
ContractResponseBase is a CLI / REST response message
type CreateAccountRequest ¶
type CreateAccountRequest struct { RequestBase AddressHex string Address []byte Balance string BalanceAsBigInt *big.Int Nonce uint64 }
CreateAccountRequest is a CLI / REST request message
type CreateAccountResponse ¶
type CreateAccountResponse struct {
Account *Account
}
CreateAccountResponse is a CLI / REST response message
type DebugFacade ¶
type DebugFacade struct { }
DebugFacade is the debug facade
func (*DebugFacade) CreateAccount ¶
func (f *DebugFacade) CreateAccount(request CreateAccountRequest) (*CreateAccountResponse, error)
CreateAccount creates a test account
func (*DebugFacade) DeploySmartContract ¶
func (f *DebugFacade) DeploySmartContract(request DeployRequest) (*DeployResponse, error)
DeploySmartContract deploys a smart contract
func (*DebugFacade) QuerySmartContract ¶
func (f *DebugFacade) QuerySmartContract(request QueryRequest) (*QueryResponse, error)
QuerySmartContract queries a pure function of the smart contract
func (*DebugFacade) RunSmartContract ¶
func (f *DebugFacade) RunSmartContract(request RunRequest) (*RunResponse, error)
RunSmartContract executes a smart contract function
func (*DebugFacade) UpgradeSmartContract ¶
func (f *DebugFacade) UpgradeSmartContract(request UpgradeRequest) (*UpgradeResponse, error)
UpgradeSmartContract upgrades a smart contract
type DebugServer ¶
type DebugServer struct {
// contains filtered or unexported fields
}
DebugServer is the debugging server
func NewDebugServer ¶
func NewDebugServer(facade *DebugFacade, address string) *DebugServer
NewDebugServer creates a Server object
func (*DebugServer) Start ¶
func (server *DebugServer) Start() error
StartServer starts the debugging server
type DeployRequest ¶
type DeployRequest struct { ContractRequestBase CodeHex string Code []byte CodePath string CodeMetadata string CodeMetadataBytes []byte ArgumentsHex []string Arguments [][]byte }
DeployRequest is a CLI / REST request message
type DeployResponse ¶
type DeployResponse struct { ContractResponseBase ContractAddress []byte ContractAddressHex string }
DeployResponse is a CLI / REST response message
type QueryRequest ¶
type QueryRequest struct {
RunRequest
}
QueryRequest is a CLI / REST request message
type QueryResponse ¶
type QueryResponse struct {
ContractResponseBase
}
QueryResponse is a CLI / REST response message
type RequestBase ¶
RequestBase is a CLI / REST request message
type RequestError ¶
RequestError signals an error
func NewRequestErrorInner ¶
func NewRequestErrorInner(err error) *RequestError
NewRequestErrorInner -
func NewRequestErrorMessageInner ¶
func NewRequestErrorMessageInner(message string, err error) *RequestError
NewRequestErrorMessageInner -
func (*RequestError) Error ¶
func (err *RequestError) Error() string
func (*RequestError) Unwrap ¶
func (err *RequestError) Unwrap() error
Unwrap unwraps the inner error
type ResponseBase ¶
type ResponseBase struct {
Error error
}
ResponseBase is a CLI / REST response message
type RunRequest ¶
type RunRequest struct { ContractRequestBase ContractAddressHex string ContractAddress []byte Function string ArgumentsHex []string Arguments [][]byte }
RunRequest is a CLI / REST request message
type RunResponse ¶
type RunResponse struct {
ContractResponseBase
}
RunResponse is a CLI / REST response message
type UpgradeRequest ¶
type UpgradeRequest struct { DeployRequest ContractAddressHex string ContractAddress []byte }
UpgradeRequest is a CLI / REST request message
type UpgradeResponse ¶
type UpgradeResponse struct {
ContractResponseBase
}
UpgradeResponse is a CLI / REST response message