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
+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, [