Expose instantiate on contract Blueprint (#2706)

* Expose instantiate on contract Blueprint

* Allow BigInt & string types

* CodecArg

* Selector

* Cleanup selectors

* Remove Bytes override
This commit is contained in:
Jaco Greeff
2020-10-11 18:51:21 +02:00
committed by GitHub
parent 4cb563ba89
commit af0b4362c9
7 changed files with 97 additions and 111 deletions
-17
View File
@@ -1,17 +0,0 @@
// Copyright 2017-2020 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { SubmittableResult } from '@polkadot/api';
import { EventRecord } from '@polkadot/types/interfaces';
export function applyOnEvent <T> (result: SubmittableResult, type: 'CodeStored' | 'Instantiated', fn: (record: EventRecord) => T): T | undefined {
if (result.isInBlock || result.isFinalized) {
const record = result.findRecord('contract', 'CodeStored');
if (record) {
return fn(record);
}
}
return undefined;
}