Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/adding require failure messages #265

Merged
merged 13 commits into from Sep 11, 2019

Updating to use pay and withdraw.

  • Loading branch information
Freydal committed Sep 9, 2019
commit f545e7cd66f9a958da6c2e9ee659eab54fb552a8
@@ -16,16 +16,14 @@ describe("EventEmitter", () => {
describe("getPastDecodedLogs", () => {
it("should return decoded logs", async () => {
const fromBlock = (await web3Wrapper.getBlockNumberAsync()) + 1;
await kosu.posterRegistry.registerTokens(TestValues.oneWei).catch(e => {
clearInterval(interval);
throw e;
});
await kosu.posterRegistry.pay(TestValues.oneWei);
const logs = await kosu.eventEmitter.getPastDecodedLogs({ fromBlock });
logs.length.should.eq(1);
logs[0].decodedArgs.eventType.should.eq("PosterRegistryUpdate");

await kosu.posterRegistry.releaseTokens(TestValues.oneWei);
await kosu.treasury.withdraw(TestValues.oneWei);
const tokens = await kosu.posterRegistry.tokensRegisteredFor(accounts[0]);
await kosu.posterRegistry.releaseTokens(tokens);
await kosu.treasury.withdraw(tokens);
});
});

@@ -43,13 +41,14 @@ describe("EventEmitter", () => {
callback,
);

await kosu.posterRegistry.registerTokens(TestValues.oneWei).catch(e => {
await kosu.posterRegistry.pay(TestValues.oneWei).catch(e => {
clearInterval(interval);
throw e;
});

await kosu.posterRegistry.releaseTokens(TestValues.oneWei);
await kosu.treasury.withdraw(TestValues.oneWei);
const tokens = await kosu.posterRegistry.tokensRegisteredFor(accounts[0]);
await kosu.posterRegistry.releaseTokens(tokens);
await kosu.treasury.withdraw(tokens);
})
.then(() => {
clearInterval(interval);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.