Adjust error message for contracts V3 (#3653)

* Adjust error message for contracts V3

* Adjust mock API
This commit is contained in:
Jaco
2021-06-15 08:54:43 +02:00
committed by GitHub
parent 6e04d4aa93
commit 8748c02b20
3 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -26,6 +26,6 @@ export abstract class Base<ApiType extends ApiTypes> {
this.registry = this.abi.registry;
this._decorateMethod = decorateMethod;
assert(isFunction(api.rx.tx.contracts?.instantiateWithCode), 'You need to connect to a node with a V3 contracts module. Your node does not expose api.tx.contracts.instantiateWithCode on this instance');
assert(isFunction(api.tx.contracts?.instantiateWithCode), 'You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
}
}
+4 -6
View File
@@ -8,12 +8,10 @@ const registry = new TypeRegistry();
export const mockApi = {
registry,
rx: {
tx: {
contracts: {
instantiateWithCode: (): never => {
throw new Error('mock');
}
tx: {
contracts: {
instantiateWithCode: (): never => {
throw new Error('mock');
}
}
}