-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add vscode setting to use project typescript version * add coupon-burn type * add test for coupon type
- Loading branch information
Showing
5 changed files
with
114 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,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { | ||
DEFAULT_ACTION_ID, | ||
DEFAULT_CHAIN_ID, | ||
DEFAULT_VERIFYING_CONTRACT, | ||
} from "./utils"; | ||
import { getDomainType, getCouponBurnDomainDefinition } from "../index"; | ||
|
||
describe("getCouponBurnDomainDefinition unit tests", () => { | ||
test("should return correct data", () => { | ||
expect( | ||
getCouponBurnDomainDefinition( | ||
DEFAULT_VERIFYING_CONTRACT, | ||
DEFAULT_ACTION_ID, | ||
DEFAULT_CHAIN_ID | ||
) | ||
).toEqual({ | ||
domain: { | ||
actionId: DEFAULT_ACTION_ID, | ||
chainId: DEFAULT_CHAIN_ID, | ||
name: "Snapshot Message", | ||
verifyingContract: DEFAULT_VERIFYING_CONTRACT, | ||
version: "4", | ||
}, | ||
types: { | ||
Message: [ | ||
{ name: "authorizedMember", type: "address" }, | ||
{ name: "amount", type: "uint256" }, | ||
{ name: "nonce", type: "uint256" }, | ||
], | ||
EIP712Domain: getDomainType(), | ||
}, | ||
}); | ||
}); | ||
}); |
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,34 @@ | ||
import { | ||
DEFAULT_ACTION_ID, | ||
DEFAULT_CHAIN_ID, | ||
DEFAULT_VERIFYING_CONTRACT, | ||
} from "./utils"; | ||
import { getDomainType, getCouponDomainDefinition } from "../index"; | ||
|
||
describe("getCouponDomainDefinition unit tests", () => { | ||
test("should return correct data", () => { | ||
expect( | ||
getCouponDomainDefinition( | ||
DEFAULT_VERIFYING_CONTRACT, | ||
DEFAULT_ACTION_ID, | ||
DEFAULT_CHAIN_ID | ||
) | ||
).toEqual({ | ||
domain: { | ||
actionId: DEFAULT_ACTION_ID, | ||
chainId: DEFAULT_CHAIN_ID, | ||
name: "Snapshot Message", | ||
verifyingContract: DEFAULT_VERIFYING_CONTRACT, | ||
version: "4", | ||
}, | ||
types: { | ||
Message: [ | ||
{ name: "authorizedMember", type: "address" }, | ||
{ name: "amount", type: "uint256" }, | ||
{ name: "nonce", type: "uint256" }, | ||
], | ||
EIP712Domain: getDomainType(), | ||
}, | ||
}); | ||
}); | ||
}); |
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