-
Notifications
You must be signed in to change notification settings - Fork 691
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
Migrate clients js to sdk v2 #3980
Migrate clients js to sdk v2 #3980
Conversation
f8d9b26
to
e3f54c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try any of these but looks pretty formulaic
There are a number of spots that mix getting contract addresses with .get
and not using .get
I'd like the chain names to be suggested and we should have what we need to do it
I'd like to know what things we still need the old SDK for and hope a future pass can simplify the code here so that we can remove some of the chain/platform specific files to do a thing, relying on the abstractions of the sdkv2. If we can't because sdkv2 doesn't provide them, we should consider making it provide them
9500e32
to
4c25a88
Compare
4c25a88
to
fed7444
Compare
8d144ed
to
8a76596
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the grunt work it took to move this forward, though I am hesitant about the nearly 40 remaining @certusone/wormhole-sdk
dependencies 😬 but it's a start. Just a few items that would be good to clean up.
Also, is run_info_tests
and the corresponding info_tests
folder still beneficial with those tests now being covered in jest?
The benefit is that one can run the script and it will automatically generate the test output for you. |
c3e5880
to
9486811
Compare
9486811
to
9555ef6
Compare
This is the first PR migrating clients/js to sdkV2.
The large line count is due to the package-lock.json file.
I added 2 files under an sdk folder. These files were mainly copies of what is in sdkv1. Over the next PRs related to this PR, the code in this folder will be migrated into the appropriate locations. The future PRs will be on a chain-by-chain conversion over to sdkV2. This will make the future PRs more manageable and deal with code that is missing from sdkV2.
Added jest tests:
PASS src/parse_tests.test.ts (39.068 s)
Info Tests
✓ worm info contract mainnet ethereum TokenBridge (1374 ms)
✓ worm info contract mainnet Bsc NFTBridge (1249 ms)
✓ worm info rpc mainnet Bsc (1126 ms)
✓ worm info wrapped ethereum 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 sui (1499 ms)
✓ worm info origin sui 0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN (1368 ms)
✓ worm info registrations mainnet ethereum TokenBridge -v (1916 ms)
✓ worm evm info -c Bsc -n mainnet -m TokenBridge (2560 ms)
EVM Tests
✓ worm evm address-from-secret 0xcfb12303a19cde580bb4dd771639b0d26bc68353645571a8cff516ab2ee113a0 (1137 ms)
Generate Tests
✓ worm generate registration (2158 ms)
✓ worm generate attestation (2564 ms)
Parse Tests
✓ worm parse base64-1 (1707 ms)
✓ worm parse base64-2 (1275 ms)
✓ worm parse big-payload-3 (1300 ms)
✓ worm parse guardian-set-upgrade-1 (1108 ms)
✓ worm parse nft-bridge-transfer-1 (1210 ms)
✓ worm parse token-bridge-attestation-1 (1095 ms)
✓ worm parse token-bridge-registration-1 (1133 ms)
✓ worm parse token-bridge-transfer-1 (1090 ms)
✓ worm parse token-bridge-transfer-2 (1339 ms)
✓ worm parse token-bridge-transfer-4 (1148 ms)
✓ worm parse token-bridge-upgrade-1 (1088 ms)
✓ worm parse token-bridge-upgrade-2 (1189 ms)
✓ worm parse token-bridge-upgrade-3 (1199 ms)
✓ worm parse token-bridge-upgrade-4 (1173 ms)
Test Suites: 1 passed, 1 total
Tests: 24 passed, 24 total