interop: add canonical type lengths as constants

Contracts need them anyway.
This commit is contained in:
Roman Khimov 2021-10-22 10:56:58 +03:00
parent 66f2bb1b03
commit e230040c2e

View file

@ -1,5 +1,25 @@
package interop
const (
// Hash160Len is the length of proper Hash160 in bytes, use it to
// sanitize input parameters.
Hash160Len = 20
// Hash256Len is the length of proper Hash256 in bytes, use it to
// sanitize input parameters.
Hash256Len = 32
// PublicKeyCompressedLen is the length of compressed public key (which
// is the most common public key type), use it to sanitize input
// parameters.
PublicKeyCompressedLen = 33
// PublicKeyUncompressedLen is the length of uncompressed public key
// (but you're not likely to ever encounter that), use it to sanitize
// input parameters.
PublicKeyUncompressedLen = 65
// SignatureLen is the length of standard signature, use it to sanitize
// input parameters.
SignatureLen = 64
)
// Signature represents 64-byte signature.
type Signature []byte