-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use @celo/celo-devchain for sdk tests needing a devchain (#10763)
* use @celo/celo-devchain package to as initial chain state rather than building it each time. * use new devchain * testing w/ contracts artifacts in devchain package * Bump version fix * bump celo-devchain version * BUMP celo-devchain to stable version * add back log feedback more accurate const names fix versions * LockedGold.getTotalPendingWithdrawalsCount requires contracts to be deployed at a higher version than us currently latest on celo mainnet. so note this to help developers understand why instead of just a VM revert message * dont ignore transaction-uri tests, these only take 3 seconds so its not worth separating them out. * bump celo/devchain version * latest beter all around --------- Co-authored-by: soloseng <[email protected]>
- Loading branch information
Showing
16 changed files
with
70 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@celo/contractkit': patch | ||
--- | ||
|
||
add notice that LockedGold.getTotalPendingWithdrawalsCount is not yet available on all networks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,16 @@ | |
|
||
## Running Tests | ||
|
||
To run test, we first need to generate a devchain snapshot: | ||
|
||
`yarn test:reset` | ||
|
||
and then: | ||
|
||
`yarn test` | ||
|
||
### Testing Azure HSM Signer | ||
|
||
The tests include an in-memory mock implementation which tests a majority of the functionality. In the case that changes are made to any of the wallet/signing logic, the HSM signer should be tested end-to-end by using an Azure KeyVault. To test against the KeyVault, environment variables are used to provide the client ID and client secret for authentication. Please see the .env file for the required variables. After deploying your KeyVault and generating an ECDSA-SECP256k1 key, you must create a service principal account and provide it signing access to the KeyVault. Instructions on how to do this can be found here: https://www.npmjs.com/package/@azure/keyvault-keys#configuring-your-key-vault. If the .env variables are specified, the tests will automatically switch from using the mock client to the actual KeyVault. | ||
The tests include an in-memory mock implementation which tests a majority of the functionality. In the case that changes are made to any of the wallet/signing logic, the HSM signer should be tested end-to-end by using an Azure KeyVault. To test against the KeyVault, environment variables are used to provide the client ID and client secret for authentication. Please see the .env file for the required variables. After deploying your KeyVault and generating an ECDSA-SECP256k1 key, you must create a service principal account and provide it signing access to the KeyVault. Instructions on how to do this can be found here: <https://www.npmjs.com/package/@azure/keyvault-keys#configuring-your-key-vault>. If the .env variables are specified, the tests will automatically switch from using the mock client to the actual KeyVault. | ||
|
||
## Testing Ledger Signer | ||
|
||
Similarly, the tests include an in-memory mock implementation of the Ledger signer. To run the tests using an actual Ledger device: | ||
|
||
- Set `USE_PHYSICAL_LEDGER` to `true` in ledger-wallet.test.ts | ||
- Install libusb-dev `apt-get install lsb-release libudev-dev libusb-dev libusb-1.0-0 -y` | ||
- Add reference to package: `@ledgerhq/[email protected]` | ||
|
@@ -28,4 +23,4 @@ To generate docs from [TSdoc](https://github.com/microsoft/tsdoc) annotations us | |
|
||
`yarn docs` | ||
|
||
To customize this generation, see the [linkdocs](./scripts/linkdocs.ts) script. | ||
To customize this generation, see the [linkdocs](./scripts/linkdocs.ts) script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/sdk/contractkit/src/wrappers/MetaTransactionWalletDeployer.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -986,6 +986,17 @@ | |
"@stablelib/blake2xs" "0.10.4" | ||
big-integer "^1.6.44" | ||
|
||
"@celo/celo-devchain@^6.0.3-beta.1": | ||
version "6.0.3-beta.1" | ||
resolved "https://registry.yarnpkg.com/@celo/celo-devchain/-/celo-devchain-6.0.3-beta.1.tgz#0c0637c4646904de578fa28ebe2dcb3f8ad35259" | ||
integrity sha512-Pjqbooy1eJ9qyMyIka3GFP0UrLATtSHJtGj/TNtuJ5nlpaBMAy2oA1zjKh0AsqyhvNkjs4Os6mgFYVEm5XuKuw== | ||
dependencies: | ||
commander "^10.0.0" | ||
ganache "npm:@celo/[email protected]" | ||
node-fetch "^3.3.0" | ||
targz "^1.0.1" | ||
tmp "^0.2.1" | ||
|
||
"@celo/identity@^5.1.1": | ||
version "5.1.1" | ||
resolved "https://registry.yarnpkg.com/@celo/identity/-/identity-5.1.1.tgz#e56cea67d820c7deae147e50b353f3c76b3e6d4d" | ||
|
@@ -9764,6 +9775,11 @@ [email protected], commander@^3.0.0: | |
resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" | ||
integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== | ||
|
||
commander@^10.0.0: | ||
version "10.0.1" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" | ||
integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== | ||
|
||
commander@^2.12.1, commander@^2.20.3, commander@^2.8.1: | ||
version "2.20.3" | ||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" | ||
|
@@ -22853,7 +22869,7 @@ tmp@^0.1.0: | |
dependencies: | ||
rimraf "^2.6.3" | ||
|
||
tmp@~0.2.1: | ||
tmp@^0.2.1, tmp@~0.2.1: | ||
version "0.2.1" | ||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" | ||
integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== | ||
|