git.delta.rocks / unique-network / refs/commits / 5a5b604b91f3

difftreelog

tests: toggleFlipValue contract helper

Yaroslav Bolyukin2021-02-02parent: #98ba4b3.patch.diff
in: master

1 file changed

modifiedtests/src/util/contracthelpers.tsdiffbeforeafterboth
14chai.use(chaiAsPromised);14chai.use(chaiAsPromised);
15const expect = chai.expect;15const expect = chai.expect;
16import { BigNumber } from 'bignumber.js';16import { BigNumber } from 'bignumber.js';
17import { findUnusedAddress } from '../util/helpers';17import { findUnusedAddress, getGenericResult } from '../util/helpers';
1818
19const value = 0;19const value = 0;
20const gasLimit = '200000000000';20const gasLimit = '200000000000';
92 return (result.result.asOk.data[0] == 0x00) ? false : true;92 return (result.result.asOk.data[0] == 0x00) ? false : true;
93}93}
94
95export async function toggleFlipValueExpectSuccess(sender: IKeyringPair, contract: Contract) {
96 const tx = contract.tx.flip(value, gasLimit);
97 const events = await submitTransactionAsync(sender, tx);
98 const result = getGenericResult(events);
99
100 expect(result.success).to.be.true;
101}
94102
95function instantiateTransferContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {103function instantiateTransferContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {
96 return new Promise<any>(async (resolve, reject) => {104 return new Promise<any>(async (resolve, reject) => {