sui
sui copied to clipboard
Error is threw `Object deleted at reference` when the API `sui_getCoins` be called or excute anything with gas in sui client
Error is threw Object deleted at reference when the API sui_getCoins
{
"jsonrpc":"2.0",
"method":"sui_getCoins",
"params": [
"0xa3b5b159913d8c3b6032b00055232f080ef57f96",
"0x2::sui::SUI",
null,
null
],
"id":1
}
and the output is
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Sui error: Object deleted at reference (0x91ad72367bc052bf24146a06e2d80bd801bff937, SequenceNumber(67), o#5858585858585858585858585858585858585858585858585858585858585858)."
},
"id": 1
}
I also get the same error in sui client(0.20.0) when I'm trying to splite coin,publish module or sui move call.
If I specify a chosen suicoin as gas to pay for this transaction, the transaction would be successful.
Expected Result
The result should be my current suiCoins instead of an error of my deleted object. I once put this object in a share_object, and it shouldn't be searched in my account or client.
Attach example code to reproduce this error:
module ds::test {
use sui::object::UID;
use sui::tx_context::{TxContext};
use sui::transfer;
use sui::object;
use std::option;
use std::option::Option;
struct Box<T: store> has key, store {
id: UID,
reward: Option<T>,
}
public entry fun lock<T: store>(reward: T, ctx: &mut TxContext) {
let uid = object::new(ctx);
transfer::share_object(Box {
id: uid,
reward: option::some(reward),
});
}
}
steps:
- build and publish:
sui client publish . --gas-budget 30000 - call lock coin:
sui client call --function lock --module test --package 0x8f9998f8eee2cbeb5b73101f08f4254f4eaeebf4 --args 0x0369e2bf0073cc4e6f1676c2e1947007fd46377b --type-args "0x2::coin::Coin<0x2::sui::SUI>" --gas-budget 3000
then this error will occur if trying to call sui_getCoins or do other operations.