Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version of E2E Test Cases and setSeed address loading issue #50

Merged
merged 20 commits into from
Jun 3, 2024

Conversation

erdimaden
Copy link
Contributor

@erdimaden erdimaden commented Jun 3, 2024

What changed? Why?

  • Adding initial version of e2e test cases.
  • Adding NPM dry-run to e2e workflow.
  • e2e tests are now part of PR workflow.
  • Fixing setSeed address loading issue.

Qualified Impact

@erdimaden erdimaden changed the title Initial version of E2E Test Cases Initial version of E2E Test Cases and setSeed address loading issue Jun 3, 2024
expect(await transfer.getStatus()).toBe(TransferStatus.COMPLETE);
console.log(`Transferred 1 Gwei from ${unhydratedWallet} to ${wallet}`);

console.log("Fetching updated balances...");
Copy link
Contributor

@jazz-cb jazz-cb Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add one more transfer request that transfers remaining funds back to the CB faucet 0x6Cd01c0F55ce9E0Bf78f5E90f72b4345b16d515d ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced on this but the faucet contract is updated. we will have a followup

@@ -19,3 +19,14 @@ jobs:

- name: Run Unit Tests
run: npm run test

- name: Run E2E Tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add instructions somewhere to run this locally as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I added npm scripts to we can run it locally and README is also updated.

@erdimaden erdimaden force-pushed the feat/e2e-tests branch 2 times, most recently from 5a8d209 to cd80753 Compare June 3, 2024 21:01
@erdimaden erdimaden force-pushed the feat/e2e-tests branch 2 times, most recently from fc7cbe5 to 4f01261 Compare June 3, 2024 21:15
);

console.log("Importing wallet with balance...");
const seedFile = JSON.parse(process.env.SEED || "");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be process.env.SEED_FILE instead of process.env.SEED. It is confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jazz-cb sure, it is content of the seed file. Maybe SEED_FILE_CONTENT?

@erdimaden erdimaden force-pushed the feat/e2e-tests branch 3 times, most recently from 45ec424 to 1f98319 Compare June 3, 2024 21:35
@@ -19,3 +19,12 @@ jobs:

- name: Run Unit Tests
run: npm run test

- name: Run E2E Tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we run the E2E tests in their own github action separate from unit tests?

Will help in reporting in identifying what is the error more quickly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, I created a workflow file for e2e tests.

README.md Outdated

```typescript
user.saveWallet(wallet);
user.saveSeed(wallet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wallet.saveSeed

README.md Outdated
@@ -165,16 +165,16 @@ In order to persist the data for the Wallet, you will need to implement a store
await store(data);
```

For convenience during testing, we provide a `saveWallet` method that stores the Wallet data in your local file system. This is an insecure method of storing wallet seeds and should only be used for development purposes.
For convenience during testing, we provide a `saveSeed` method that stores the Wallet data in your local file system. This is an insecure method of storing wallet seeds and should only be used for development purposes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saveSeed method that stores the wallet's seed in your local file system

README.md Outdated
```

To encrypt the saved data, set encrypt to true. Note that your CDP API key also serves as the encryption key for the data persisted locally. To re-instantiate wallets with encrypted data, ensure that your SDK is configured with the same API key when invoking `saveWallet` and `loadWallets`.
To encrypt the saved data, set encrypt to true. Note that your CDP API key also serves as the encryption key for the data persisted locally. To re-instantiate wallets with encrypted data, ensure that your SDK is configured with the same API key when invoking `saveSeed` and `loadWallets`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saveSeed and loadSeed.

@erdimaden erdimaden force-pushed the feat/e2e-tests branch 2 times, most recently from 63f3960 to d2d5b41 Compare June 3, 2024 22:49
@erdimaden erdimaden merged commit 182ece9 into v0.0.6 Jun 3, 2024
4 checks passed
@erdimaden erdimaden deleted the feat/e2e-tests branch June 21, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants