New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get account info with predefined generic call #145
Comments
This was because of a missing passthrough of metadata in A fix is release in https://github.com/polkascan/py-scale-codec/releases/tag/v1.0.12 |
Sorry, but I'm afraid that this release does not fix the issue described. Scalecodec v1.0.12 does produce the same exact traceback |
I guess you didn't create the call using s = SubstrateInterface('wss://westend-rpc.polkadot.io')
keypair = Keypair.create_from_uri('//Alice')
call = s.compose_call(
call_module='Balances',
call_function='transfer',
call_params={
'dest': '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
'value': 1 * 10**15
}
)
print(s.get_payment_info(call=call, keypair=keypair)) |
Here is a more detailed example: https://github.com/polkascan/py-substrate-interface/blob/master/examples/balance_transfer.py |
Ok, obviously it's not a bug. I just have been misled by the interface, which does not enforce me to call one method after another. |
Let's assume that I have an instance of
GenericCall
(balances.Transfer
), obtained by some other means (e.g. via a different SubstrateInterface instance).Now I want to use it to get the payment info. The overall code looks similar to this:
The code throws the following exception:
As far as I see, this is a kind of dynamic initialization, which fails to work, when I call
get_payment_info
method first.Is it a bug? If no, how can I work this around?
The use case is pretty simple. I see, that I can't use
SubstrateInterface
in a concurrent way because this class has a state (see #82 (comment) ). So I maintain a pool of SubstrateInterface instances with pre-defined lock for each to allow this abstraction work in a parallel way.The text was updated successfully, but these errors were encountered: