Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e218c6b0
Commit
e218c6b0
authored
Mar 07, 2022
by
Nicolas "Norswap" Laurent
Committed by
norswap
Mar 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename ChallengeCreate to ChallengeCreated
parent
a5abe5f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Challenge.sol
contracts/Challenge.sol
+3
-3
challenge.js
scripts/challenge.js
+1
-1
challenge_test.js
test/challenge_test.js
+1
-1
No files found.
contracts/Challenge.sol
View file @
e218c6b0
...
@@ -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 ChallengeCreate
d
(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 ChallengeCreate
d
(challengeId);
return challengeId;
return challengeId;
}
}
...
...
scripts/challenge.js
View file @
e218c6b0
...
@@ -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
// ChallengeCreate
d
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
)
}
}
...
...
test/challenge_test.js
View file @
e218c6b0
...
@@ -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
// ChallengeCreate
d
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment