Documentation
¶
Index ¶
- Constants
- Variables
- func ContractSourceHash(source string) string
- type ContractSchema
- type Design
- func (de Design) Bytes() []byte
- func (de Design) ContractCode() string
- func (de *Design) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (de *Design) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (de Design) GenerateHash() util.Hash
- func (de Design) Hash() util.Hash
- func (de Design) IsValid([]byte) error
- func (de Design) MarshalBSON() ([]byte, error)
- func (de Design) MarshalJSON() ([]byte, error)
- type DesignBSONUnmarshaler
- type DesignJSONMarshaler
- type DesignJSONUnmarshaler
- type FunctionSchema
- type ParamSchema
- type PersistedContractSchema
- type PersistentBindingSchema
- type ResultSchema
- type StructField
- type TypeRef
- type TypeRegistry
Constants ¶
View Source
const CurrentSchemaFormatVersion = "contract-schema-format-v1"
CurrentSchemaFormatVersion identifies the on-state metadata wrapper shape. It is separate from the typed schema ruleset version and from any runtime snapshot codec version.
Variables ¶
View Source
var DesignHint = hint.MustNewHint("mitum-contract-design-v0.0.1")
Functions ¶
func ContractSourceHash ¶
Types ¶
type ContractSchema ¶
type ContractSchema struct {
PackageName string `json:"package_name" bson:"package_name"`
Mode string `json:"mode" bson:"mode"`
Types TypeRegistry `json:"types" bson:"types"`
PersistentGlobals []PersistentBindingSchema `json:"persistent_globals" bson:"persistent_globals"`
Functions []FunctionSchema `json:"functions" bson:"functions"`
}
func (ContractSchema) Bytes ¶
func (s ContractSchema) Bytes() []byte
func (ContractSchema) IsValid ¶
func (s ContractSchema) IsValid([]byte) error
type Design ¶
type Design struct {
hint.BaseHinter
// contains filtered or unexported fields
}
func (Design) ContractCode ¶
func (Design) GenerateHash ¶
func (Design) MarshalBSON ¶
func (Design) MarshalJSON ¶
type DesignBSONUnmarshaler ¶
type DesignJSONMarshaler ¶
type DesignJSONMarshaler struct {
hint.BaseHinter
ContractCode string `json:"contract_code"`
}
type DesignJSONUnmarshaler ¶
type FunctionSchema ¶
type FunctionSchema struct {
Name string `json:"name" bson:"name"`
Exported bool `json:"exported" bson:"exported"`
Params []ParamSchema `json:"params" bson:"params"`
Results []ResultSchema `json:"results" bson:"results"`
}
type ParamSchema ¶
type PersistedContractSchema ¶
type PersistedContractSchema struct {
SchemaFormatVersion string `json:"schema_format_version" bson:"schema_format_version"`
SchemaRulesetVersion string `json:"schema_ruleset_version" bson:"schema_ruleset_version"`
SourceHash string `json:"source_hash" bson:"source_hash"`
Schema ContractSchema `json:"schema" bson:"schema"`
}
func (PersistedContractSchema) Bytes ¶
func (s PersistedContractSchema) Bytes() []byte
func (PersistedContractSchema) IsValid ¶
func (s PersistedContractSchema) IsValid([]byte) error
type PersistentBindingSchema ¶
type ResultSchema ¶
type ResultSchema struct {
Type TypeRef `json:"type" bson:"type"`
}
type StructField ¶
type TypeRef ¶
type TypeRef struct {
Kind string `json:"kind" bson:"kind"`
Raw string `json:"raw,omitempty" bson:"raw,omitempty"`
Scalar string `json:"scalar,omitempty" bson:"scalar,omitempty"`
Name string `json:"name,omitempty" bson:"name,omitempty"`
Key *TypeRef `json:"key,omitempty" bson:"key,omitempty"`
Elem *TypeRef `json:"elem,omitempty" bson:"elem,omitempty"`
Fields []StructField `json:"fields,omitempty" bson:"fields,omitempty"`
}
type TypeRegistry ¶
func (TypeRegistry) Bytes ¶
func (r TypeRegistry) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.