Commit e218c6b0 authored by Nicolas "Norswap" Laurent's avatar Nicolas "Norswap" Laurent Committed by norswap

rename ChallengeCreate to ChallengeCreated

parent a5abe5f6
...@@ -72,11 +72,11 @@ contract Challenge { ...@@ -72,11 +72,11 @@ contract Challenge {
require(sent, "Failed to send Ether"); require(sent, "Failed to send Ether");
} }
// create challenge // ID if the last created challenged, incremented for new challenge IDs.
uint256 public lastChallengeId = 0; uint256 public lastChallengeId = 0;
// Emitted when a new challenge is created. // Emitted when a new challenge is created.
event ChallengeCreate(uint256 challengeId); event ChallengeCreated(uint256 challengeId);
// helper function to determine what nodes we need // helper function to determine what nodes we need
function CallWithTrieNodes(address target, bytes calldata dat, bytes[] calldata nodes) public { function CallWithTrieNodes(address target, bytes calldata dat, bytes[] calldata nodes) public {
...@@ -173,7 +173,7 @@ contract Challenge { ...@@ -173,7 +173,7 @@ contract Challenge {
c.L = 0; c.L = 0;
c.R = stepCount; c.R = stepCount;
emit ChallengeCreate(challengeId); emit ChallengeCreated(challengeId);
return challengeId; return challengeId;
} }
......
...@@ -41,7 +41,7 @@ async function main() { ...@@ -41,7 +41,7 @@ async function main() {
} }
let ret = await c.InitiateChallenge(...args) let ret = await c.InitiateChallenge(...args)
let receipt = await ret.wait() let receipt = await ret.wait()
// ChallengeCreate event // ChallengeCreated event
let challengeId = receipt.events[0].args['challengeId'].toNumber() let challengeId = receipt.events[0].args['challengeId'].toNumber()
console.log("new challenge with id", challengeId) console.log("new challenge with id", challengeId)
} }
......
...@@ -40,7 +40,7 @@ describe("Challenge contract", function () { ...@@ -40,7 +40,7 @@ describe("Challenge contract", function () {
} }
let ret = await c.InitiateChallenge(...args) let ret = await c.InitiateChallenge(...args)
let receipt = await ret.wait() let receipt = await ret.wait()
// ChallengeCreate event // ChallengeCreated event
let challengeId = receipt.events[0].args['challengeId'].toNumber() let challengeId = receipt.events[0].args['challengeId'].toNumber()
console.log("new challenge with id", challengeId) console.log("new challenge with id", challengeId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment