Documentation ¶
Index ¶
- Constants
- Variables
- func DeserializeBytesVector(bz []byte) ([][]byte, error)
- func DeserializeUint64(bz []byte) (uint64, error)
- func DeserializeUint64Vector(bz []byte) ([]uint64, error)
- func SerializeBytes(bz []byte) ([]byte, error)
- func SerializeBytesVector(bz [][]byte) ([]byte, error)
- func SerializeString(str string) ([]byte, error)
- func SerializeUint64(num uint64) ([]byte, error)
- func SerializeUint64Vector(bz []uint64) ([]byte, error)
- func StringifyTypeTag(tt TypeTag) (string, error)
- func WithCheckStacklessVM() func(*TestConfig)
- func WithComputeCoverage() func(*TestConfig)
- func WithDevMode() func(*BuildConfig)
- func WithFetchDepsOnly() func(*BuildConfig)
- func WithFilter(filter string) func(*TestConfig)
- func WithForceRecompiliation() func(*BuildConfig)
- func WithGenerateABIs() func(*BuildConfig)
- func WithGenerateDocs() func(*BuildConfig)
- func WithIgnoreCompileWarnings() func(*TestConfig)
- func WithInstallDir(dir string) func(*BuildConfig)
- func WithInstructionExecutionBound(bound uint64) func(*TestConfig)
- func WithList() func(*TestConfig)
- func WithNumThreads(n uint) func(*TestConfig)
- func WithReportStatistics() func(*TestConfig)
- func WithReportStorageOnError() func(*TestConfig)
- func WithSkipFetchLatestGitDeps() func(*BuildConfig)
- func WithTestMode() func(*BuildConfig)
- func WithVerboseTestConfig() func(*TestConfig)
- type AccountAddress
- type BuildConfig
- type Coin
- type Coins
- type ContractEvent
- type EntryFunction
- type ExecutionResult
- type Identifier
- type InitiaCompilerArgument
- type InvalidRequest
- type InvalidResponse
- type Module
- type ModuleBundle
- type ModuleId
- type NoSuchContract
- type OutOfGasError
- type ResourceKey
- type Script
- type SizeDelta
- type StakingDelta
- type StructTag
- type SystemError
- type TestConfig
- type TypeTag
- type TypeTag__Address
- type TypeTag__Bool
- type TypeTag__Signer
- type TypeTag__Struct
- type TypeTag__U128
- type TypeTag__U16
- type TypeTag__U256
- type TypeTag__U32
- type TypeTag__U64
- type TypeTag__U8
- type TypeTag__Vector
- type Unknown
- type UnsupportedRequest
Constants ¶
const ( DefaultInstructionExecutionBound = 200_000 DefaultNumThreads = 8 )
Variables ¶
var NewDeserializer = bcs.NewDeserializer
var NewSerializer = bcs.NewSerializer
Functions ¶
func DeserializeBytesVector ¶
DeserializeBytesVector deserialize BCS bytes to bytes vector
func DeserializeUint64 ¶
DeserializeUint64 deserialize BCS bytes
func DeserializeUint64Vector ¶
DeserializeUint64Vector deserialize BCS bytes to bytes vector
func SerializeBytes ¶
SerializeBytes serialize bytes to BCS bytes
func SerializeBytesVector ¶
SerializeBytesVector serialize bytes vector to BCS bytes
func SerializeString ¶
SerializeString serialize string to BCS bytes
func SerializeUint64 ¶
SerializeUint64 serialize num to BCS bytes
func SerializeUint64Vector ¶
SerializeUint64Vector serialize bytes vector to BCS bytes
func StringifyTypeTag ¶
StringifyTypeTag implement .String() interface
func WithCheckStacklessVM ¶
func WithCheckStacklessVM() func(*TestConfig)
func WithComputeCoverage ¶
func WithComputeCoverage() func(*TestConfig)
func WithDevMode ¶
func WithDevMode() func(*BuildConfig)
func WithFetchDepsOnly ¶
func WithFetchDepsOnly() func(*BuildConfig)
func WithFilter ¶
func WithFilter(filter string) func(*TestConfig)
func WithForceRecompiliation ¶
func WithForceRecompiliation() func(*BuildConfig)
func WithGenerateABIs ¶
func WithGenerateABIs() func(*BuildConfig)
func WithGenerateDocs ¶
func WithGenerateDocs() func(*BuildConfig)
func WithIgnoreCompileWarnings ¶
func WithIgnoreCompileWarnings() func(*TestConfig)
func WithInstallDir ¶
func WithInstallDir(dir string) func(*BuildConfig)
func WithInstructionExecutionBound ¶
func WithInstructionExecutionBound(bound uint64) func(*TestConfig)
func WithList ¶
func WithList() func(*TestConfig)
func WithNumThreads ¶
func WithNumThreads(n uint) func(*TestConfig)
func WithReportStatistics ¶
func WithReportStatistics() func(*TestConfig)
func WithReportStorageOnError ¶
func WithReportStorageOnError() func(*TestConfig)
func WithSkipFetchLatestGitDeps ¶
func WithSkipFetchLatestGitDeps() func(*BuildConfig)
func WithTestMode ¶
func WithTestMode() func(*BuildConfig)
func WithVerboseTestConfig ¶
func WithVerboseTestConfig() func(*TestConfig)
Types ¶
type AccountAddress ¶
type AccountAddress [20]uint8
var StdAddress AccountAddress
func BcsDeserializeAccountAddress ¶
func BcsDeserializeAccountAddress(input []byte) (AccountAddress, error)
func DeserializeAccountAddress ¶
func DeserializeAccountAddress(deserializer serde.Deserializer) (AccountAddress, error)
func NewAccountAddress ¶
func NewAccountAddress(hexAddr string) (AccountAddress, error)
NewAccountAddress return AccountAddress from the hex string
func NewAccountAddressFromBytes ¶
func NewAccountAddressFromBytes(bz []byte) (AccountAddress, error)
NewAccountAddressFromBytes return AccountAddress from the bytes
func (*AccountAddress) BcsSerialize ¶
func (obj *AccountAddress) BcsSerialize() ([]byte, error)
func (AccountAddress) Bytes ¶
func (addr AccountAddress) Bytes() []byte
func (AccountAddress) Equals ¶
func (a AccountAddress) Equals(b AccountAddress) bool
func (*AccountAddress) Serialize ¶
func (obj *AccountAddress) Serialize(serializer serde.Serializer) error
func (AccountAddress) String ¶
func (addr AccountAddress) String() string
type BuildConfig ¶
type BuildConfig struct { // Compile in 'dev' mode. The 'dev-addresses' and 'dev-dependencies' fields will be used if // this flag is set. This flag is useful for development of packages that expose named // addresses that are not set to a specific value. DevMode bool // Compile in 'test' mode. The 'dev-addresses' and 'dev-dependencies' fields will be used // along with any code in the 'tests' directory. TestMode bool // Generate documentation for packages GenerateDocs bool // Generate ABIs for packages GenerateABIs bool // Installation directory for compiled artifacts. Defaults to current directory. InstallDir string // Force recompilation of all packages ForceRecompilation bool // Only fetch dependency repos to MOVE_HOME FetchDepsOnly bool // Skip fetching latest git dependencies SkipFetchLatestGitDeps bool }
BuildConfig is a configuration set to compile move package
func DefaultBuildConfig ¶
func DefaultBuildConfig() BuildConfig
DefaultBuildConfig returns with all-false set (except PackagePath which is set to current(.)) BuildConfig
func NewBuildConfig ¶
func NewBuildConfig(options ...func(*BuildConfig)) BuildConfig
NewBuildConfig returns newly create BuildConfig. unset values stays default, not unset
type Coin ¶
type Coin struct { Denom string `json:"denom"` // type, eg. "ATOM" Amount string `json:"amount"` // string encoing of decimal value, eg. "12.3456" }
Coin is a string representation of the sdk.Coin type (more portable than sdk.Int)
type Coins ¶
type Coins []Coin
Coins handles properly serializing empty amounts
func (Coins) MarshalJSON ¶
MarshalJSON ensures that we get [] for empty arrays
func (*Coins) UnmarshalJSON ¶
UnmarshalJSON ensures that we get [] for empty arrays
type ContractEvent ¶
func BcsDeserializeContractEvent ¶
func BcsDeserializeContractEvent(input []byte) (ContractEvent, error)
func DeserializeContractEvent ¶
func DeserializeContractEvent(deserializer serde.Deserializer) (ContractEvent, error)
func (*ContractEvent) BcsSerialize ¶
func (obj *ContractEvent) BcsSerialize() ([]byte, error)
func (*ContractEvent) Serialize ¶
func (obj *ContractEvent) Serialize(serializer serde.Serializer) error
type EntryFunction ¶
type EntryFunction struct { Module ModuleId Function Identifier TyArgs []TypeTag Args [][]byte }
func BcsDeserializeEntryFunction ¶
func BcsDeserializeEntryFunction(input []byte) (EntryFunction, error)
func DeserializeEntryFunction ¶
func DeserializeEntryFunction(deserializer serde.Deserializer) (EntryFunction, error)
func (*EntryFunction) BcsSerialize ¶
func (obj *EntryFunction) BcsSerialize() ([]byte, error)
func (*EntryFunction) Serialize ¶
func (obj *EntryFunction) Serialize(serializer serde.Serializer) error
type ExecutionResult ¶
type ExecutionResult struct { Result []uint8 Events []ContractEvent SizeDeltas []SizeDelta StakingDeltas []StakingDelta GasUsed uint64 }
func BcsDeserializeExecutionResult ¶
func BcsDeserializeExecutionResult(input []byte) (ExecutionResult, error)
func DeserializeExecutionResult ¶
func DeserializeExecutionResult(deserializer serde.Deserializer) (ExecutionResult, error)
func (*ExecutionResult) BcsSerialize ¶
func (obj *ExecutionResult) BcsSerialize() ([]byte, error)
func (*ExecutionResult) Serialize ¶
func (obj *ExecutionResult) Serialize(serializer serde.Serializer) error
type Identifier ¶
type Identifier string
func BcsDeserializeIdentifier ¶
func BcsDeserializeIdentifier(input []byte) (Identifier, error)
func DeserializeIdentifier ¶
func DeserializeIdentifier(deserializer serde.Deserializer) (Identifier, error)
func (*Identifier) BcsSerialize ¶
func (obj *Identifier) BcsSerialize() ([]byte, error)
func (*Identifier) Serialize ¶
func (obj *Identifier) Serialize(serializer serde.Serializer) error
type InitiaCompilerArgument ¶
type InitiaCompilerArgument struct { PackagePath string Verbose bool BuildConfig BuildConfig }
func NewInitiaCompilerArgument ¶
func NewInitiaCompilerArgument(packagePath string, verbose bool, buildConfig BuildConfig) InitiaCompilerArgument
func NewInitiaCompilerArgumentWithBuildOption ¶
func NewInitiaCompilerArgumentWithBuildOption(packagePath string, verbose bool, options ...func(*BuildConfig)) InitiaCompilerArgument
type InvalidRequest ¶
func (InvalidRequest) Error ¶
func (e InvalidRequest) Error() string
type InvalidResponse ¶
func (InvalidResponse) Error ¶
func (e InvalidResponse) Error() string
type Module ¶
type Module struct {
Code []uint8
}
func BcsDeserializeModule ¶
func DeserializeModule ¶
func DeserializeModule(deserializer serde.Deserializer) (Module, error)
func (*Module) BcsSerialize ¶
type ModuleBundle ¶
type ModuleBundle struct {
Codes []Module
}
func BcsDeserializeModuleBundle ¶
func BcsDeserializeModuleBundle(input []byte) (ModuleBundle, error)
func DeserializeModuleBundle ¶
func DeserializeModuleBundle(deserializer serde.Deserializer) (ModuleBundle, error)
func NewModuleBundle ¶
func NewModuleBundle(modules ...Module) ModuleBundle
NewModuleBundle return module bundle
func (*ModuleBundle) BcsSerialize ¶
func (obj *ModuleBundle) BcsSerialize() ([]byte, error)
func (*ModuleBundle) Serialize ¶
func (obj *ModuleBundle) Serialize(serializer serde.Serializer) error
type ModuleId ¶
type ModuleId struct { Address AccountAddress Name Identifier }
func BcsDeserializeModuleId ¶
func DeserializeModuleId ¶
func DeserializeModuleId(deserializer serde.Deserializer) (ModuleId, error)
func (*ModuleId) BcsSerialize ¶
type NoSuchContract ¶
type NoSuchContract struct {
Addr string `json:"addr,omitempty"`
}
func (NoSuchContract) Error ¶
func (e NoSuchContract) Error() string
type OutOfGasError ¶
type OutOfGasError struct{}
func (OutOfGasError) Error ¶
func (o OutOfGasError) Error() string
type ResourceKey ¶
type ResourceKey struct { Address AccountAddress Type StructTag }
func BcsDeserializeResourceKey ¶
func BcsDeserializeResourceKey(input []byte) (ResourceKey, error)
func DeserializeResourceKey ¶
func DeserializeResourceKey(deserializer serde.Deserializer) (ResourceKey, error)
func (*ResourceKey) BcsSerialize ¶
func (obj *ResourceKey) BcsSerialize() ([]byte, error)
func (*ResourceKey) Serialize ¶
func (obj *ResourceKey) Serialize(serializer serde.Serializer) error
type Script ¶
func BcsDeserializeScript ¶
func DeserializeScript ¶
func DeserializeScript(deserializer serde.Deserializer) (Script, error)
func (*Script) BcsSerialize ¶
type SizeDelta ¶
type SizeDelta struct { Address AccountAddress Amount uint64 IsDecreasing bool }
func BcsDeserializeSizeDelta ¶
func DeserializeSizeDelta ¶
func DeserializeSizeDelta(deserializer serde.Deserializer) (SizeDelta, error)
func (*SizeDelta) BcsSerialize ¶
type StakingDelta ¶
func BcsDeserializeStakingDelta ¶
func BcsDeserializeStakingDelta(input []byte) (StakingDelta, error)
func DeserializeStakingDelta ¶
func DeserializeStakingDelta(deserializer serde.Deserializer) (StakingDelta, error)
func (*StakingDelta) BcsSerialize ¶
func (obj *StakingDelta) BcsSerialize() ([]byte, error)
func (*StakingDelta) Serialize ¶
func (obj *StakingDelta) Serialize(serializer serde.Serializer) error
type StructTag ¶
type StructTag struct { Address AccountAddress Module Identifier Name Identifier TypeArgs []TypeTag }
func BcsDeserializeStructTag ¶
func DeserializeStructTag ¶
func DeserializeStructTag(deserializer serde.Deserializer) (StructTag, error)
func StructTagFromString ¶
StructTagFromString parse string to *StructTag
func (*StructTag) BcsSerialize ¶
type SystemError ¶
type SystemError struct { InvalidRequest *InvalidRequest `json:"invalid_request,omitempty"` InvalidResponse *InvalidResponse `json:"invalid_response,omitempty"` NoSuchContract *NoSuchContract `json:"no_such_contract,omitempty"` Unknown *Unknown `json:"unknown,omitempty"` UnsupportedRequest *UnsupportedRequest `json:"unsupported_request,omitempty"` }
SystemError captures all errors returned from the Rust code as SystemError. Exactly one of the fields should be set.
func ToSystemError ¶
func ToSystemError(err error) *SystemError
ToSystemError will try to convert the given error to an SystemError. This is important to returning any Go error back to Rust.
If it is already StdError, return self. If it is an error, which could be a sub-field of StdError, embed it. If it is anything else, **return nil**
This may return nil on an unknown error, whereas ToStdError will always create a valid error type.
func (SystemError) Error ¶
func (a SystemError) Error() string
type TestConfig ¶
type TestConfig struct { // Bound the number of instructions that can be executed by any one test. // set 0 to no-boundary InstructionExecutionBound uint64 // A filter string to determine which unit tests to run. A unit test will be run only if it // contains this string in its fully qualified (<addr>::<module_name>::<fn_name>) name. Filter []byte // List all tests List bool // Number of threads to use for running tests. NumThreads uint // Report test statistics at the end of testing ReportStatistics bool // Show the storage state at the end of execution of a failing test ReportStorageOnError bool // Ignore compiler's warning, and continue run tests IgnoreCompileWarnings bool // Use the stackless bytecode interpreter to run the tests and cross check its results with // the execution result from Move VM. CheckStacklessVM bool // Verbose mode VerboseMode bool // Collect coverage information for later use with the various `package coverage` subcommands ComputeCoverage bool }
TestConfig is a configuration set to test move package
func DefaultTestConfig ¶
func DefaultTestConfig() TestConfig
DefaultTestConfig returns TestConfig with default value
func NewTestConfig ¶
func NewTestConfig(options ...func(*TestConfig)) TestConfig
NewTestConfig returns newly create TestConfig. unset values stays default, not unset
type TypeTag ¶
type TypeTag interface { Serialize(serializer serde.Serializer) error BcsSerialize() ([]byte, error) // contains filtered or unexported methods }
func BcsDeserializeTypeTag ¶
func DeserializeTypeTag ¶
func DeserializeTypeTag(deserializer serde.Deserializer) (TypeTag, error)
func TypeTagFromString ¶
TypeTagFromString parse string to TypeTag
type TypeTag__Address ¶
type TypeTag__Address struct { }
func (*TypeTag__Address) BcsSerialize ¶
func (obj *TypeTag__Address) BcsSerialize() ([]byte, error)
func (*TypeTag__Address) Serialize ¶
func (obj *TypeTag__Address) Serialize(serializer serde.Serializer) error
type TypeTag__Bool ¶
type TypeTag__Bool struct { }
func (*TypeTag__Bool) BcsSerialize ¶
func (obj *TypeTag__Bool) BcsSerialize() ([]byte, error)
func (*TypeTag__Bool) Serialize ¶
func (obj *TypeTag__Bool) Serialize(serializer serde.Serializer) error
type TypeTag__Signer ¶
type TypeTag__Signer struct { }
func (*TypeTag__Signer) BcsSerialize ¶
func (obj *TypeTag__Signer) BcsSerialize() ([]byte, error)
func (*TypeTag__Signer) Serialize ¶
func (obj *TypeTag__Signer) Serialize(serializer serde.Serializer) error
type TypeTag__Struct ¶
type TypeTag__Struct struct {
Value StructTag
}
func (*TypeTag__Struct) BcsSerialize ¶
func (obj *TypeTag__Struct) BcsSerialize() ([]byte, error)
func (*TypeTag__Struct) Serialize ¶
func (obj *TypeTag__Struct) Serialize(serializer serde.Serializer) error
type TypeTag__U128 ¶
type TypeTag__U128 struct { }
func (*TypeTag__U128) BcsSerialize ¶
func (obj *TypeTag__U128) BcsSerialize() ([]byte, error)
func (*TypeTag__U128) Serialize ¶
func (obj *TypeTag__U128) Serialize(serializer serde.Serializer) error
type TypeTag__U16 ¶
type TypeTag__U16 struct { }
func (*TypeTag__U16) BcsSerialize ¶
func (obj *TypeTag__U16) BcsSerialize() ([]byte, error)
func (*TypeTag__U16) Serialize ¶
func (obj *TypeTag__U16) Serialize(serializer serde.Serializer) error
type TypeTag__U256 ¶
type TypeTag__U256 struct { }
func (*TypeTag__U256) BcsSerialize ¶
func (obj *TypeTag__U256) BcsSerialize() ([]byte, error)
func (*TypeTag__U256) Serialize ¶
func (obj *TypeTag__U256) Serialize(serializer serde.Serializer) error
type TypeTag__U32 ¶
type TypeTag__U32 struct { }
func (*TypeTag__U32) BcsSerialize ¶
func (obj *TypeTag__U32) BcsSerialize() ([]byte, error)
func (*TypeTag__U32) Serialize ¶
func (obj *TypeTag__U32) Serialize(serializer serde.Serializer) error
type TypeTag__U64 ¶
type TypeTag__U64 struct { }
func (*TypeTag__U64) BcsSerialize ¶
func (obj *TypeTag__U64) BcsSerialize() ([]byte, error)
func (*TypeTag__U64) Serialize ¶
func (obj *TypeTag__U64) Serialize(serializer serde.Serializer) error
type TypeTag__U8 ¶
type TypeTag__U8 struct { }
func (*TypeTag__U8) BcsSerialize ¶
func (obj *TypeTag__U8) BcsSerialize() ([]byte, error)
func (*TypeTag__U8) Serialize ¶
func (obj *TypeTag__U8) Serialize(serializer serde.Serializer) error
type TypeTag__Vector ¶
type TypeTag__Vector struct {
Value TypeTag
}
func (*TypeTag__Vector) BcsSerialize ¶
func (obj *TypeTag__Vector) BcsSerialize() ([]byte, error)
func (*TypeTag__Vector) Serialize ¶
func (obj *TypeTag__Vector) Serialize(serializer serde.Serializer) error
type UnsupportedRequest ¶
type UnsupportedRequest struct {
Kind string `json:"kind,omitempty"`
}
func (UnsupportedRequest) Error ¶
func (e UnsupportedRequest) Error() string