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

Improvements to hh tests - fixtures, split contract_address #29

Open
wants to merge 1 commit into
base: challenge-1-decentralized-staking
Choose a base branch
from

Conversation

joescharf
Copy link

Was adding the hardhat tests for challenge 1, but looks like @pontus-dev beat me to it (nice!). However, my port of the challenge-1 tests improves on a few things beyond a direct port of the javascript version, so I'm submitting it in case it proves to be useful:

  1. Create a setup fixture for the tests to take advantage of hardhat-deploy plugin fixture capability
  2. Use the hardhat-deploy plugin deployments.fixture() to deploy or access the contracts (no need to manually deploy the contracts as part of the test case. (i.e lines 33-40 and 105,106 unnecessary)
  3. Split out the local and CONTRACT_ADDRESS tests
  4. Pretty sure there was an error in Should redeploy Staker, stake, not get enough, and withdraw test where the Staking was being called with the default deployer address, but the withdraw was being requested with secondAccount which wouldn't have a positive balance in that scenario.

This is my first PR for this repo, hopefully I'm not taking too many liberties with my refactor of the tests.

@grothem
Copy link
Contributor

grothem commented Mar 24, 2022

Thanks for the PR. Sorry for the delay on reviewing this. I'm going to take a closer look tonight and try to get this merged.

codenamejason pushed a commit to Sergik666/scaffold-eth-typescript-challenges that referenced this pull request Aug 7, 2022
* scaffold-eth#29 testing out contracts context

* scaffold-eth#29 v4 compatability changes and merging develop

* scaffold-eth#29 eth-hooks v4 minor updates

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- external contracts are now handles
- worked on the contract context initalization in app

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- created an contract context factory

* scaffold-eth#29 preliminary typing system for all the app contracts

* scaffold-eth#29 contract typing is almost working

* scaffold-eth#29 checkpoint

* scaffold-eth#29 checkpoint

* scaffold-eth#29 regenerate lock file

* scaffold-eth#29 general refactor of v4 types and function names

* scaffold-eth#29 created hook and system to load contracts

* scaffold-eth#29 using the new eth-hooksv4 paradigm

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 loading contractrats

* scaffold-eth#29 changes to how main provider is passed around

* added react async

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

event based updates

* replace apollo with react-query and graphql-request.  lazy load GraphiQl

* scaffold-eth#29 tried to make folder structure simpler.  better commands to build contracts

* scaffold-eth#29 minor fixes

* scaffold-eth#29 more comments to contract

* update packages

* scaffold-eth#46 fixes and autconnect to burner with an option

* scaffold-eth#46  packages updates
codenamejason pushed a commit to Sergik666/scaffold-eth-typescript-challenges that referenced this pull request Aug 7, 2022
* Feature/scaffold-eth#29 eth-hooks v4 changes (scaffold-eth#32)

* scaffold-eth#29 testing out contracts context

* scaffold-eth#29 v4 compatability changes and merging develop

* scaffold-eth#29 eth-hooks v4 minor updates

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- external contracts are now handles
- worked on the contract context initalization in app

* scaffold-eth#29 more work on contract context scaffold-eth/eth-ui#101

- created an contract context factory

* scaffold-eth#29 preliminary typing system for all the app contracts

* scaffold-eth#29 contract typing is almost working

* scaffold-eth#29 checkpoint

* scaffold-eth#29 checkpoint

* scaffold-eth#29 regenerate lock file

* scaffold-eth#29 general refactor of v4 types and function names

* scaffold-eth#29 created hook and system to load contracts

* scaffold-eth#29 using the new eth-hooksv4 paradigm

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 and eth-components

* scaffold-eth#29 fixes from eth-hooksv4 loading contractrats

* scaffold-eth#29 changes to how main provider is passed around

* added react async

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 final changes to inital beta

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

* scaffold-eth#29 changes from scaffold-eth/eth-ui#114

event based updates

* replace apollo with react-query and graphql-request.  lazy load GraphiQl

* scaffold-eth#29 tried to make folder structure simpler.  better commands to build contracts

* scaffold-eth#29 minor fixes

* scaffold-eth#29 more comments to contract

* update packages

* scaffold-eth#46 fixes and autconnect to burner with an option

* scaffold-eth#46  packages updates

* changes for scaffold-eth/eth-ui#120 useBalance

* scaffold-eth#47 changes to building contract, bug fixes, and updates to packages

* reenabled dai

* scaffold-eth#47 updated packages

* scaffold-eth#47 updated packages, fixed externals for vite.

* disabled subgraph for now scaffold-eth#48

* updated git ignore

* scaffold-eth#47 fix to generic-contract.  removed generated fiels

* scaffold-eth#47 updated git ignore

* scaffold-eth#47 updated action

* scaffold-eth#47 updated action

* scaffold-eth#47 updated action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants