Documentation ¶
Index ¶
- Constants
- Variables
- func BigIntToBytes_LE(value *big.Int) []byte
- func BigIntToHex_LE(value *big.Int) string
- func CompareScryptTypeSHA256(a ScryptType, b ScryptType) (bool, error)
- func CompareScryptVariableTypes(a ScryptType, b ScryptType) bool
- func ConstructAliasMap(aliasesDesc []AliasEntity) map[string]string
- func DeduceActualType(t string, genericTypes map[string]string) string
- func DeduceGenericType(t string, genericTypes []string) (map[string]string, error)
- func DropLenPrefix(val []byte) ([]byte, error)
- func EvenHexStr(hexStr string) string
- func FactorizeArrayTypeString(typeStr string) (string, []string)
- func FindCompiler() (string, error)
- func FlattenSHA256(val ScryptType) ([32]byte, error)
- func GetNameByType(t string) string
- func IsArraySameStructure(array0 Array, array1 Array) bool
- func IsArrayType(typeStr string) bool
- func IsBasicScryptType(typeStr string) bool
- func IsGenericType(t string) bool
- func IsLibrarySameStructure(lib0 Library, lib1 Library) bool
- func IsStructsSameStructure(struct0 Struct, struct1 Struct) bool
- func NumberFromBuffer(s []byte, littleEndian bool) *big.Int
- func ParseGenericType(t string) (string, []string)
- func ResolveType(typeStr string, aliases map[string]string) string
- func ReverseByteSlice(s []byte) []byte
- func ToLiteralArrayTypeInt(typeName string, arraySizes []int) string
- func ToLiteralArrayTypeStr(typeName string, arraySizes []string) string
- type ABIEntity
- type ABIEntityType
- type AliasEntity
- type Array
- func (arrayType Array) Bytes() ([]byte, error)
- func (array Array) Clone() ScryptType
- func (arrayType Array) GetTypeString() string
- func (arrayType Array) Hex() (string, error)
- func (arr Array) MarshalJSON() ([]byte, error)
- func (arrayType Array) StateBytes() ([]byte, error)
- func (arrayType Array) StateHex() (string, error)
- type Bool
- func (boolType Bool) Bytes() ([]byte, error)
- func (boolType Bool) Clone() ScryptType
- func (boolType Bool) GetTypeString() string
- func (boolType Bool) Hex() (string, error)
- func (boolType Bool) MarshalJSON() ([]byte, error)
- func (boolType Bool) StateBytes() ([]byte, error)
- func (boolType Bool) StateHex() (string, error)
- type BuildType
- type Bytes
- func (bytesType Bytes) Bytes() ([]byte, error)
- func (bytesType Bytes) Clone() ScryptType
- func (bytesType Bytes) GetTypeString() string
- func (bytesType Bytes) Hex() (string, error)
- func (bytesType Bytes) MarshalJSON() ([]byte, error)
- func (byteType Bytes) StateBytes() ([]byte, error)
- func (byteType Bytes) StateHex() (string, error)
- type CompilerResult
- type CompilerWarning
- type CompilerWrapper
- type Contract
- func (contract *Contract) EvaluatePublicFunction(functionName string) (bool, error)
- func (contract *Contract) GetCodePart() (string, error)
- func (contract *Contract) GetDataPart() (string, error)
- func (contract *Contract) GetDataPartInASM() (string, error)
- func (contract *Contract) GetDataPartInHex() (string, error)
- func (contract *Contract) GetLibraryTypeTemplate(libraryName string) (Library, error)
- func (contract *Contract) GetLockingScript() (*bscript.Script, error)
- func (contract *Contract) GetNewLockingScript(dataPart string) (*bscript.Script, error)
- func (contract *Contract) GetStates() (string, error)
- func (contract *Contract) GetStructTypeTemplate(t string) (Struct, error)
- func (contract *Contract) GetTxContext() (TxContext, error)
- func (contract *Contract) GetTypeTemplate(t string) (ScryptType, error)
- func (contract *Contract) GetUnlockingScript(functionName string) (*bscript.Script, error)
- func (contract *Contract) HasDataPart() bool
- func (contract *Contract) IsExecutionContextSet() bool
- func (contract *Contract) SetConstructorParams(params map[string]ScryptType) error
- func (contract *Contract) SetDataPartInASM(asm string)
- func (contract *Contract) SetDataPartInHex(hex string)
- func (contract *Contract) SetExecutionContext(ec ExecutionContext)
- func (contract *Contract) SetPublicFunctionParams(functionName string, params map[string]ScryptType) error
- func (contract *Contract) UpdateStateVariable(variableName string, value ScryptType) error
- func (contract *Contract) UpdateStateVariables(states map[string]ScryptType) error
- type DebugConfiguration
- type DebugLaunch
- type DescriptionFile
- type ExecutionContext
- type GenericType
- type HashedMap
- func (hashedMapType HashedMap) Bytes() ([]byte, error)
- func (hashedMapType HashedMap) Clone() ScryptType
- func (hashedMapType *HashedMap) Delete(key ScryptType) error
- func (hashedMapType HashedMap) GetKeysSorted() [][32]byte
- func (hashedMapType HashedMap) GetTypeString() string
- func (hashedMapType HashedMap) Hex() (string, error)
- func (hashedMapType HashedMap) KeyIndex(key ScryptType) (int64, error)
- func (hashedMapType HashedMap) MarshalJSON() ([]byte, error)
- func (hashedMapType HashedMap) RawBytes() ([]byte, error)
- func (hashedMapType HashedMap) RawHex() (string, error)
- func (hashedMapType *HashedMap) Set(key ScryptType, val ScryptType) error
- func (hashedMapType HashedMap) StateBytes() ([]byte, error)
- func (hashedMapType HashedMap) StateHex() (string, error)
- type HashedSet
- func (hashedSetType *HashedSet) Add(key ScryptType) error
- func (hashedSetType HashedSet) Bytes() ([]byte, error)
- func (hashedSetType HashedSet) Clone() ScryptType
- func (hashedSetType *HashedSet) Delete(key ScryptType) error
- func (hashedSetType HashedSet) GetKeysSorted() [][32]byte
- func (hashedSetType HashedSet) GetTypeString() string
- func (hashedSetType HashedSet) Hex() (string, error)
- func (hashedSetType HashedSet) KeyIndex(key ScryptType) (int64, error)
- func (hashedSetType HashedSet) MarshalJSON() ([]byte, error)
- func (hashedSetType HashedSet) RawBytes() ([]byte, error)
- func (hashedSetType HashedSet) RawHex() (string, error)
- func (hashedSetType HashedSet) StateBytes() ([]byte, error)
- func (hashedSetType HashedSet) StateHex() (string, error)
- type Int
- func (intType Int) Bytes() ([]byte, error)
- func (intType Int) Clone() ScryptType
- func (intType Int) GetTypeString() string
- func (intType Int) Hex() (string, error)
- func (intType Int) MarshalJSON() ([]byte, error)
- func (intType Int) StateBytes() ([]byte, error)
- func (intType Int) StateHex() (string, error)
- type Library
- func (libraryType Library) Bytes() ([]byte, error)
- func (l Library) Clone() ScryptType
- func (libraryType Library) GetTypeString() string
- func (libraryType Library) Hex() (string, error)
- func (libraryType Library) MarshalJSON() ([]byte, error)
- func (libraryType Library) StateBytes() ([]byte, error)
- func (libraryType Library) StateHex() (string, error)
- func (libraryType *Library) UpdatePropertyValue(propertyName string, newVal ScryptType)
- func (libraryType *Library) UpdateValue(paramName string, newVal ScryptType)
- type LibraryEntity
- type OpCodeType
- func (opCodeType OpCodeType) Bytes() ([]byte, error)
- func (opCodeType OpCodeType) Clone() ScryptType
- func (opCodeType OpCodeType) GetTypeString() string
- func (opCodeType OpCodeType) Hex() (string, error)
- func (opCodeType OpCodeType) MarshalJSON() ([]byte, error)
- func (opCodeType OpCodeType) StateBytes() ([]byte, error)
- func (opCodeType OpCodeType) StateHex() (string, error)
- type ParamEntity
- type PrivKey
- func (privKeyType PrivKey) Bytes() ([]byte, error)
- func (privKeyType PrivKey) Clone() ScryptType
- func (privKeyType PrivKey) GetTypeString() string
- func (privKeyType PrivKey) Hex() (string, error)
- func (privKeyType PrivKey) MarshalJSON() ([]byte, error)
- func (privKeyType PrivKey) StateBytes() ([]byte, error)
- func (privKeyType PrivKey) StateHex() (string, error)
- type PubKey
- func (pubKeyType PubKey) Bytes() ([]byte, error)
- func (pubKeyType PubKey) Clone() ScryptType
- func (pubKeyType PubKey) GetTypeString() string
- func (pubKeyType PubKey) Hex() (string, error)
- func (pubKeyType PubKey) MarshalJSON() ([]byte, error)
- func (pubKeyType PubKey) StateBytes() ([]byte, error)
- func (pubKeyType PubKey) StateHex() (string, error)
- type ResultsAsm
- type ResultsAst
- type Ripemd160
- func (ripemd160Type Ripemd160) Bytes() ([]byte, error)
- func (ripemd160Type Ripemd160) Clone() ScryptType
- func (ripemd160Type Ripemd160) GetTypeString() string
- func (ripemd160Type Ripemd160) Hex() (string, error)
- func (ripemd160Type Ripemd160) MarshalJSON() ([]byte, error)
- func (ripemd160Type Ripemd160) StateBytes() ([]byte, error)
- func (ripemd160Type Ripemd160) StateHex() (string, error)
- type ScryptType
- type Sha1
- func (sha1Type Sha1) Bytes() ([]byte, error)
- func (sha1Type Sha1) Clone() ScryptType
- func (sha1 Sha1) GetTypeString() string
- func (sha1Type Sha1) Hex() (string, error)
- func (sha1Type Sha1) MarshalJSON() ([]byte, error)
- func (sha1Type Sha1) StateBytes() ([]byte, error)
- func (sha1Type Sha1) StateHex() (string, error)
- type Sha256
- func (sha256Type Sha256) Bytes() ([]byte, error)
- func (sha256Type Sha256) Clone() ScryptType
- func (sha256 Sha256) GetTypeString() string
- func (sha256Type Sha256) Hex() (string, error)
- func (sha256Type Sha256) MarshalJSON() ([]byte, error)
- func (sha256Type Sha256) StateBytes() ([]byte, error)
- func (sha256Type Sha256) StateHex() (string, error)
- type Sig
- func (sigType Sig) Bytes() ([]byte, error)
- func (sigType Sig) Clone() ScryptType
- func (sigType Sig) GetTypeString() string
- func (sigType Sig) Hex() (string, error)
- func (sigType Sig) MarshalJSON() ([]byte, error)
- func (sigType Sig) StateBytes() ([]byte, error)
- func (sigType Sig) StateHex() (string, error)
- type SigHashPreimage
- func (sigHashPreimageType SigHashPreimage) Bytes() ([]byte, error)
- func (sigHashPreimageType SigHashPreimage) Clone() ScryptType
- func (sigHashPreimage SigHashPreimage) GetTypeString() string
- func (sigHashPreimageType SigHashPreimage) Hex() (string, error)
- func (sigHashPreimage SigHashPreimage) MarshalJSON() ([]byte, error)
- func (sigHashPreimageType SigHashPreimage) StateBytes() ([]byte, error)
- func (sigHashPreimageType SigHashPreimage) StateHex() (string, error)
- type SigHashType
- func (sigHashType SigHashType) Bytes() ([]byte, error)
- func (sigHashType SigHashType) Clone() ScryptType
- func (sigHashType SigHashType) GetTypeString() string
- func (sigHashType SigHashType) Hex() (string, error)
- func (sigHashType SigHashType) MarshalJSON() ([]byte, error)
- func (sigHashType SigHashType) StateBytes() ([]byte, error)
- func (sigHashType SigHashType) StateHex() (string, error)
- type StateEntity
- type StateProp
- type Struct
- func (structType Struct) Bytes() ([]byte, error)
- func (st Struct) Clone() ScryptType
- func (structType Struct) GetTypeString() string
- func (structType Struct) Hex() (string, error)
- func (structType Struct) MarshalJSON() ([]byte, error)
- func (structType Struct) StateBytes() ([]byte, error)
- func (structType Struct) StateHex() (string, error)
- func (structType *Struct) UpdateValue(fieldName string, newVal ScryptType) error
- type StructEntity
- type TxContext
Constants ¶
const ( STATE_LEN_2BYTES = 2 STATE_LEN_3BYTES = 3 STATE_LEN_4BYTES = 4 )
Variables ¶
var BASIC_SCRYPT_TYPES = map[string]bool{ "bool": true, "int": true, "bytes": true, "PrivKey": true, "PubKey": true, "Sig": true, "Ripemd160": true, "Sha1": true, "Sha256": true, "SigHashType": true, "SigHashPreimage": true, "OpCodeType": true, }
var CURRENT_CONTRACT_DESCRIPTION_VERSION = 8
var DebugModeTag = map[string]string{
"FUNC_START": "F0",
"FUNC_END": "F1",
"LOOP_START": "L0",
}
var SOURCE_REGEXP = regexp.MustCompile(`^(?P<fileIndex>-?\d+):(?P<line>\d+):(?P<col>\d+):(?P<endLine>\d+):(?P<endCol>\d+)(#(?P<tagStr>.+))?`)
var WARNING_REGEXP = regexp.MustCompile(`Warning:(\s|\n)*(?P<filePath>[^\s]+):(?P<line>\d+):(?P<column>\d+):(?P<line1>\d+):(?P<column1>\d+):*\n(?P<message>[^\n]+)\n`)
Functions ¶
func BigIntToBytes_LE ¶
func BigIntToHex_LE ¶
func CompareScryptTypeSHA256 ¶
func CompareScryptTypeSHA256(a ScryptType, b ScryptType) (bool, error)
func CompareScryptVariableTypes ¶
func CompareScryptVariableTypes(a ScryptType, b ScryptType) bool
func ConstructAliasMap ¶
func ConstructAliasMap(aliasesDesc []AliasEntity) map[string]string
Construct a map for resolving alias types from the alias section of the contract description file.
func DeduceGenericType ¶
func DropLenPrefix ¶
Drops length prefix of serialized sCrypt type.
func EvenHexStr ¶
func FactorizeArrayTypeString ¶
Factor array declaration string to array type and sizes. e.g. 'int[N][N][4]' -> ('int', ['N', 'N', '4'])
func FindCompiler ¶
func FlattenSHA256 ¶
func FlattenSHA256(val ScryptType) ([32]byte, error)
If data is Struct or a list of ScryptTypes, then hash (SHA256) every element of the flattened structure, concat the resulting hashes and hash again into a single hash. If data is a basic sCrypt type, then hash it's byte value.
func GetNameByType ¶
func IsArraySameStructure ¶
Returns true if the passed Array sCrypt types are of the same structure. Concrete values are not checked! It only recursively goes through Array and Struct types.
func IsArrayType ¶
Check if string is of an array type. e.g. "int[2]" or "int[N][3]"
func IsBasicScryptType ¶
Check if string is a basic sCrypt type. e.g. "int", "bool", "bytes" ...
func IsGenericType ¶
func IsLibrarySameStructure ¶
Returns true if the passed Library sCrypt types are of the same structure. Concrete values are not checked! It only recursively goes through Array , Library, Struct types.
func IsStructsSameStructure ¶
Returns true if the passed Struct sCrypt types are of the same structure. Concrete values are not checked! It only recursively goes through Array and Struct types.
func ParseGenericType ¶
*
* * @param type eg. HashedMap<int,int> * @param eg. ["HashedMap", ["int", "int"]}] An array generic types returned by @getGenericDeclaration * @returns {"K": "int", "V": "int"}
func ReverseByteSlice ¶
func ToLiteralArrayTypeInt ¶
Retruns array declaration string for given type name and sizes. Array sizes are passed as a slice of type []int. TODO: Change int types to *big.Int
func ToLiteralArrayTypeStr ¶
Retruns array declaration string for given type name and sizes. Array sizes are passed as a slice of type []string.
Types ¶
type ABIEntity ¶
type ABIEntity struct { Name string `json:"name"` Type ABIEntityType `json:"type"` Params []ParamEntity `json:"params"` Index int `json:"index"` }
type ABIEntityType ¶
type ABIEntityType string
const ( FUNCTION ABIEntityType = "function" CONSTRUCTOR ABIEntityType = "constructor" )
type AliasEntity ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func NewArray ¶
func NewArray(val []ScryptType) Array
func (Array) Clone ¶
func (array Array) Clone() ScryptType
func (Array) GetTypeString ¶
func (Array) MarshalJSON ¶
func (Array) StateBytes ¶
type Bool ¶
type Bool struct {
// contains filtered or unexported fields
}
func (Bool) Clone ¶
func (boolType Bool) Clone() ScryptType
func (Bool) GetTypeString ¶
func (Bool) MarshalJSON ¶
func (Bool) StateBytes ¶
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
func (Bytes) Clone ¶
func (bytesType Bytes) Clone() ScryptType
func (Bytes) GetTypeString ¶
func (Bytes) MarshalJSON ¶
func (Bytes) StateBytes ¶
type CompilerResult ¶
type CompilerResult struct { Ast map[string]interface{} // ASTs from all the compiled source files Asm []map[string]interface{} // ASM data of the compiled contract DepAst map[string]interface{} // ASTs only of dependencies Abi []ABIEntity // ABI of the contract Warnings []CompilerWarning // Warnings returned by the compiler CompilerVersion string // Version of the compiler binary used to compile the contract Contract string // Name of the compiled contract StateProps []StateEntity // state properties of the compiled contract Structs []StructEntity // Struct declarations Libraries []LibraryEntity // Library declarations Aliases []AliasEntity // Aliases used in the contract SourceFile string // URI of the contracts source file AutoTypedVars []map[string]interface{} // Variables with infered type SourceMD5 string // MD5 hash of the contracts source code RawAsm string // Raw locking script in ASM format with parameter placeholders RawHex string // Raw locking script in hexadecimal format with parameter placeholders CompilerOutAsm map[string]interface{} // Whole ASM tree, as outputed by the compiler // contains filtered or unexported fields }
func (CompilerResult) ToDesc ¶
func (compilerResult CompilerResult) ToDesc() DescriptionFile
func (CompilerResult) ToDescWSourceMap ¶
func (compilerResult CompilerResult) ToDescWSourceMap() (DescriptionFile, error)
type CompilerWarning ¶
type CompilerWrapper ¶
type CompilerWrapper struct { // Path to the scryptc compiler binary file. // If left empty the SDK will try to search for it. CompilerBin string // Location of stored compiler outputs and desc file. OutDir string Asm bool HexOut bool Debug bool Optimize bool Ast bool // If true, write desc file to OutDir. Desc bool CmdArgs string Cwd string ContractPath string }
func (*CompilerWrapper) CompileContractFile ¶
func (compilerWrapper *CompilerWrapper) CompileContractFile(contractPath string) (CompilerResult, error)
func (*CompilerWrapper) CompileContractString ¶
func (compilerWrapper *CompilerWrapper) CompileContractString(contractCode string) (CompilerResult, error)
func (*CompilerWrapper) GetCompilerVersion ¶
func (compilerWrapper *CompilerWrapper) GetCompilerVersion() (string, error)
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func NewContract ¶
func NewContract(compilerResult CompilerResult) (Contract, error)
Creates a new instance of Contract type.
func NewContractFromDesc ¶
func NewContractFromDesc(desc DescriptionFile) (Contract, error)
Creates a new instance of Contract type from the contracts description tree.
func (*Contract) EvaluatePublicFunction ¶
Evaluate a public function call locally and return whether the evaluation was successfull, meaning the public function call (unlocking script) successfully evaluated against the contract (lockingScript). Constructor parameter values and also the public function parameter values MUST be set.
func (*Contract) GetCodePart ¶
func (*Contract) GetDataPart ¶
func (*Contract) GetDataPartInASM ¶
func (*Contract) GetDataPartInHex ¶
func (*Contract) GetLibraryTypeTemplate ¶
func (*Contract) GetLockingScript ¶
func (*Contract) GetNewLockingScript ¶
func (*Contract) GetStructTypeTemplate ¶
Returns template of a specific struct type defined in the contract.
func (*Contract) GetTxContext ¶
func (*Contract) GetTypeTemplate ¶
func (contract *Contract) GetTypeTemplate(t string) (ScryptType, error)
func (*Contract) GetUnlockingScript ¶
func (*Contract) HasDataPart ¶
func (*Contract) IsExecutionContextSet ¶
Returns if the contracts execution context was already set at least once.
func (*Contract) SetConstructorParams ¶
func (contract *Contract) SetConstructorParams(params map[string]ScryptType) error
Set values for the contracts constructors parameters. The value of "params" must be a map, that maps a public function name (string) to an ScryptType object.
func (*Contract) SetDataPartInASM ¶
func (*Contract) SetDataPartInHex ¶
func (*Contract) SetExecutionContext ¶
func (contract *Contract) SetExecutionContext(ec ExecutionContext)
Set the execution context, that will be used while evaluating a contracts public function. The locking and unlocking scripts, that you wan't to evaluate can be just templates, as they will be substitued localy, while calling the EvaluatePublicFunction method.
func (*Contract) SetPublicFunctionParams ¶
func (contract *Contract) SetPublicFunctionParams(functionName string, params map[string]ScryptType) error
Set values for a specific public function parameters. The value of "params" must be a map, that maps a public function name (string) to an ScryptType object.
func (*Contract) UpdateStateVariable ¶
func (contract *Contract) UpdateStateVariable(variableName string, value ScryptType) error
func (*Contract) UpdateStateVariables ¶
func (contract *Contract) UpdateStateVariables(states map[string]ScryptType) error
type DebugConfiguration ¶
type DebugConfiguration struct { Request string `json:"request"` Type string `json:"type"` InternalConsoleOptions string `json:"internalConsoleOptions"` Name string `json:"name"` Program string `json:"program"` ConstructorArgs []ScryptType `json:"constructorArgs"` PubFunc string `json:"pubFunc"` PubFuncArgs []ScryptType `json:"pubFuncArgs"` TxContext *TxContext `json:"txContext"` }
type DebugLaunch ¶
type DebugLaunch struct { Version string `json:"version"` Configurations []DebugConfiguration `json:"configurations"` }
type DescriptionFile ¶
type DescriptionFile struct { Version int `json:"version"` CompilerVersion string `json:"compilerVersion"` Contract string `json:"contract"` Md5 string `json:"md5"` StateProps []ParamEntity `json:"stateProps"` Structs []StructEntity `json:"structs"` Libraries []LibraryEntity `json:"library"` Aliases []AliasEntity `json:"alias"` Abi []ABIEntity `json:"abi"` BuildType BuildType `json:"buildType"` File string `json:"file"` Asm string `json:"asm"` Hex string `json:"hex"` Sources []string `json:"sources"` SourceMap []string `json:"sourceMap"` }
type ExecutionContext ¶
type ExecutionContext struct { Tx *bt.Tx InputIdx int Flags scriptflag.Flag }
type GenericType ¶
type HashedMap ¶
type HashedMap struct {
// contains filtered or unexported fields
}
func NewHashedMap ¶
func NewHashedMap() HashedMap
func (HashedMap) Clone ¶
func (hashedMapType HashedMap) Clone() ScryptType
func (*HashedMap) Delete ¶
func (hashedMapType *HashedMap) Delete(key ScryptType) error
func (HashedMap) GetKeysSorted ¶
func (HashedMap) GetTypeString ¶
func (HashedMap) MarshalJSON ¶
func (*HashedMap) Set ¶
func (hashedMapType *HashedMap) Set(key ScryptType, val ScryptType) error
func (HashedMap) StateBytes ¶
type HashedSet ¶
type HashedSet struct {
// contains filtered or unexported fields
}
func NewHashedSet ¶
func NewHashedSet() HashedSet
func (*HashedSet) Add ¶
func (hashedSetType *HashedSet) Add(key ScryptType) error
func (HashedSet) Clone ¶
func (hashedSetType HashedSet) Clone() ScryptType
func (*HashedSet) Delete ¶
func (hashedSetType *HashedSet) Delete(key ScryptType) error
func (HashedSet) GetKeysSorted ¶
func (HashedSet) GetTypeString ¶
func (HashedSet) MarshalJSON ¶
func (HashedSet) StateBytes ¶
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
func (Int) Clone ¶
func (intType Int) Clone() ScryptType
func (Int) GetTypeString ¶
func (Int) MarshalJSON ¶
func (Int) StateBytes ¶
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
func (Library) Clone ¶
func (l Library) Clone() ScryptType
func (Library) GetTypeString ¶
func (Library) MarshalJSON ¶
func (Library) StateBytes ¶
func (*Library) UpdatePropertyValue ¶
func (libraryType *Library) UpdatePropertyValue(propertyName string, newVal ScryptType)
func (*Library) UpdateValue ¶
func (libraryType *Library) UpdateValue(paramName string, newVal ScryptType)
type LibraryEntity ¶
type LibraryEntity struct { Name string `json:"name"` Params []ParamEntity `json:"params"` Properties []ParamEntity `json:"properties"` GenericTypes []string `json:"genericTypes"` }
type OpCodeType ¶
type OpCodeType struct {
// contains filtered or unexported fields
}
func NewOpCodeType ¶
func NewOpCodeType(val []byte) OpCodeType
func (OpCodeType) Bytes ¶
func (opCodeType OpCodeType) Bytes() ([]byte, error)
func (OpCodeType) Clone ¶
func (opCodeType OpCodeType) Clone() ScryptType
func (OpCodeType) GetTypeString ¶
func (opCodeType OpCodeType) GetTypeString() string
func (OpCodeType) Hex ¶
func (opCodeType OpCodeType) Hex() (string, error)
func (OpCodeType) MarshalJSON ¶
func (opCodeType OpCodeType) MarshalJSON() ([]byte, error)
func (OpCodeType) StateBytes ¶
func (opCodeType OpCodeType) StateBytes() ([]byte, error)
func (OpCodeType) StateHex ¶
func (opCodeType OpCodeType) StateHex() (string, error)
type ParamEntity ¶
type PrivKey ¶
type PrivKey struct {
// contains filtered or unexported fields
}
func NewPrivKey ¶
func NewPrivKey(val *bec.PrivateKey) PrivKey
func (PrivKey) Clone ¶
func (privKeyType PrivKey) Clone() ScryptType
func (PrivKey) GetTypeString ¶
func (PrivKey) MarshalJSON ¶
func (PrivKey) StateBytes ¶
type PubKey ¶
type PubKey struct {
// contains filtered or unexported fields
}
func (PubKey) Clone ¶
func (pubKeyType PubKey) Clone() ScryptType
func (PubKey) GetTypeString ¶
func (PubKey) MarshalJSON ¶
func (PubKey) StateBytes ¶
type ResultsAsm ¶
type ResultsAst ¶
type ResultsAst struct { Ast map[string]interface{} DepAst map[string]interface{} Aliases []AliasEntity Abi []ABIEntity Structs []StructEntity Libraries []LibraryEntity StateProps []StateEntity MainContractName string }
type Ripemd160 ¶
type Ripemd160 struct {
// contains filtered or unexported fields
}
func NewPubKeyHash ¶
func NewRipemd160FromBase58 ¶
func (Ripemd160) Clone ¶
func (ripemd160Type Ripemd160) Clone() ScryptType
func (Ripemd160) GetTypeString ¶
func (Ripemd160) MarshalJSON ¶
func (Ripemd160) StateBytes ¶
type ScryptType ¶
type ScryptType interface { Hex() (string, error) Bytes() ([]byte, error) GetTypeString() string StateHex() (string, error) StateBytes() ([]byte, error) Clone() ScryptType }
func FlattenArray ¶
func FlattenArray(arr Array) []ScryptType
func FlattenData ¶
func FlattenData(val ScryptType) []ScryptType
Turns hierarchical sCrypt type into a single dimensional slice of ScryptType values.
type Sha1 ¶
type Sha1 struct {
// contains filtered or unexported fields
}
func (Sha1) Clone ¶
func (sha1Type Sha1) Clone() ScryptType
func (Sha1) GetTypeString ¶
func (Sha1) MarshalJSON ¶
func (Sha1) StateBytes ¶
type Sha256 ¶
type Sha256 struct {
// contains filtered or unexported fields
}
func (Sha256) Clone ¶
func (sha256Type Sha256) Clone() ScryptType
func (Sha256) GetTypeString ¶
func (Sha256) MarshalJSON ¶
func (Sha256) StateBytes ¶
type Sig ¶
type Sig struct {
// contains filtered or unexported fields
}
func (Sig) Clone ¶
func (sigType Sig) Clone() ScryptType
func (Sig) GetTypeString ¶
func (Sig) MarshalJSON ¶
func (Sig) StateBytes ¶
type SigHashPreimage ¶
type SigHashPreimage struct {
// contains filtered or unexported fields
}
func NewSigHashPreimage ¶
func NewSigHashPreimage(val []byte) SigHashPreimage
func (SigHashPreimage) Bytes ¶
func (sigHashPreimageType SigHashPreimage) Bytes() ([]byte, error)
func (SigHashPreimage) Clone ¶
func (sigHashPreimageType SigHashPreimage) Clone() ScryptType
func (SigHashPreimage) GetTypeString ¶
func (sigHashPreimage SigHashPreimage) GetTypeString() string
func (SigHashPreimage) Hex ¶
func (sigHashPreimageType SigHashPreimage) Hex() (string, error)
func (SigHashPreimage) MarshalJSON ¶
func (sigHashPreimage SigHashPreimage) MarshalJSON() ([]byte, error)
func (SigHashPreimage) StateBytes ¶
func (sigHashPreimageType SigHashPreimage) StateBytes() ([]byte, error)
func (SigHashPreimage) StateHex ¶
func (sigHashPreimageType SigHashPreimage) StateHex() (string, error)
type SigHashType ¶
type SigHashType struct {
// contains filtered or unexported fields
}
func NewSighHashType ¶
func NewSighHashType(val []byte) SigHashType
func (SigHashType) Bytes ¶
func (sigHashType SigHashType) Bytes() ([]byte, error)
func (SigHashType) Clone ¶
func (sigHashType SigHashType) Clone() ScryptType
func (SigHashType) GetTypeString ¶
func (sigHashType SigHashType) GetTypeString() string
func (SigHashType) Hex ¶
func (sigHashType SigHashType) Hex() (string, error)
func (SigHashType) MarshalJSON ¶
func (sigHashType SigHashType) MarshalJSON() ([]byte, error)
func (SigHashType) StateBytes ¶
func (sigHashType SigHashType) StateBytes() ([]byte, error)
func (SigHashType) StateHex ¶
func (sigHashType SigHashType) StateHex() (string, error)
type StateEntity ¶
type StateEntity = ParamEntity
type StateProp ¶
type StateProp struct { Name string TypeString string Value ScryptType }
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
func (Struct) Clone ¶
func (st Struct) Clone() ScryptType
func (Struct) GetTypeString ¶
func (Struct) MarshalJSON ¶
func (Struct) StateBytes ¶
func (*Struct) UpdateValue ¶
func (structType *Struct) UpdateValue(fieldName string, newVal ScryptType) error
type StructEntity ¶
type StructEntity struct { Name string `json:"name"` Params []ParamEntity `json:"params"` GenericTypes []string `json:"genericTypes"` }