The tokenbridge chain registration query returns a
`ChainRegistrationResponse` struct and not a `Vec<u8>`. Use the proper
return type when sending the query.
Add a mechanism to backfill missing transfer messages by submitting
signed VAAs. This will also be used to initialize the on-chain state
as there is too much data to initialize the contract via the normal
`instantiate` mechanism.
Fixes#1883, fixes#1884.
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.
* sdk/rust: Move profile settings to workspace
* 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.
* 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>
* 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`.
* cosmwasm: Use cargo resolver version "2"
Enable the new feature resolver for the entire workspace. This
prevents features that are enabled only for dev builds from also being
enabled in normal builds.
* Move cosmwasm Dockerfile to root directory
The cosmwasm contracts now also depend on the rust sdk so the docker
build context needs to be set to the root directory rather than the
cosmwasm/ directory.
* cosmwasm: Add wormchain-accounting contract
This contract implements tokenbridge accounting specifically for the
wormchain environment.
Fixes#1880.
* cosmwasm/accounting: 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 contracts that
contain it.
Fix this by removing references to `de::Unexpected`.
Co-authored-by: Reisen <reisen@morphism.org>
Put all the local overrides at the workspace level rather than having
to specify the path in each individual crate. This will also make it
easier for us to publish to crates.io when that time comes.
* tob-worm-4-panics: using options rather than unwrap
* removed mock dependencies argument
* added test to make file
* use ok or else
* fmt
* ok
* errors resolved
* Prepare to deploy Xpla to mainnet
* Update SDK version
* Fix messed up error message
* Allow tests to pass with no XPLA tokens
* Make deploy script support testnet
* Update token bridge addresses after redeploy
* near-sdk-refactor: Fix attest
: Fix missing function calls
: make near on near
: renamed tryHexToNativeStringNear
* near-sdk-refactor: bumped near-sdk-js version
Co-authored-by: Josh Siegel <jsiegel@jumptrading.com>
Prior to this change, these values were hardcode in the contract, as
the only supported chain was terra 2. This change allows the contract to
be deployed to other cosmwasm chains without having to recompile the
contract for each one.
The migration code ensures that terra2 is upgraded appropriately.