I tried to use py-substrate-interface to work with Crust Network and by an error message (below) it seems like py-scale-codec misses a type registry file for it.
I would like to add the type registry JSON file if you may tell me how I can get it.
$ python crust_network_place_storage_order.py
Traceback (most recent call last):
File "crust_network_place_storage_order.py", line 32, in <module>
receipt = place_storage_order(CID, SIZE)
File "crust_network_place_storage_order.py", line 13, in place_storage_order
call = crust.compose_call(
File "/home/khassanov/.cache/pypoetry/virtualenvs/crust-network-python-example-Zg3OD2BK-py3.8/lib/python3.8/site-packages/substrateinterface/base.py", line 1622, in compose_call
call.encode({
File "/home/khassanov/.cache/pypoetry/virtualenvs/crust-network-python-example-Zg3OD2BK-py3.8/lib/python3.8/site-packages/scalecodec/base.py", line 709, in encode
self.data = self.process_encode(self.value_serialized)
File "/home/khassanov/.cache/pypoetry/virtualenvs/crust-network-python-example-Zg3OD2BK-py3.8/lib/python3.8/site-packages/scalecodec/types.py", line 1483, in process_encode
arg_obj = self.runtime_config.create_scale_object(
File "/home/khassanov/.cache/pypoetry/virtualenvs/crust-network-python-example-Zg3OD2BK-py3.8/lib/python3.8/site-packages/scalecodec/base.py", line 160, in create_scale_object
raise NotImplementedError('Decoder class for "{}" not found'.format(type_string))
NotImplementedError: Decoder class for "MerkleRoot" not found
Hi there :wave:
I tried to use
py-substrate-interface
to work with Crust Network and by an error message (below) it seems likepy-scale-codec
misses a type registry file for it.I would like to add the type registry JSON file if you may tell me how I can get it.
Code sample:
crust_network_place_storage_order.py
```python import substrateinterface CID = "QmYoEcsE1aCCDPrgNfEtiLdPZBj4dncFNUvD6vZLSokeXa" SIZE = 7388569 MNEMONIC = "bottom drive obey lake curtain smoke basket hold race lonely fit walk" # well known account def place_storage_order(cid: str, size: int) -> None: keypair = substrateinterface.Keypair.create_from_mnemonic(MNEMONIC) crust = substrateinterface.SubstrateInterface( url="wss://rpc.crust.network", ) call = crust.compose_call( call_module="Market", call_function="place_storage_order", call_params=dict( cid=cid, reported_file_size=size, tips=0, memo="", ) ) extrinsic = crust.create_signed_extrinsic( call=call, keypair=keypair, ) receipt = crust.submit_extrinsic(extrinsic, wait_for_finalization=True) return receipt if __name__ == "__main__": receipt = place_storage_order(CID, SIZE) print(receipt) ```Error message: