validate_blockchain_rid

function validate_blockchain_rid(blockchain_rid: byte_array, descriptor: text)(source)

Checks whether the blockchain RID has the correct size

Throws "INVALID BRID" if the RID's length is not 32 bytes.

Should be used inside other functions, and the descriptor parameter should be passed in a way that the error message is understood by the end users.

Example: validate_blockchain_rid(x"", "Chain X's RID") will throw this error: "INVALID BRID: Chain X's RID cannot be empty"

Parameters

blockchain_rid

The RID to check

descriptor

the name of the parameter for nicer error printing