0

Say i have enum:

#[pallet::error]
pub enum Error<T> {
    Error1,
    Error2,
    Error3,
}

However i realise that Error2 is in fact not in use and i can remove it. Will i have any consequence in doing so?

Since errors return as an index Error3 has gone from index 2 to 1, i worry that if errors are saved historically then you will have to use the runtime at the point of error to correctly decode the error.

Thanks in advance.

1 Answer 1

1

You can just change the error enum and then bump the spec_version. It will indeed not be backwards compatible. This is not a problem since the Metadata of signing devices can be manually updated (ie via a QR code).

i worry that if errors are saved historically then you will have to use the runtime at the point of error to correctly decode the error.

You always have to use the Metadata at that point in time to parse errors. But this applies not just to errors but also Transactions and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.