I have a Rust smart contract deployed to NEAR protocol, and now I want to update it and add properties for persistence. But the contract does already have state, and if calling the new version I get the error Cannot deserialize the contract state
.
Here's the updated state struct ( where I want to add another HashMap ):
#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
pub struct RepositoryPermission {
permission: HashMap<String, HashMap<String, Permission>>,
invitations: HashMap<InvitationId, Invitation>, // I want to add this HashMap
}
What is the best way to add new properties for persisting?