Skip to content

Instantly share code, notes, and snippets.

@ValeryDubrava
Created February 15, 2018 10:24
Show Gist options
  • Save ValeryDubrava/7bc4a5d6b2b29a8de36308a0aae89943 to your computer and use it in GitHub Desktop.
Save ValeryDubrava/7bc4a5d6b2b29a8de36308a0aae89943 to your computer and use it in GitHub Desktop.
const joule = await createJoule();
const contract100k = await Contract100kGas.new();
const price = await joule.getPrice(gasLimit1, gasPrice1);
await joule.register(contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1, {value: price});
await joule.unregister(0, contract100k.address, nowPlus3minutes, gasLimit1, gasPrice1);
let count = await joule.getCount();
count.should.be.bignumber.equals(1, "contract must be registered");
await increaseTime(3 * MINUTE);
const top = await joule.getTopOnce();
const invokeGas = top[4];
// console.info(invokeGas);
const tx = await joule.invoke({gas: invokeGas.add(20000)});
console.info(tx);
count = await joule.getCount();
count.should.be.bignumber.equals(0, "contract100 must be invoked!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment