Skip to content

Commit

Permalink
Extrinsic encoding issues (#325)
Browse files Browse the repository at this point in the history
For some networks with alternative nested nonce- or signature types
  • Loading branch information
arjanz authored Feb 28, 2023
1 parent f907dc9 commit de00d7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

This library specializes in interfacing with a [Substrate](https://substrate.io) node; querying storage, composing extrinsics, [SCALE](getting-started.md#scale) encoding/decoding and providing additional convenience methods to deal with the features and metadata of the Substrate runtime.
This library specializes in interfacing with a [Substrate](https://substrate.io) node; querying storage,
composing extrinsics, [SCALE](getting-started/common-concepts/#scale) encoding/decoding and providing additional convenience methods
to deal with the features and metadata of the Substrate runtime.

## Getting started
About [installation, initialization](/getting-started/installation/) and useful background information.
About [installation, initialization](getting-started/installation/) and useful background information.

## Usage
[Overview of available functionality](/usage/query-storage) and how to use it.
[Overview of available functionality](usage/query-storage/) and how to use it.

## Function Reference
[Extensive reference](/reference/base) of functions and classes in the library.
[Extensive reference](reference/base/) of functions and classes in the library.

## Examples
[Various code snippets](examples.md) for common use-cases.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ eth_utils>=1.3.0,<3
pycryptodome>=3.11.0,<4
PyNaCl>=1.0.1,<2

scalecodec>=1.2.1,<1.3
scalecodec>=1.2.2,<1.3
py-sr25519-bindings>=0.2.0,<1
py-ed25519-zebra-bindings>=1.0,<2
py-bip39-bindings>=0.1.9,<1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
'eth_utils>=1.3.0,<3',
'pycryptodome>=3.11.0,<4',
'PyNaCl>=1.0.1,<2',
'scalecodec>=1.2.1,<1.3',
'scalecodec>=1.2.2,<1.3',
'py-sr25519-bindings>=0.2.0,<1',
'py-ed25519-zebra-bindings>=1.0,<2',
'py-bip39-bindings>=0.1.9,<1'
Expand Down
6 changes: 3 additions & 3 deletions substrateinterface/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1846,8 +1846,8 @@ def generate_signature_payload(self, call: GenericCall, era=None, nonce: int = 0

if include_call_length:

length_obj = self.runtime_config.get_decoder_class('Bytes')
call_data = str(length_obj().encode(str(call.data)))
length_obj = self.runtime_config.create_scale_object('Bytes')
call_data = str(length_obj.encode(str(call.data)))

else:
call_data = str(call.data)
Expand Down Expand Up @@ -1956,7 +1956,7 @@ def create_signed_extrinsic(self, call: GenericCall, keypair: Keypair, era: dict

# Check if ExtrinsicSignature is MultiSignature, otherwise omit signature_version
signature_cls = self.runtime_config.get_decoder_class("ExtrinsicSignature")
if signature_cls is self.runtime_config.get_decoder_class('sp_runtime::MultiSignature'):
if issubclass(signature_cls, self.runtime_config.get_decoder_class('Enum')):
value['signature_version'] = signature_version

extrinsic.encode(value)
Expand Down

0 comments on commit de00d7f

Please sign in to comment.