@@ -97,12 +97,12 @@ def public_key_bytes(public_key: ed25519.Ed25519PublicKey) -> bytes:
9797def currency_code (code : str ) -> starcoin_types .TypeTag :
9898 """converts currency code string to starcoin_types.TypeTag"""
9999 if isinstance (code , str ):
100- return starcoin_types .TypeTag__Struct (
100+ return starcoin_types .TypeTag__struct (
101101 value = starcoin_types .StructTag (
102102 address = account_address (CORE_CODE_ADDRESS ),
103103 module = starcoin_types .Identifier (code ),
104104 name = starcoin_types .Identifier (code ),
105- type_params = [],
105+ type_args = [],
106106 )
107107 )
108108
@@ -112,12 +112,12 @@ def currency_code(code: str) -> starcoin_types.TypeTag:
112112def currency_user_code (address : str , code : str ) -> starcoin_types .TypeTag :
113113 """converts currency code string to starcoin_types.TypeTag"""
114114 if isinstance (code , str ):
115- return starcoin_types .TypeTag__Struct (
115+ return starcoin_types .TypeTag__struct (
116116 value = starcoin_types .StructTag (
117117 address = account_address (address ),
118118 module = starcoin_types .Identifier (code ),
119119 name = starcoin_types .Identifier (code ),
120- type_params = [],
120+ type_args = [],
121121 )
122122 )
123123
@@ -127,15 +127,15 @@ def currency_user_code(address: str, code: str) -> starcoin_types.TypeTag:
127127def type_tag_to_str (code : starcoin_types .TypeTag ) -> str :
128128 """converts currency code TypeTag into string"""
129129
130- if isinstance (code , starcoin_types .TypeTag__Struct ):
131- if isinstance (self , TypeTag__Struct ):
130+ if isinstance (code , starcoin_types .TypeTag__struct ):
131+ if isinstance (self , TypeTag__struct ):
132132 return self .value .name .value
133133 raise TypeError (f"unknown currency code type: { self } " )
134134 raise TypeError (f"unknown currency code type: { code } " )
135135
136136
137137def create_signed_transaction (
138- txn : starcoin_types .RawTransaction , public_key : bytes , signature : bytes
138+ txn : starcoin_types .RawUserTransaction , public_key : bytes , signature : bytes
139139) -> starcoin_types .SignedUserTransaction :
140140 """create single signed `starcoin_types.SignedTransaction`"""
141141 return starcoin_types .SignedUserTransaction (
@@ -147,8 +147,8 @@ def create_signed_transaction(
147147 )
148148
149149
150- def raw_transaction_signing_msg (txn : starcoin_types .RawTransaction ) -> bytes :
151- """create signing message from given `starcoin_types.RawTransaction `"""
150+ def raw_transaction_signing_msg (txn : starcoin_types .RawUserTransaction ) -> bytes :
151+ """create signing message from given `starcoin_types.RawUserTransaction `"""
152152 return starcoin_hash_seed (b"RawUserTransaction" ) + txn .bcs_serialize ()
153153
154154
@@ -188,7 +188,7 @@ def verify_signed_message(signed_message_hex: str) -> starcoin_types.SignedMessa
188188 public_key = signed_message .authenticator .public_key .value
189189 signature = signed_message .authenticator .signature .value
190190 data = starcoin_hash_seed (b"SigningMessage" ) + \
191- signed_message .signing_message .bcs_serialize ()
191+ signed_message .message .bcs_serialize ()
192192 ed = ed25519 .Ed25519PublicKey .from_public_bytes (public_key )
193193 ed .verify (signature , data )
194194 except Exception as e :
0 commit comments