difftreelog
tests: toggleFlipValue contract helper
in: master
1 file changed
tests/src/util/contracthelpers.tsdiffbeforeafterboth14chai.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';181819const 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}9495export 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);99100 expect(result.success).to.be.true;101}9410295function 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) => {