Skip to content

Commit

Permalink
Update kyc coupon types to match KycOnboarding coupon changes (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmzero authored Jul 8, 2022
1 parent aac088c commit 45355aa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ export const getCouponKycDomainDefinition = (
const domain = getMessageDomainType(chainId, verifyingContract, actionId);

const types = {
Message: [{ name: "kycedMember", type: "address" }],
Message: [
{ name: "kycedMember", type: "address" },
{ name: "memberNonce", type: "uint256"}
],
EIP712Domain: getDomainType(),
};

Expand Down
33 changes: 33 additions & 0 deletions tests/getCouponKycDomainDefinition.unit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
DEFAULT_ACTION_ID,
DEFAULT_CHAIN_ID,
DEFAULT_VERIFYING_CONTRACT,
} from "./utils";
import { getDomainType, getCouponKycDomainDefinition } from "../index";

describe("getCouponKycDomainDefinition unit tests", () => {
test("should return correct data", () => {
expect(
getCouponKycDomainDefinition(
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: "kycedMember", type: "address" },
{ name: "memberNonce", type: "uint256" },
],
EIP712Domain: getDomainType(),
},
});
});
});

0 comments on commit 45355aa

Please sign in to comment.