This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3552 from trufflesuite/usenums
Enhancement: Add enum objects to contract objects
- Loading branch information
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var assert = require("chai").assert; | ||
var util = require("./util"); | ||
|
||
describe("Enumerations", function () { | ||
var Example; | ||
|
||
before(async function () { | ||
this.timeout(10000); | ||
|
||
Example = await util.createExample(); | ||
}); | ||
|
||
it("Sets up enumeration objects on contracts", async function () { | ||
const expected = { | ||
ExampleZero: 0, | ||
ExampleOne: 1, | ||
ExampleTwo: 2 | ||
}; | ||
assert.deepEqual(Example.enums.ExampleEnum, expected); | ||
assert.deepEqual(Example.ExampleEnum, expected); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters