Let us suppose that you want to update an account state to include a new field.
pub struct MyState {
pub a: u8,
pub new_field: u8
}
This means that fetching and decoding the old accounts prior to the update would no longer work the way it did before. I.e. using program.accounts.MyState.all()
.
So, I was wondering, how do you go about fetching and decoding both old and new accounts?