Skip to content

Commit f80d494

Browse files
author
fikgol
committed
Update stdlib
1 parent 8950bba commit f80d494

4 files changed

Lines changed: 438 additions & 169 deletions

File tree

examples/p2p_transfer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ def transfer(cli: client.Client, sender: local_account.LocalAccount, receipt: st
1313
seq_num = cli.get_account_sequence(
1414
"0x"+sender.account_address.bcs_serialize().hex())
1515
receipt = ReceiptIdentifier.decode(receipt)
16-
script = stdlib.encode_peer_to_peer_script_function(
16+
script = stdlib.encode_peer_to_peer_v2_script_function(
1717
token_type=utils.currency_code("STC"),
1818
payee=receipt.account_address,
19-
payee_auth_key=receipt.auth_key.data if receipt.auth_key is not None else b"",
2019
amount=amount,
2120
)
2221
node_info = cli.node_info()

starcoin/sdk/client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,15 @@ def get_block_reward(self, block_number: int):
182182
"value")[0][1].get("U128"))
183183
return (reward, author, gas_fee)
184184

185-
185+
def get_events_by_txn_hash(self,txn_hash: str):
186+
operation = {
187+
"rpc_method": "chain.get_events_by_txn_hash",
188+
"params": [txn_hash],
189+
}
190+
ret = self.execute(operation)
191+
return ret
192+
193+
186194
class RpcRequest():
187195
def __init__(self, url):
188196
self.setting = {

0 commit comments

Comments
 (0)