Closed gangov closed 1 week ago
the fn get_vesting listed below fails with the following error:
get_vesting
3: [Failed Diagnostic Event (not emitted)] contract:CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDR4, topics:[log], data:["cau ght panic 'called `Result::unwrap()` on an `Err` value: ConversionError' from contract function 'Symbol(obj#217)'", CAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFCT4, CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHK3M, 100]
pub fn save_vesting(env: &Env, address: &Address, vesting_info: VestingInfo) { env.storage().persistent().set(address, &vesting_info); } pub fn get_vesting(env: &Env, address: &Address) -> Result<VestingInfo, ContractError> { let vesting_info = env.storage().persistent().get(address).unwrap_or_else(|| { log!(&env, "Vesting: Get vesting schedule: Critical error - No vesting schedule found for the given address"); panic_with_error!(env, ContractError::VestingNotFoundForAddress); }); Ok(vesting_info) }
however, when using instance() storage in feature branch of vesting contract we can access the stored value.
note to self: check the result of writing two times to persistent storage with the same key but storing different values
issue is no longer present
the fn
get_vesting
listed below fails with the following error:however, when using instance() storage in feature branch of vesting contract we can access the stored value.