Skip to content

Added ExtrinsicResult interface object

Compare
Choose a tag to compare
@arjanz arjanz released this 07 Dec 14:28
· 307 commits to master since this release

ExtrinsicResult objects can be created with all existing extrinsics on-chain:

result = ExtrinsicResult(
    substrate=substrate,
    extrinsic_hash="0x56fea3010910bd8c0c97253ffe308dc13d1613b7e952e7e2028257d2b83c027a",
    block_hash="0x04fb003f8bc999eeb284aa8e74f2c6f63cf5bd5c00d0d0da4cd4d253a643e4c9"
)

print(result.is_success) # False
print(result.weight) # 359262000
print(result.total_fee_amount) # 2483332406
print(result.error_message['docs']) # [' Sender is not a sub-account.']

substrate.query() usage:

result = substrate.query(
    module='System',
    storage_function='Account',
    params=['F4xQKRUagnSGjFqafyhajLs94e7Vvzvr8ebwYJceKpr8R7T']
)

print(result.value['nonce']) #  7695
print(result.value['data']['free']) # 635278638077956496