-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: SuiString does not have epoch
property (JSON RPC)
#244
Comments
You should not be using the private class which is for the SuiTransaction. Instead, in the builders package And you are correct on the SuiString not having This works now: def transaction_inspect3(
txb: SyncTransaction,
sender: Optional[SuiAddress] = None,
epoch: Optional[SuiString] = None,
):
"""."""
tx_raw = txb.build_for_inspection()
# print(tx_raw)
result = txb.client.execute(
InspectTransaction(
sender_address=sender or txb.client.config.active_address,
tx_bytes=SuiString(tx_raw),
epoch=epoch or SuiString("12"),
)
)
if result.is_ok():
# print(result.result_data)
print(result.result_data.to_json(indent=2))
else:
print(result.result_string) |
epoch
property (JSON RPC)
Yes, it's still the same error, here's the standalone code blurb:
and the full output. To note, it is clearly using
|
Yes, I added the fix in a branch and will be merging and publishing to PyPi soon |
Just to clarify. There are 2 issues:
|
So, the epoch missing on SuiString is this issue. First: def epoch_test():
cfg = SuiConfig.default_config()
client = SyncClient(cfg)
txn = SyncTransaction(client=client, initial_sender=cfg.active_address)
scoin = txn.split_coin(coin=txn.gas, amounts=[1000000000])
txn.transfer_objects(transfers=[scoin], recipient=cfg.active_address)
tx_bytes = txn.build_for_inspection()
istxn = InspectTransaction(
sender_address=cfg.active_address, tx_bytes=tx_bytes, epoch=SuiString("25")
)
res = client.execute(istxn)
print(res.result_data.to_json(indent=2)) Second: I am following up w/Mysten on this. Finally: |
Ok great, I guess we are uncovering a bunch of things from this rarely used
feature!
…On Thu, Dec 5, 2024 at 3:39 AM Frank V. Castellucci < ***@***.***> wrote:
So, the epoch missing on SuiString is this issue.
First:
The serialization error is not related to pysui as (with the fix) this
works:
def epoch_test():
cfg = SuiConfig.default_config()
client = SyncClient(cfg)
txn = SyncTransaction(client=client, initial_sender=cfg.active_address)
scoin = txn.split_coin(coin=txn.gas, amounts=[1000000000])
txn.transfer_objects(transfers=[scoin], recipient=cfg.active_address)
tx_bytes = txn.build_for_inspection()
istxn = InspectTransaction(
sender_address=cfg.active_address, tx_bytes=tx_bytes, epoch=SuiString("25")
)
res = client.execute(istxn)
print(res.result_data.to_json(indent=2))
Second:
Even though the above returns success on the inspect, the executed
transaction does not match the epoch I passed in (the above test is against
devnet by the way). I will research this with Mysten
Finally:
The serialization error is something different that may be related to the
target function you are calling.
—
Reply to this email directly, view it on GitHub
<#244 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM6CQTD5HFPDK3LCPZA3UL2EAGM5AVCNFSM6AAAAABSXCJRDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJZGYZDONBSGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Ivan
|
I confirmed with Mysten that def epoch_test():
cfg = SuiConfig.default_config()
client = SyncClient(cfg)
txn = SyncTransaction(client=client, initial_sender=cfg.active_address)
scoin = txn.split_coin(coin=txn.gas, amounts=[1000000000])
txn.transfer_objects(transfers=[scoin], recipient=cfg.active_address)
tx_bytes = txn.build_for_inspection()
istxn = InspectTransaction(sender_address=cfg.active_address, tx_bytes=tx_bytes)
res = client.execute(istxn)
print(res.result_data.to_json(indent=2))
```
Your issue, however, is still related to your move call and not pysui. I would check the arguments of the function you are calling to ensure they are corrects as well as adding any `type_arguments` it requires. |
Yea, I realized epoch doesn't actually do anything. Thanks for looking into
it!
…On Mon, Dec 9, 2024, 11:02 AM Frank V. Castellucci ***@***.***> wrote:
Closed #244 <#244> as completed.
—
Reply to this email directly, view it on GitHub
<#244 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM6CQVK7TCGMTMLGWQP2ED2EV2FZAVCNFSM6AAAAABSXCJRDWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVGU4DCMZXGUZDQNQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
When trying to call a public read-only function, dev inspect works fine without epoch params, but fails with a non null value:
sample code:
This generates an error:
It seems that the issue is that the "epoch" is defined as a string, but the SuiString is missing epoch as a key. After adding it as a key, it passes the validator, but then RPC call returns an error:
So it seems possible that it expects U64 as per RPC docs instead of String. After changing the _DebugInspectTransaction epoch type to SuiU64, and adding epoch as an property, running gets yet another error:
Any pointers would be appreciated!
The text was updated successfully, but these errors were encountered: