@@ -243,8 +243,8 @@ def test_solana_sign_token_transfer(self):
243243 from_pubkey = self ._get_from_pubkey ()
244244 to_account = b'\x33 ' * 32 # destination token account
245245 owner = from_pubkey # token owner = signer
246- # SPL Token Transfer instruction: type =3 (LE u32 ) + amount (LE u64)
247- instr_data = struct . pack ( '<I' , 3 ) + struct .pack ('<Q' , 50000000 ) # 50M tokens
246+ # SPL Token Transfer instruction: opcode =3 (u8 ) + amount (LE u64)
247+ instr_data = bytes ([ 3 ] ) + struct .pack ('<Q' , 50000000 ) # 50M tokens
248248 raw_tx = self ._build_tx (from_pubkey , [to_account ], self .TOKEN_PROGRAM , instr_data )
249249 resp = self .client .call (messages .SolanaSignTx (
250250 address_n = parse_path ("m/44'/501'/0'/0'" ), raw_tx = raw_tx ))
@@ -256,8 +256,8 @@ def test_solana_sign_token_approve(self):
256256 self .setup_mnemonic_allallall ()
257257 from_pubkey = self ._get_from_pubkey ()
258258 delegate = b'\x44 ' * 32
259- # SPL Token Approve: type =4 (LE u32 ) + amount (LE u64)
260- instr_data = struct . pack ( '<I' , 4 ) + struct .pack ('<Q' , 100000000 )
259+ # SPL Token Approve: opcode =4 (u8 ) + amount (LE u64)
260+ instr_data = bytes ([ 4 ] ) + struct .pack ('<Q' , 100000000 )
261261 raw_tx = self ._build_tx (from_pubkey , [delegate ], self .TOKEN_PROGRAM , instr_data )
262262 resp = self .client .call (messages .SolanaSignTx (
263263 address_n = parse_path ("m/44'/501'/0'/0'" ), raw_tx = raw_tx ))
0 commit comments