fix: sigType and mhashType are int8
This commit is contained in:
parent
429565562d
commit
5b7d786662
|
@ -104,18 +104,18 @@ func (m *MediaMetadata) decodeProof(dec *msgpack.Decoder) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
for j := 0; j < len(proofData); j++ {
|
for j := 0; j < len(proofData); j++ {
|
||||||
var mhashType int
|
var mhashType int8
|
||||||
var pubkey []byte
|
var pubkey []byte
|
||||||
var signature []byte
|
var signature []byte
|
||||||
|
|
||||||
switch j {
|
switch j {
|
||||||
case 0:
|
case 0:
|
||||||
sigType := proofData[j].(int)
|
sigType := proofData[j].(int8)
|
||||||
if types.MetadataProofType(sigType) != types.MetadataProofTypeSignature {
|
if types.MetadataProofType(sigType) != types.MetadataProofTypeSignature {
|
||||||
return errors.New("Invalid proof type")
|
return errors.New("Invalid proof type")
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
mhashType = proofData[j].(int)
|
mhashType = proofData[j].(int8)
|
||||||
if types.HashType(mhashType) != types.HashTypeBlake3 {
|
if types.HashType(mhashType) != types.HashTypeBlake3 {
|
||||||
return errors.New("Invalid hash type")
|
return errors.New("Invalid hash type")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue