Skip to content

Commit

Permalink
Release 0.61.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankC01 committed May 26, 2024
1 parent 24e1990 commit cf1e36e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
13 changes: 7 additions & 6 deletions pgql_s_ptb.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def transaction_inspect(txb: SuiTransaction):
print(raw_kind.to_json(indent=2))
# Execute the dry run
handle_result(
txb.client.execute_query(
with_query_node=qn.DryRunTransactionKind(
txb.client.execute_query_node(
with_node=qn.DryRunTransactionKind(
tx_bytestr=base64.b64encode(raw_kind.serialize()).decode()
)
)
Expand Down Expand Up @@ -153,14 +153,14 @@ def demo_tx_unstake(client: SuiGQLClient):
owner = client.config.active_address.address

skblk: pgql_type.SuiStakedCoinsGQL = handle_result(
client.execute_query(with_query_node=qn.GetDelegatedStakes(owner=owner))
client.execute_query_node(with_node=qn.GetDelegatedStakes(owner=owner))
)
# Only execute if staked coin found
if skblk.staked_coins:
txb = SuiTransaction(client=client)
txb.unstake_coin(staked_coin=skblk.staked_coins[0])
# transaction_inspect(txb)
transaction_dryrun(txb)
transaction_inspect(txb)
# transaction_dryrun(txb)
# transaction_dryrun_with_gas(
# txb,
# [
Expand Down Expand Up @@ -236,11 +236,12 @@ def demo_tx_publish(client: SuiGQLClient):
)
print(f"Schema version {client_init.schema_version}")
try:
print()
# demo_tx_split(client_init)
# demo_tx_split_equal(client_init)
# demo_tx_split_distribute(client_init)
# demo_tx_public_transfer(client_init)
demo_tx_unstake(client_init)
# demo_tx_unstake(client_init)
# demo_tx_transfer_sui(client_init)
# demo_tx_publish(client_init)
except ValueError as ve:
Expand Down
6 changes: 3 additions & 3 deletions pysui/sui/sui_pgql/pgql_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ def _qnode_pre_run(

@versionadded(version="0.60.0", reason="Support query inspection")
def query_node_to_string(
self, qnode: PGQL_QueryNode, schema_constraint: Union[str, None] = None
self, *, query_node: PGQL_QueryNode, schema_constraint: Union[str, None] = None
) -> str:
"""."""
self._qnode_owner(qnode)
return print_ast(qnode.as_document_node(self.schema))
self._qnode_owner(query_node)
return print_ast(query_node.as_document_node(self.schema))


class SuiGQLClient(BaseSuiGQLClient):
Expand Down
8 changes: 4 additions & 4 deletions pysui/sui/sui_pgql/pgql_sync_txn.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ def publish_upgrade(
modules, dependencies, digest = self._compile_source(project_path, args_list)
# Resolve upgrade cap to ObjectRead if needed
if isinstance(upgrade_cap, str):
result = self.client.execute_query(
with_query_node=qn.GetObject(object_id=upgrade_cap)
result = self.client.execute_query_node(
with_node=qn.GetObject(object_id=upgrade_cap)
)
if result.is_err():
raise ValueError(f"Validating upgrade cap: {result.result_string}")
Expand Down Expand Up @@ -693,8 +693,8 @@ def custom_upgrade(
modules, dependencies, digest = self._compile_source(project_path, args_list)
# Resolve upgrade cap to ObjectRead if needed
if isinstance(upgrade_cap, str):
result = self.client.execute_query(
with_query_node=qn.GetObject(object_id=upgrade_cap)
result = self.client.execute_query_node(
with_node=qn.GetObject(object_id=upgrade_cap)
)
if result.is_err():
raise ValueError(f"Validating upgrade cap: {result.result_string}")
Expand Down
3 changes: 3 additions & 0 deletions pysui/sui/sui_pgql/pgql_txn_argb.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def _optional_processor(
if not arg:
etr = bcs.OptionalTypeFactory.as_optional()
return etr
elif isinstance(arg, list) and arg[0] is None:
etr = bcs.OptionalTypeFactory.as_optional()
return etr

if isinstance(construct, tuple):
inner_fn, outer_fn = construct
Expand Down

0 comments on commit cf1e36e

Please sign in to comment.