Skip to content

Commit 69de59b

Browse files
authored
Merge branch 'master' into expiration_timestamp_secs
2 parents 7ac5589 + 705681c commit 69de59b

File tree

7 files changed

+444
-205
lines changed

7 files changed

+444
-205
lines changed

examples/p2p_transfer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,26 @@ def transfer(cli: client.Client, sender: local_account.LocalAccount, payee: str,
2626
sender=sender.account_address,
2727
sequence_number=seq_num,
2828
payload=script,
29-
max_gas_amount=1000000,
29+
max_gas_amount=10000000,
3030
gas_unit_price=1,
3131
gas_token_code="0x1::STC::STC",
3232
expiration_timestamp_secs=expiration_timestamp_secs,
33-
chain_id=types.ChainId(st.uint8(253)),
33+
chain_id=types.ChainId(st.uint8(251)),
3434
)
3535

3636
txn = sender.sign(raw_txn)
3737
print(cli.submit(txn))
3838

3939

4040
if __name__ == "__main__":
41-
cli = client.Client("http://halley1.seed.starcoin.org:9850")
41+
cli = client.Client("http://barnard1.seed.starcoin.org:9850")
4242
# sender
4343
private_key = Ed25519PrivateKey.from_private_bytes(bytes.fromhex(
44-
"75e9bee7e0474926cb6cfd5d4eefea4d56a4c9fdc518c8425e53aac23059f4f6"))
44+
"e424e16db235e3f3b9ef2475516c51d4c15aa5287ceb364213698bd551eab4f2"))
4545
sender = local_account.LocalAccount(private_key)
4646

4747
# reciver
48-
payee_public_key_hex = "cdf17852b92695569943b0681e3c23934c73d041eaee1190236840e70dc4a6e6"
48+
payee_public_key_hex = "a1d2f3e34563ef6e63e0d01e91bd53e9d27da758b25b01771572c240cb4f3113"
4949
pk = Ed25519PublicKey.from_public_bytes(
5050
bytes.fromhex(payee_public_key_hex))
5151
payee_auth_key = auth_key.AuthKey.from_public_key(pk)

starcoin/bcs/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from copy import copy
99
from typing import get_type_hints
1010

11-
import starcoin.serde_types as st
12-
import starcoin.serde_binary as sb
11+
from starcoin import serde_types as st
12+
from starcoin import serde_binary as sb
1313

1414
MAX_LENGTH = (1 << 31) - 1
1515
MAX_U32 = (1 << 32) - 1

starcoin/sdk/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_transaction(self, txn_hash: str) -> dict:
8484
}
8585
ret = self.execute(operation)
8686
return ret
87-
87+
8888
def get_transaction_info(self, txn_hash: str) -> dict:
8989
operation = {
9090
"rpc_method": "chain.get_transaction_info",

starcoin/serde_binary/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class BinarySerializer:
3030

3131
def __post_init__(self):
3232
self.primitive_type_serializer = {
33-
st.bool: self.serialize_bool,
33+
bool: self.serialize_bool,
3434
st.uint8: self.serialize_u8,
3535
st.uint16: self.serialize_u16,
3636
st.uint32: self.serialize_u32,
@@ -59,7 +59,7 @@ def serialize_str(self, value: str):
5959
def serialize_unit(self, value: st.unit):
6060
pass
6161

62-
def serialize_bool(self, value: st.bool):
62+
def serialize_bool(self, value: bool):
6363
self.output.write(int(value).to_bytes(1, "little", signed=False))
6464

6565
def serialize_u8(self, value: st.uint8):
@@ -140,6 +140,7 @@ def serialize_any(self, obj: typing.Any, obj_type):
140140
self.serialize_len(len(obj))
141141
for item in obj:
142142
self.serialize_any(item, item_type)
143+
143144
elif getattr(obj_type, "__origin__") == tuple: # Tuple
144145
for i in range(len(obj)):
145146
self.serialize_any(obj[i], types[i])
@@ -209,7 +210,7 @@ class BinaryDeserializer:
209210

210211
def __post_init__(self):
211212
self.primitive_type_deserializer = {
212-
st.bool: self.deserialize_bool,
213+
bool: self.deserialize_bool,
213214
st.uint8: self.deserialize_u8,
214215
st.uint16: self.deserialize_u16,
215216
st.uint32: self.deserialize_u32,
@@ -248,7 +249,7 @@ def deserialize_str(self) -> str:
248249
def deserialize_unit(self) -> st.unit:
249250
pass
250251

251-
def deserialize_bool(self) -> st.bool:
252+
def deserialize_bool(self) -> bool:
252253
b = int.from_bytes(self.read(1), byteorder="little", signed=False)
253254
if b == 0:
254255
return False

0 commit comments

Comments
 (0)