pub enum ScriptHashType {
Data = 0,
Type = 1,
Data1 = 2,
Data2 = 4,
}
Expand description
Specifies how the script code_hash
is used to match the script code and how to run the code.
Allowed kinds: “data”, “type”, “data1” and “data2”
Refer to the section Code Locating and Upgradable Script in the RFC CKB Transaction Structure.
The hash type is split into the high 7 bits and the low 1 bit, when the low 1 bit is 1, it indicates the type, when the low 1 bit is 0, it indicates the data, and then it relies on the high 7 bits to indicate that the data actually corresponds to the version.
Variants§
Data = 0
Type “data” matches script code via cell data hash, and run the script code in v0 CKB VM.
Type = 1
Type “type” matches script code via cell type script hash.
Data1 = 2
Type “data1” matches script code via cell data hash, and run the script code in v1 CKB VM.
Data2 = 4
Type “data2” matches script code via cell data hash, and run the script code in v2 CKB VM.
Trait Implementations§
Source§impl Clone for ScriptHashType
impl Clone for ScriptHashType
Source§fn clone(&self) -> ScriptHashType
fn clone(&self) -> ScriptHashType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ScriptHashType
impl Debug for ScriptHashType
Source§impl Default for ScriptHashType
impl Default for ScriptHashType
Source§fn default() -> ScriptHashType
fn default() -> ScriptHashType
Source§impl<'de> Deserialize<'de> for ScriptHashType
impl<'de> Deserialize<'de> for ScriptHashType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ScriptHashType
impl Display for ScriptHashType
Source§impl From<ScriptHashType> for ScriptHashType
impl From<ScriptHashType> for ScriptHashType
Source§fn from(json: ScriptHashType) -> Self
fn from(json: ScriptHashType) -> Self
Source§impl From<ScriptHashType> for ScriptHashType
impl From<ScriptHashType> for ScriptHashType
Source§fn from(core: ScriptHashType) -> ScriptHashType
fn from(core: ScriptHashType) -> ScriptHashType
Source§impl Hash for ScriptHashType
impl Hash for ScriptHashType
Source§impl JsonSchema for ScriptHashType
impl JsonSchema for ScriptHashType
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more