Documentation ¶
Index ¶
- func CreateDefaultMultiSigRedeemScript(publicKeys keys.PublicKeys) ([]byte, error)
- func CreateMajorityMultiSigRedeemScript(publicKeys keys.PublicKeys) ([]byte, error)
- func CreateMultiSigRedeemScript(m int, publicKeys keys.PublicKeys) ([]byte, error)
- func ExpandParameterToEmitable(param Parameter) (interface{}, error)
- func GetDefaultHonestNodeCount(n int) int
- func GetMajorityHonestNodeCount(n int) int
- type ParamType
- func (pt *ParamType) DecodeBinary(r *io.BinReader)
- func (pt ParamType) EncodeBinary(w *io.BinWriter)
- func (pt ParamType) MarshalJSON() ([]byte, error)
- func (pt ParamType) MarshalYAML() (interface{}, error)
- func (pt ParamType) String() string
- func (pt *ParamType) UnmarshalJSON(data []byte) error
- func (pt *ParamType) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Parameter
- type ParameterPair
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultMultiSigRedeemScript ¶ added in v0.91.0
func CreateDefaultMultiSigRedeemScript(publicKeys keys.PublicKeys) ([]byte, error)
CreateDefaultMultiSigRedeemScript creates an "m out of n" type verification script using publicKeys length with the default BFT assumptions of (n - (n-1)/3) for m.
func CreateMajorityMultiSigRedeemScript ¶ added in v0.92.0
func CreateMajorityMultiSigRedeemScript(publicKeys keys.PublicKeys) ([]byte, error)
CreateMajorityMultiSigRedeemScript creates an "m out of n" type verification script using publicKeys length with m set to majority.
func CreateMultiSigRedeemScript ¶
func CreateMultiSigRedeemScript(m int, publicKeys keys.PublicKeys) ([]byte, error)
CreateMultiSigRedeemScript creates an "m out of n" type verification script where n is the length of publicKeys.
func ExpandParameterToEmitable ¶ added in v0.95.0
ExpandParameterToEmitable converts parameter to a type which can be handled as an array item by emit.Array. It correlates with the way RPC server handles FuncParams for invoke* calls inside the request.ExpandArrayIntoScript function.
func GetDefaultHonestNodeCount ¶ added in v0.92.0
GetDefaultHonestNodeCount returns minimum number of honest nodes required for network of size n.
func GetMajorityHonestNodeCount ¶ added in v0.94.0
GetMajorityHonestNodeCount returns minimum number of honest nodes required for majority-style agreement.
Types ¶
type ParamType ¶
type ParamType int
ParamType represents the Type of the smart contract parameter.
const ( UnknownType ParamType = -1 AnyType ParamType = 0x00 BoolType ParamType = 0x10 IntegerType ParamType = 0x11 ByteArrayType ParamType = 0x12 StringType ParamType = 0x13 Hash160Type ParamType = 0x14 Hash256Type ParamType = 0x15 PublicKeyType ParamType = 0x16 SignatureType ParamType = 0x17 ArrayType ParamType = 0x20 MapType ParamType = 0x22 InteropInterfaceType ParamType = 0x30 VoidType ParamType = 0xff )
A list of supported smart contract parameter types.
func ConvertToParamType ¶ added in v0.93.0
ConvertToParamType converts provided value to parameter type if it's a valid type.
func ParseParamType ¶
ParseParamType is a user-friendly string to ParamType converter, it's case-insensitive and makes the following conversions:
signature -> SignatureType bool, boolean -> BoolType int, integer -> IntegerType hash160 -> Hash160Type hash256 -> Hash256Type bytes, bytearray, filebytes -> ByteArrayType key, publickey -> PublicKeyType string -> StringType array, struct -> ArrayType map -> MapType interopinterface -> InteropInterfaceType void -> VoidType
anything else generates an error.
func (*ParamType) DecodeBinary ¶
DecodeBinary implements io.Serializable interface.
func (ParamType) EncodeBinary ¶
EncodeBinary implements io.Serializable interface.
func (ParamType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (ParamType) MarshalYAML ¶
MarshalYAML implements the YAML Marshaler interface.
func (*ParamType) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface.
func (*ParamType) UnmarshalYAML ¶
UnmarshalYAML implements the YAML Unmarshaler interface.
type Parameter ¶
type Parameter struct { // Type of the parameter. Type ParamType `json:"type"` // The actual value of the parameter. Value interface{} `json:"value"` }
Parameter represents a smart contract parameter.
func NewParameter ¶
NewParameter returns a Parameter with proper initialized Value of the given ParamType.
func NewParameterFromString ¶
NewParameterFromString returns a new Parameter initialized from the given string in neo-go-specific format. It is intended to be used in user-facing interfaces and has some heuristics in it to simplify parameter passing. Exact syntax is documented in the cli documentation.
func ParameterFromStackItem ¶ added in v0.90.0
ParameterFromStackItem converts stackitem.Item to Parameter.
func (*Parameter) DecodeBinary ¶ added in v0.75.0
DecodeBinary implements io.Serializable interface.
func (*Parameter) EncodeBinary ¶ added in v0.75.0
EncodeBinary implements io.Serializable interface.
func (Parameter) MarshalJSON ¶
MarshalJSON implements Marshaler interface.
func (*Parameter) UnmarshalJSON ¶
UnmarshalJSON implements Unmarshaler interface.
type ParameterPair ¶ added in v0.75.0
ParameterPair represents key-value pair, a slice of which is stored in MapType Parameter.
func (*ParameterPair) DecodeBinary ¶ added in v0.75.0
func (p *ParameterPair) DecodeBinary(r *io.BinReader)
DecodeBinary implements io.Serializable interface.
func (*ParameterPair) EncodeBinary ¶ added in v0.75.0
func (p *ParameterPair) EncodeBinary(w *io.BinWriter)
EncodeBinary implements io.Serializable interface.
Directories ¶
Path | Synopsis |
---|---|
standard
Package standard contains interfaces for well-defined standards and function for checking if arbitrary manifest complies with them.
|
Package standard contains interfaces for well-defined standards and function for checking if arbitrary manifest complies with them. |