I have had two contracts (A, B), where contract a calls a function on contract b, when contract a is deployed. This works fine up to a certain point where I receive a contracts.ContractTrapped error (Usually after calling this function around 300-400 times)
When I redeploy contract B, with a new contractAddress, when I Initialize contract A with the new contractAddress, It obviously does work.
Also when I call the function that is called by contract A on contract B set_end_date
I get the same contracts.contractTrapped error. So it is definitely an issue with contract B
That said I can read everything from contract B so it is not in the tombstone state!
This is the function being called on Contract B
#[ink(message)]
pub fn set_end_date(&mut self, end_date: u64) -> Result<()> {
let caller = self.env().caller();
self.end_date.insert(caller, end_date);
Ok(())
}
I really suspect this is an issue perhaps with the amount of storage a given key can have on the contracts pallet, but was curious if anyone else has had this issue and can point me in the right direction!
Follow up
I ran a loop to see when this issue starts happening and it happens at the 408th time the function on contract b (set_end_date) is being called. I strongly suspect that this is an issue for how much storage a mapping can contain on the contracts pallet, will keep you posted!
end_date
field?