Allow failures on preimage (instead of swallow) (#2225)

This commit is contained in:
Jaco Greeff
2020-04-30 15:14:56 +02:00
committed by GitHub
parent 6a70beda0f
commit 844d1a2928
2 changed files with 11 additions and 18 deletions
+4
View File
@@ -1,3 +1,7 @@
# 1.13.0-beta.x
- Add support for ECDSA keypairs in extrinsic signers (Thanks to https://github.com/akru)
# 1.12.2 Apr 30, 2020
- Update @polkadot/util to stable 2.9.1 (sadly missed in the previous version, stable should match to stable)
+7 -18
View File
@@ -436,24 +436,13 @@ export default class Rpc implements RpcInterface {
this.#storageCache.set(hexKey, value);
if (meta.modifier.isOptional) {
try {
return new Option(
this.registry,
createClass(this.registry, type),
isEmpty
? null
: createTypeUnsafe(this.registry, type, [input], true)
);
} catch (error) {
if (type === 'PreimageStatus') {
return new Option(
this.registry,
createClass(this.registry, type)
);
}
throw error;
}
return new Option(
this.registry,
createClass(this.registry, type),
isEmpty
? null
: createTypeUnsafe(this.registry, type, [input], true)
);
}
return createTypeUnsafe(this.registry, type, [