wormhole/cosmwasm
Chirantan Ekbote d19fc98091 sdk/rust: Properly support tokenbridge payload3 messages
Add the payload as an explicit field to the `TransferWithPayload` enum
variant.  This is a generic parameter that defaults to `Box<RawMessage>`
for maximum flexibility (and to avoid leaking lifetimes higher up the
stack) but users are encouraged to replace this default type parameter
with an explicit `&RawMessage` in places where the serde_wormhole data
format is used.

The main benefit of this change is that the payload is now included as
part of the actual message and no longer requires callers to awkwardly
append it after serialization.  This is especially useful in human-
readable formats like JSON (see the `transfer_with_payload` test in
token.rs for an example of this simplification).

The main downside is that this now requires explicit type annotations
when using the non-payload3 variants so that the compiler will pick up
the default generic parameter.  This is a relatively minor inconvenience
and the benefit appears to be worth the cost.

There should be no functional change.
2023-01-20 18:12:41 +09:00
..
artifacts cosmwasm: cw20_base.wasm 0.13.4 2022-06-21 10:03:57 -04:00
contracts sdk/rust: Properly support tokenbridge payload3 messages 2023-01-20 18:12:41 +09:00
deployment cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
devnet/config cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
packages cosmwasm: accounting: Use cw_transcode for events 2023-01-16 09:28:43 +09:00
.dockerignore cosmwasm: initialize 2022-06-21 10:03:57 -04:00
.gitignore cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
Cargo.lock sdk/rust: Add serde_wormhole::RawMessage 2023-01-18 09:29:05 +09:00
Cargo.toml cosmwasm: Add cw_transcode crate 2023-01-12 10:29:29 +09:00
Dockerfile cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
Dockerfile.deploy cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
Makefile cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
README.md cosmwasm - separate deploy code per chain 2023-01-19 09:32:13 -06:00
rustfmt.toml cosmwasm: Fix formatting 2022-10-28 14:35:44 -04:00
verify cosmwasm: Added injective mainnet verify script (#2078) 2022-12-06 16:03:44 +01:00

README.md

Cosmwasm Wormhole Contracts

NOTE: This process is only Linux host compatible at this time.

Build Contracts

The following command can be used to build optimized cosmwasm contracts via Docker.

wormhole/cosmwasm $ make artifacts

Upon completion, the compiled bytecode for cosmwasm contracts will be placed into the artifacts directory.

Run tests

You can run the cargo unit tests.

wormhole/cosmwasm $ cargo test --workspace --locked