question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError(f'Unsupported type registry preset "{name}"')

See original GitHub issue

Hey Arjan, I have been struggling with passing my custom types file to the interface class. Do you know how I could pass the file or dictionary properly to the interface? 😃

Here is where I define the types dictionary and the Substrate interface class:

`custom_type_registry = { “types”: { “Address”: “MultiAddress”, “LookupSource”: “MultiAddress”, “Bid”: { “uuid”: “u32”, “market_uuid”: “Option<Vec<u8>>”, “asset_uuid”: “Option<Vec<u8>>”, “max_energy”: “u32”, “time_slot”: “Vec<u8>” }, “Offer”: { “uuid”: “u32”, “market_uuid”: “Option<Vec<u8>>”, “asset_uuid”: “Option<Vec<u8>>”, “energy_type”: “Vec<u8>”, “max_energy”: “u32”, “time_slot”: “Vec<u8>” }, “Match”: { “ids”: “u32”, “price”: “u32”, “energy”: “u32” } } }

class BlockChainInterface:

def __init__(self):
    self.substrate = SubstrateInterface(
        url=DEFAULT_SUBSTRATE_URL,
        address_type=TEMPLATE_NODE_ADDRESS_TYPE,
        type_registry=custom_type_registry,
        use_remote_preset=False
    )`

Here is the traceback:

Traceback (most recent call last): File "/Users/admin/Envs/d3a/bin/d3a", line 33, in <module> sys.exit(load_entry_point('d3a', 'console_scripts', 'd3a')()) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/Users/admin/github/d3a/src/d3a/d3a_core/cli.py", line 151, in run run_simulation(setup_module_name, simulation_config, None, None, None, File "/Users/admin/github/d3a/src/d3a/d3a_core/simulation.py", line 592, in run_simulation simulation = Simulation( File "/Users/admin/github/d3a/src/d3a/d3a_core/simulation.py", line 120, in __init__ self._init(**self.initial_params, redis_job_id=redis_job_id) File "/Users/admin/github/d3a/src/d3a/d3a_core/simulation.py", line 185, in _init self.bc = BlockChainInterface() File "/Users/admin/github/d3a/src/d3a/blockchain/__init__.py", line 64, in __init__ self.substrate = SubstrateInterface( File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/substrateinterface/base.py", line 450, in __init__ self.reload_type_registry(use_remote_preset=use_remote_preset) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/substrateinterface/base.py", line 2496, in reload_type_registry type_registry_preset_dict = load_type_registry_preset(self.chain.lower()) File "/Users/admin/Envs/d3a/lib/python3.8/site-packages/scalecodec/type_registry/__init__.py", line 43, in load_type_registry_preset raise ValueError(f'Unsupported type registry preset "{name}"') ValueError: Unsupported type registry preset "local testnet"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
arjanzcommented, Jul 7, 2021

Exactly, that is missing now 😃

1reaction
arjanzcommented, Jul 7, 2021

The struct format of Bid, Offer and Match is incorrect, it should be formatted like Keys

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Unsupported type registry preset · Issue #4 - GitHub
Hello, I have used this tool with Kusama and works fine, but I have tried to use it with Stafi, a Substrate based...
Read more >
How can i fix ValueError: parameters are of unsupported type in ...
I have Value Error in sql. I have Value Error in sql. I have insert command for insert to score to database but...
Read more >
Common issues and solutions - mypy 0.991 documentation
Redefinitions with incompatible types​​ Each name within a function only has a single 'declared' type. You can reuse for loop indices etc., but...
Read more >
substrateinterface API documentation - GitHub Pages
Adds a type included in the metadata (represented by an index in the type list) to the type registry and produces a type...
Read more >
winreg — Windows registry access — Python 3.11.1 ...
These functions expose the Windows registry API to Python. ... computer_name is the name of the remote computer, of the form ... The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found