interlay / interbtc-api

interBTC TypeScript SDK
https://app.interlay.io/
Apache License 2.0
26 stars 20 forks source link

Use chain metadata for more unit tests #508

Open bvotteler opened 1 year ago

bvotteler commented 1 year ago

Some unit test register types manually. It would be better to get them dynamically.

See this example in asset-registry tests.

And this relevant discussion on a previous PR: https://github.com/interlay/interbtc-api/pull/429#discussion_r910898489

So, investigate ways and implement (where possible) more stable ways to set the types needed. Additional note: Also check out how encoding tests create types using the getTypes() utility function.

gregdhill commented 1 year ago

We already have the static types from the chain metadata so it should be possible to build these types without an API connection. However with instant-seal now enabled (https://github.com/interlay/interbtc-api/pull/578) running the tests is much easier and faster so we might consider just initializing the full API with dynamic types anyway.