Skip to content

Commit

Permalink
Merge pull request #176 from LedgerHQ/fbe/update_polkadot_tests
Browse files Browse the repository at this point in the history
Bump spec version for Polkadot TX craft and update method used
  • Loading branch information
fbeutin-ledger authored Feb 21, 2024
2 parents 169d416 + 0d14874 commit 255d0c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/python/apps/polkadot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from scalecodec.utils.ss58 import ss58_decode

class Method(IntEnum):
BALANCE_TRANSFER = 0x0500
BALANCE_TRANSFER_ALLOW_DEATH = 0x0500
BALANCE_FORCE_TRANSFER = 0x0502

class AccountIdLookupType(IntEnum):
Expand All @@ -35,8 +35,8 @@ def _format_amount(amount: int) -> bytes:
# Not sure what this exactly is but we don't actually care
UNKNOWN = bytes([0x85, 0x02, 0x00, 0x00])

SPEC_VERSION = 9360
TX_VERSION = 24
SPEC_VERSION = 1001000
TX_VERSION = 25

# We don't care about the block hash content
BLOCK_HASH = bytes([0x00] * 32)
Expand Down Expand Up @@ -123,7 +123,7 @@ def verify_signature(self,hex_key:bytes,signature:bytes,message:bytes) -> bool :
return True

def craft_valid_polkadot_transaction(address, send_amount, fees, memo) -> bytes:
return Method.BALANCE_TRANSFER.to_bytes(2, "big") \
return Method.BALANCE_TRANSFER_ALLOW_DEATH.to_bytes(2, "big") \
+ AccountIdLookupType.ID.to_bytes(1, "big") \
+ _polkadot_address_to_pk(address) \
+ _format_amount(send_amount) \
Expand Down

0 comments on commit 255d0c1

Please sign in to comment.