When I issue a RGB20 asset, and import that to a Stock, I got an error:
Error: Failed query call.
Caused by: Failed query call.
The replica returned a replica error: reject code CanisterError, reject message IC0522: Canister aax3a-h4aaa-aaaaa-qaahq-cai exceeded the instruction limit for single message execution., error code Some("IC0522")
The code is very simple:
#[ic_cdk::update]
fn greet(name: String) -> String {
let beneficiary_txid =
Txid::from_hex("d6afd1233f2c3a7228ae2f07d64b2091db0d66f2e8ef169cf01217617f51b8fb").unwrap();
let beneficiary = Outpoint::new(beneficiary_txid, 1);
let contract = NonInflatableAsset::testnet("TEST", "Test asset", None, Precision::CentiMicro)
.expect("invalid contract data")
.allocate(Method::TapretFirst, beneficiary, 100_000_000_000_u64.into())
.expect("invalid allocations")
.issue_contract()
.expect("invalid contract data");
let contract_id = contract.contract_id();
// Let's create some stock - an in-memory stash and inventory around it:
let mut stock = Stock::default();
stock.import_iface(Rgb20::iface()).unwrap();
stock.import_schema(NonInflatableAsset::schema()).unwrap();
stock.import_iface_impl(NonInflatableAsset::issue_impl()).unwrap(); // this code will get IC5022 ERROR when running IC Canister
// stock.import_contract(contract, &mut DumbResolver).unwrap();
// // Reading contract state through the interface from the stock:
// let contract = stock.contract_iface_id(contract_id, Rgb20::iface().iface_id()).unwrap();
// let contract = Rgb20::from(contract);
ic_cdk::api::print(format!("Hello from IC debugger, {}, {}", name, beneficiary));
println!("Hello from WASI: {}, {}", name, beneficiary);
format!("Hello, {}, {}!", name, beneficiary)
// format!("Hello, {}, {}, Total supply: {:?}", name, beneficiary, contract.total_supply())
}
How can I increase the instruction limit to address this? or does someone have any suggestions?
i found another thread by lastmjs with IC5022
problem too
Thank you.