Closed KarishmaBothara closed 3 years ago
We'd want some tests on getMetadata to check what happens if you give a bad module name etc. also a test to show this can solve the error in #310 would be great
The ideal outcome from this is that a user can do
api.connect({ provider: ..., modules: ['GenericAsset'] })
to only interact with generic assets I think in this case we should make some modules mandatory like 'System' and 'TransactionPayment' are always provided
This can solve https://github.com/cennznet/api.js/issues/310 would mean.. I have a runtime upgrade with new types and I don't use that module while creating an API.... cause the current API will always contain all the types for the current runtime..
lgtm. Only question is if cennzx module gets updated with a new type lets say, does that mean the whole cennzx module will be out of action for the user until we update the static metadata?
Better than not being able to connect to the whole API of course.
If you don't include it as a part of metadata then it should work fine... But when you say api = await Api.create({provider, modules:['Cennzx']}) This can break... This PR will help when you introduce a runtime module in node... DApp user can still use the old API with upgraded node if they choose to use fullMeta = false or specify the custom modules they want to use... DApp user won't need to upgrade to new API version... But if they are keen on using the updated(new types added) module (it makes sense to use updated API version for it)
Closes https://github.com/cennznet/api.js/issues/310 Options supplied to create API instance, can now include two more option..
Things to do. ~~Add the same logic for Rx API and test it Add unit test to getMetadata function Check extrinsic works fine~~
This is still wip PR