Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkmin committed Sep 19, 2023
1 parent 12001fa commit 392c701
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 38 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,16 @@ jobs:
- name: Typecheck
run: pnpm run typecheck-all

# Run Anvil node in background for e2e tests
# - name: Anvil
# run: |
# anvil &

- name: Test
run: anvil & pnpm run test-all
env: # Or as an environment variable
env:
API_PUBLIC_KEY: ${{ secrets.API_PUBLIC_KEY }}
API_PRIVATE_KEY: ${{ secrets.API_PRIVATE_KEY }}
BASE_URL: ${{ secrets.BASE_URL }}
BASE_URL: "https://api.turnkey.com"
ORGANIZATION_ID: ${{ secrets.ORGANIZATION_ID }}
PRIVATE_KEY_ID: ${{ secrets.PRIVATE_KEY_ID }}
EXPECTED_ETH_ADDRESS: ${{ secrets.EXPECTED_ETH_ADDRESS }}
BANNED_TO_ADDRESS: ${{ secrets.BANNED_TO_ADDRESS }}
BANNED_TO_ADDRESS: "0x6F72eDB2429820c2A0606a9FC3cA364f5E9b2375"

- name: Prettier
run: pnpm run prettier-all:check
Expand Down
61 changes: 31 additions & 30 deletions packages/viem/src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,36 +253,37 @@ describe("TurnkeyAccount", () => {
expect(verified).toBeTruthy();
});

describe("it signs walletconnect v1 payloads, bridged via EIP-1193", () => {
// https://docs.walletconnect.com/1.0/json-rpc-api-methods/ethereum

testCase("Uniswap payload", async () => {
const payload: any = {
id: 1683062025301507,
jsonrpc: "2.0",
method: "eth_sendTransaction",
params: [
{
gas: "0x2fe08", // See comment below
value: "0xf4240",
from: expectedEthAddress, // See comment below
to: "0x4648a43b2c14da09fdf82b161150d3f634f40491",
data: "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006451840800000000000000000000000000000000000000000000000000000000000000020b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000677493600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002bb4fbf271143f4fbf7b91a5ded31805e42b2208d6000bb81f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000000000000000000000",
},
],
};

// Looks like here, too, we are subject to similar issues as described below:
// See https://github.com/ethers-io/ethers.js/issues/1683
delete payload.params[0].gas;
// In a real-world scenario you should also verify that `from` matches the wallet's address
delete payload.params[0].from;

// Anvil client seems to be able to host eip1193 requests just fine
const tx = await walletClient.request(payload);
expect(tx).toMatch(/^0x/);
});
});
// NOTE: disabling this test case for now until we can also test via React Native app
// describe("it signs walletconnect v1 payloads, bridged via EIP-1193", () => {
// // https://docs.walletconnect.com/1.0/json-rpc-api-methods/ethereum

// testCase("Uniswap payload", async () => {
// const payload: any = {
// id: 1683062025301507,
// jsonrpc: "2.0",
// method: "eth_sendTransaction",
// params: [
// {
// gas: "0x2fe08", // See comment below
// value: "0xf4240",
// from: expectedEthAddress, // See comment below
// to: "0x4648a43b2c14da09fdf82b161150d3f634f40491",
// data: "0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000006451840800000000000000000000000000000000000000000000000000000000000000020b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000677493600000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002bb4fbf271143f4fbf7b91a5ded31805e42b2208d6000bb81f9840a85d5af5bf1d1762f925bdaddc4201f984000000000000000000000000000000000000000000",
// },
// ],
// };

// // Looks like here, too, we are subject to similar issues as described below:
// // See https://github.com/ethers-io/ethers.js/issues/1683
// delete payload.params[0].gas;
// // In a real-world scenario you should also verify that `from` matches the wallet's address
// delete payload.params[0].from;

// // Anvil client seems to be able to host eip1193 requests just fine
// const tx = await walletClient.request(payload);
// expect(tx).toMatch(/^0x/);
// });
// });

// Use `pnpm run compile:contracts` to update the ABI if needed
testCase("ERC-721", async () => {
Expand Down

0 comments on commit 392c701

Please sign in to comment.