diff --git a/types/chain.go b/types/chain.go index 4e3a301b..f92ca0d3 100644 --- a/types/chain.go +++ b/types/chain.go @@ -14,7 +14,7 @@ type TransactionStatus string const ( HashTypeData ScriptHashType = "data" HashTypeData1 ScriptHashType = "data1" - HashTypeData2 ScriptHashType = "data2" + HashTypeData2 ScriptHashType = "data2" HashTypeType ScriptHashType = "type" DepTypeCode DepType = "code" diff --git a/types/molecule.go b/types/molecule.go index 93561be7..c67b54d1 100644 --- a/types/molecule.go +++ b/types/molecule.go @@ -377,8 +377,8 @@ func (t ScriptHashType) Pack() *molecule.Byte { b = 0x01 case HashTypeData1: b = 0x02 - case HashTypeData2: - b = 0x04 + case HashTypeData2: + b = 0x04 default: return nil } diff --git a/types/serialize.go b/types/serialize.go index 01bb2a72..6e8b7998 100644 --- a/types/serialize.go +++ b/types/serialize.go @@ -66,8 +66,8 @@ func SerializeHashTypeByte(hashType ScriptHashType) (byte, error) { return 0x01, nil case HashTypeData1: return 0x02, nil - case HashTypeData2: - return 0x04, nil + case HashTypeData2: + return 0x04, nil default: return 0, errors.New(string("unknown hash type " + hashType)) } @@ -81,8 +81,8 @@ func DeserializeHashTypeByte(hashType byte) (ScriptHashType, error) { return HashTypeType, nil case 0x02: return HashTypeData1, nil - case 0x04: - return HashTypeData2, nil + case 0x04: + return HashTypeData2, nil default: return "", errors.New(fmt.Sprintf("invalid script hash_type: %x", hashType)) }