fix: sigType and mhashType are int8

This commit is contained in:
Derrick Hammer 2024-03-01 01:31:22 -05:00
parent 429565562d
commit 5b7d786662
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 3 deletions

View File

@ -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")
} }