Skip to content

Commit

Permalink
fix: meta transaction for add delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
fermentfan committed Sep 7, 2023
1 parent ab252c5 commit 527dbb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"migrate-goerli": "tsc -p ./tsconfig.migrate.json --outDir ./migrations && npm run compile && truffle migrate --network goerli",
"test": "npm run test:jest && npm run test:truffle",
"test:truffle": "npx truffle test",
"test:truffle:meta": "npx truffle test test/meta-transactions.test.ts",
"test:coverage": "npx truffle run coverage",
"test:jest": "jest",
"compile": "npx truffle compile && apply-registry"
Expand Down
18 changes: 9 additions & 9 deletions test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function signTypedData(signer: string, params: EIP712Params): Promi
return new Promise((resolve, reject) => {
(web3.eth.currentProvider as HttpProvider).send({
jsonrpc: "2.0",
method: 'eth_signTypedData',
method: 'eth_signTypedData_v4',
params: [signer, params],
}, function (err: any, result: any) {
if (err) {
Expand Down Expand Up @@ -189,7 +189,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'revocationList', type: 'bytes32'},
{name: 'revocationKey', type: 'bytes32'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.CHANGE_STATUS_DELEGATED:
Expand All @@ -200,7 +200,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'revocationList', type: 'bytes32'},
{name: 'revocationKey', type: 'bytes32'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.CHANGE_STATUSES_IN_LIST:
Expand All @@ -211,7 +211,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'revocationList', type: 'bytes32'},
{name: 'revocationKeys', type: 'bytes32[]'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.CHANGE_STATUSES_IN_LIST_DELEGATED:
Expand All @@ -222,7 +222,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'revocationList', type: 'bytes32'},
{name: 'revocationKeys', type: 'bytes32[]'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.CHANGE_LIST_OWNER:
Expand All @@ -232,7 +232,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'newOwner', type: 'address'},
{name: 'revocationList', type: 'bytes32'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.ADD_LIST_DELEGATE:
Expand All @@ -243,7 +243,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'revocationList', type: 'bytes32'},
{name: 'validity', type: 'uint'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.REMOVE_LIST_DELEGATE:
Expand All @@ -253,7 +253,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'delegate', type: 'address'},
{name: 'revocationList', type: 'bytes32'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
break;
case SignedFunction.CHANGE_LIST_STATUS:
Expand All @@ -263,7 +263,7 @@ export function generateEIP712Params(signedFunction: SignedFunction, domainObjec
{name: 'namespace', type: 'address'},
{name: 'revocationList', type: 'bytes32'},
{name: 'signer', type: 'address'},
{name: 'nonce', type: 'uint'},
{name: 'nonce', type: 'uint256'},
]
}
return params;
Expand Down

0 comments on commit 527dbb3

Please sign in to comment.