polkascan / py-substrate-interface

Python Substrate Interface
https://polkascan.github.io/py-substrate-interface/
Apache License 2.0
240 stars 111 forks source link

Compose call #315

Closed xakbel closed 1 year ago

xakbel commented 1 year ago

Hi. When I try to send any transaction via compose_call I get this error. Same thing when I try to look at other people's extrinsic's. I use the public rpc for hydradx. Can you help me?

substrateinterface.exceptions.SubstrateRequestException: {'code': 1002, 'message': 'Verification Error: Runtime error: Execution failed: Execution aborted due to trap: wasm trap: wasmunreachableinstruction executed\nWASM backtrace:\n\n 0: 0x39935f - <unknown>!rust_begin_unwind\n 1: 0x575c - <unknown>!core::panicking::panic_fmt::hd28c67e025192d49\n 2: 0x15b844 - <unknown>!TaggedTransactionQueue_validate_transaction\n', 'data': 'RuntimeApi("Execution failed: Execution aborted due to trap: wasm trap: wasmunreachableinstruction executed\\nWASM backtrace:\\n\\n 0: 0x39935f - <unknown>!rust_begin_unwind\\n 1: 0x575c - <unknown>!core::panicking::panic_fmt::hd28c67e025192d49\\n 2: 0x15b844 - <unknown>!TaggedTransactionQueue_validate_transaction\\n")'}

arjanz commented 1 year ago

Seems like HydraDX is not using the standard MultiAddress type for an Address but an AccountId type. At the moment, the library can't auto-detect this, so you will have to specify a type-override manually for this network:

custom_type_registry = {
    "types": {
        "Address": "AccountId"
    }
}

substrate = SubstrateInterface(
    url="wss://rpc.hydradx.cloud",
    type_registry=custom_type_registry
)

Is this working for you?

BlackCat99578 commented 1 year ago

Give me bridge

arjanz commented 1 year ago

Give me bridge

What do you mean by this?

xakbel commented 1 year ago

Is this working for you? Yes. Thanks!

arjanz commented 1 year ago

I just released a new version that has auto-detection for Address and ExtrinsicSignature types stored in the metadata, so manually specifying the Address type should not be necessary anymore: https://github.com/polkascan/py-substrate-interface/releases/tag/v1.5.0