Commit Graph

270 Commits

Author SHA1 Message Date
Chirantan Ekbote e05176c9be sdk/rust: Remove `expiration_time` from `GuardianSetInfo`
This field doesn't actually appear in `GuardianSetUpgrade` governance
messages and was already being skipped by serde so just remove it
completely.  Contracts that need to keep track of this information can
encapsulate the `GuardianSetInfo` inside another struct that has an
`expiration_time` field.
2023-01-04 16:17:14 +09:00
Chirantan Ekbote 3a1dd9eccd sdk/rust: Simplify quorum calculation
Also add tests.
2023-01-04 16:17:14 +09:00
Chirantan Ekbote ab172b4da5 sdk/rust: Ensure chain conversions are isomorphic
Ensure that converting `Chain` to/from a u16 or to/from a string is
always isomorphic.  This requires changing the `FromStr` impl so that in
can handle strings like "Unknown(27)".
2023-01-04 16:17:14 +09:00
Chris Sentman 0f066614b3 sdk: tests for vaa.UnmarshalBody()
Full coverage save for a non-empty payload read error.
2023-01-03 09:59:56 -05:00
Chris Sentman 66c8399dcb sdk: test ChainID.String()
Completing coverage for method.
2023-01-03 09:59:56 -05:00
Jeff Schroeder bc1edba32c sdk: full test coverage of ChainID.FromString()
The optimism coverage was a lie as it wasn't explicitly tested.
2023-01-03 09:59:56 -05:00
Jeff Schroeder 2b6ede0d54 sdk: test vaa.Address.UnmarshalJSON()
Full coverage including the error condition.
2023-01-03 09:59:56 -05:00
Jeff Schroeder 6ea4cf054a sdk: test BodyWormchainInstantiateContract.Serialize()
This completes full test coverage of sdk/vaa/payloads.go!
2023-01-03 09:59:56 -05:00
Jeff Schroeder a2857e3b1d sdk: test BodyWormchainStoreCode.Serialize() 2023-01-03 09:59:56 -05:00
Jeff Schroeder 1cc177bf64 sdk: cleanup vaa payloads test
Less duplication of the addr.
2023-01-03 09:59:56 -05:00
Jeff Schroeder 7a439e4cfd sdk: BodyTokenBridgeRegisterChain.Serialize() test
* Switch the BodyTokenBridgeRegisterChain.Serialize() test to table driven
  and add coverage for the panic condition.
2023-01-03 09:59:56 -05:00
Jonathan Claudius 98c843e85d
sdk: Add unit-tests for quorum calculation (#2127)
* sdk: Add unit-tests for quorum calculation

* sdk: fix go imports error

* node: remove duplicate sdk unit-test
2022-12-27 13:27:47 -05:00
Kevin Peters a7be5a639c sdk/js: 0.9.8 version bump 2022-12-22 12:57:20 -06:00
Kevin Peters 88e0c6cddf sdk/js: Use BN.toArrayLike for compatibility with browserify and similar tools.
Fixes this error when calling `deriveWrappedMintKey` in the browser:
TypeError: (intermediate value).toBuffer is not a function
2022-12-22 12:57:20 -06:00
Kevin Peters 49de9ef8f2 sdk/js: 0.9.7 version bump 2022-12-21 11:05:40 -06:00
guibescos 43035fcc44
sdk/js: Add instruction decoder to solana (#2095)
* Bump package

* Refactor coder add decoder

* Refactor

* Fix

* Fix u64

* Simplify encode

* Add comment

* Fix verify signatures

* Fix package lock

* Revert "Fix package lock"

This reverts commit 9f219bc6fc21d2d0f8bf33fedafd6c204a00e659.

* Fix deps

* Fix import for bs58
2022-12-21 06:35:37 -05:00
Chirantan Ekbote b400a2d51d sdk/rust: Add test for digest calculation
Add a test to ensure that calculating the digest from the structured
body, serialized data, or partial body + serialized payload all give the
same result.
2022-12-21 13:59:01 +09:00
Chirantan Ekbote 0dbeeec3d4 sdk/rust: Add `Body::with_payload`
Add the `Body::with_payload` method, which can be used to change the
type of the payload for a `Body`.  This is useful when parsing the
payload needs to be deferred until after the body is parsed.
2022-12-19 17:14:33 +09:00
Chirantan Ekbote 4ea369d7a9 sdk/rust: Implement Display for Address
This will be used later by the accounting contract.
2022-12-19 17:14:33 +09:00
Nikhil Suri eff4eb2ebd wormchain: add accounting contract bindings 2022-12-16 08:51:41 -05:00
Chirantan Ekbote 16b22a8cfc cosmwasm: wormhole-bindings: Use the Signature type from the SDK
Use the `Signature` type from the core SDK to avoid unnecessary
type conversions.  Cosmwasm requires its message types to implement
`JsonSchema` so also derive that impl for the `Signature` type behind a
feature flag.

This change uncovered a separate issue where the fake `WormholeKeeper`
was using regular ecdsa signatures rather than recoverable signatures
so fix the signing and verification methods to use the recoverable
signatures.
2022-12-15 12:22:37 +09:00
Kevin Peters 5ce3290ba3 sdk/js: 0.9.6 version bump 2022-12-14 13:16:23 -05:00
A5 Pickle b71181a404 sdk/js: fix account and instruction serialization 2022-12-14 11:00:20 -06:00
A5 Pickle 1616df817e sdk/js: fix token bridge cpi accounts 2022-12-14 11:00:20 -06:00
Bojan Angjelkoski 612ae1a7e5 sdk/js: injective package bump 2022-12-14 11:40:49 -05:00
Chirantan Ekbote b3d68b0db6 sdk/rust: Drop references to `de::Unexpected`
The `de::Unexpected` enum from serde has a `Float(f64)` variant.
Referencing this enum anywhere in the code will cause the compiler to
emit its `fmt::Display` impl, which includes an `f64.load` instruction
on wasm targets.  Even if this instruction is never executed, its mere
existence will cause cosmos chains to reject any cosmwasm contract that
has it.

Fix this by removing all references to `de::Unexpected`.
2022-12-14 16:33:22 +09:00
Chirantan Ekbote d157c7bf67 sdk/rust: Add serde-based struct defintions
Refactor the core crate to add serde-based struct definitions for the
various messages used by the different wormhole smart contracts.  This
will also make it easier to use alternate data formats (like json) for
client-side tooling.

Co-authored-by: Reisen <reisen@morphism.org>
2022-12-14 16:33:22 +09:00
Chirantan Ekbote 92cb3d28a3 sdk/rust: Add serde_wormhole crate
The serde_wormhole crate implements the wormhole wire format as a serde
data format.  This will let us replace all the hand-rolled
serialization with auto-generated code, which is less error-prone and
easier to review.
2022-12-14 16:33:22 +09:00
Chirantan Ekbote 6e25b6c801 sdk/rust: Move profile settings to workspace 2022-12-14 16:33:22 +09:00
aki a408a5b8ff clients: replace references to sdk consts
this will require another pass in the future, once we cut a new release of the sdk with the deployer address consts
2022-12-13 08:21:49 -08:00
A5 Pickle 26069907b2 sdk/js: fix payload ID 2022-12-12 17:09:05 -05:00
jumpsiegel 82651e4c55
Node fix register chain vaa format error (#2100)
* Node: Fix register chain VAA format error

Change-Id: If60ae2e072da025029b8a817272d8175585baa7d

* sdk_tests: adding sdk vaa tests

* sdk/vaa: share governance serialization

Co-authored-by: Bruce Riley <briley@jumptrading.com>
Co-authored-by: Evan Gray <battledingo@gmail.com>
2022-12-12 13:58:38 -06:00
kev1n-peters c94ad13c8c
node: Injective mainnet support (#2084) 2022-12-07 13:43:44 -06:00
Nikhil Suri 235fb59d05
wormchain: move governance consts to sdk (#2086) 2022-12-07 09:20:11 -08:00
kev1n-peters d7198a74d7
sdk/js: Added injective mainnet addresses (#2085) 2022-12-06 22:53:19 -05:00
Nikhil Suri 0e7c085d71
node: inject wormchain cosmwasm governance messages (#2057)
* node: inject wormchain cosmwasm governance messages

* Use nested hash for defense in depth

* Use keccak.Reset() instead of creating new hash objects

* fix msg_server_wasmd_test

* Updated based on jynnantonix comments

* Check return value of binary.Write

* Include actual error in binary.Write panic case
2022-12-06 11:10:32 -08:00
bruce-riley b38dfc015f
sdk/go: Add unmarshal for vaa.Address (#2076)
* sdk/go: Add unmarshal for vaa.Address

Change-Id: I1beb99f82673d1fc3225a8c6628a0019648d7e01

* sdk/go: review rework

Change-Id: I7c9179e674c019f46eebff13a071f997f20572f3
2022-12-06 07:18:16 -06:00
Evan Gray 22304b94a1 sdk/js: avoid terra test1 key in CI 2022-12-01 17:41:00 -05:00
bruce-riley b2fdebb9cb
SDK: Redeploy Neon Testnet (#2035)
* sdk: redeploy neon testnet

* sdk/js: 0.9.4 version bump

Co-authored-by: Kevin Peters <kpeters@jumptrading.com>
2022-11-30 18:54:43 -06:00
Nikhil Suri 88293f36eb
sdk: enforce single canonical VerifySignatures method (#1995) 2022-11-30 10:42:07 -08:00
Conor Patrick 63a5654c02 wormchain: add admin-sign command to continue wormchain validator enrollment 2022-11-30 09:23:19 -06:00
kev1n-peters 74c5f5c471
sdk/js: Added .prettierrc.json file (#2028) 2022-11-30 09:03:26 -06:00
Hendrik Hofstadt ff186e441a rename dev.v2 to main
Change-Id: Idfc6f88de7ee3c190a01c2196dc0bc4da91cbe4c
2022-11-29 10:43:07 -05:00
bruce-riley 95fd892bec
Node: Support for EVM watcher safe blocks (#1727)
* Node: Support for EVM watcher safe blocks

* Fix merge error

* Add check of publishSafeBlocks if not useFinalized
2022-11-28 07:55:35 -06:00
jumpsiegel 091ee0877d
WH-1934: upgrade golang to 1.19 (#1941)
* upgrade to golang 1.19.3

Co-authored-by: tbjump <>
Co-authored-by: tbjump <unknown>
2022-11-28 07:48:27 -06:00
ckeun 1406d29ff6
sdk/js: added vaa repair script to utils (#1935)
* sdk/js: Added repairVaa & test

* fixed unnecessary comments

* Separated rpc call from base repairVaa function. removed console logs and added throws

* removed unncessary else statement

* removed unnecessary async

* Skipping rpc call test for current guardian set

* Clean up minor formatting
2022-11-23 10:24:06 -06:00
A5 Pickle 395bb0f73c sdk/js: uptick version 2022-11-22 12:16:11 -05:00
A5 Pickle 41c02f1ea4 sdk/js: update CHANGELOG 2022-11-22 12:16:11 -05:00
A5 Pickle 5d9ce7227e sdk/js: fix transfer and redeem for native SOL
sdk/js: add optional argument for MockTokenBridge

testing: add tests
2022-11-22 12:16:11 -05:00
Kevin Peters 68fbc1e77d sdk/js: Added integration tests for transferring native sol 2022-11-22 12:16:11 -05:00