Commit Graph

23 Commits

Author SHA1 Message Date
Chirantan Ekbote e377a75e2b solana: run `cargo fmt` 2022-09-20 23:00:47 +09:00
Chirantan Ekbote 6c4aad8610 solana: nft_bridge: Replace deprecated function
The replacement function seems like it does the same thing but with an
instruction enum instead.
2022-09-20 23:00:47 +09:00
Stan Drozd 18eac4e3d3 solana: bump: Rust nightly-2022-07-12, SOL SDK v1.10.31, rust container 1.60
solana: use prebuild docker image for 1.10.31

solana: use the right rust version

from https://github.com/solana-labs/solana/blob/v1.10.31/ci/rust-version.sh

nft_bridge: TransportError -> BanksClientError

solana/Dockerfile.wasm: Use rust-toolchain instead of rustup
2022-08-17 15:30:01 +01:00
Reisen 5da7ad0ef5 solitaire: reduce Claim complexity 2022-07-15 13:12:27 -05:00
Reisen 82ea938317 solitaire: remove recursive FromAccounts and 'c lifetime.
Solitaire parses accounts using two traits, FromAccounts and Peel. The
FromAccounts derive macro generates a function, `FromAccounts::from()`,
which calls `Peel::peel` to construct each field in the struct:

```
let example = Example {
    foo: Peel::peel(next_account_iter(accs)?),
    bar: Peel::peel(next_account_iter(accs)?),
    baz: Peel::peel(next_account_iter(accs)?),
    ...,
}
```

The FromAccounts derivation also attempts to implement Peel for the
structure itself however, which means `Example` itself is embeddable as
a field in another accounts struct. This is only used in ClaimableVAA
which is a large source of confusion and the complexity is not worth
maintaining.

This commit removes the recursion by:

1) Removing the `impl Peel` derived by FromAccounts.
2) Removes the AccountInfo iterator from Context as it is no longer needed.
3) Adds the current parsed account to Context instead, safe thanks to (2)
4) Move message out of ClaimableVAA and pass in to verify everywhere instead.
5) Removes Peel/FromAccounts from ClaimableVAA.
2022-07-15 13:12:27 -05:00
Reisen 4131381fa4 solitaire: remove unused InstructionContext 2022-06-24 13:51:50 +02:00
Reisen a8d1ed129b solitaire: remove unused client code 2022-06-24 13:51:50 +02:00
Csongor Kiss 2e220a6f76
Solana fix warnings (#1226)
* solana: fix all rustc warnings

* solana: fix clippy warnings

* Remove manual memcpy + other warning suppressions

Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
2022-06-10 17:59:15 +01:00
Chirantan Ekbote defd16e084 solana: nft-bridge: Add tests
The integration tests were previously just copied over from the
token-bridge directory and not changed at all (they still referenced the
token-bridge crate).

Clean up the files and add tests for basic functionality like sending
and receiving native + wrapped NFTs.
2022-05-10 00:58:43 +09:00
Chirantan Ekbote 3fdd9ccc3e solana: Merge into single workspace
Merge all the separate solana crates into a single workspace.  This is
the same thing we do for terra and will make it easier to check / lint /
test all the crates together.
2022-04-20 09:37:30 +09:00
Csongor Kiss f60acc59ab
solitaire: Infer entry point argument type in solitaire! macro (#927)
The type of the `ix_data` binding withing the solitaire! macro expansion
is explicitly annotated with its type, which comes from the macro's
pattern binding `$kind`. However, this type annotation is entirely
optional, since `ix_data` is passed in as an argument to `$fn`, whose
type forecs `ix_data` anyway, and rust will happily infer that from the
application. So we remove the explicit annotation which makes the entry
point macro easier to use.

commit-id:d428306c
2022-03-16 18:25:41 +00:00
Hendrik Hofstadt 7edbbd3677 Update Solana to 1.9.4
Change-Id: I9c1ce5f25b21ca81599957a7faa730558d8fc03e
2022-02-02 11:31:33 -05:00
Reisen e561d6de02 sdk: fixes to types and builds
Change-Id: I10b753450445cc021dbeb9f28ddb0384070e9635
2022-01-14 13:09:12 +00:00
Hendrik Hofstadt 32e9063910 Check whether vaa recipient matches the token account
Change-Id: Iab326cd735c764649dc031d813dbb8818d5e74f3
2022-01-13 14:07:40 +01:00
Stanisław Drozd 02a1dcecbc
solana: hide wasm-bindgen dependency behind the feature flag (#730)
commit-id:480d3b7a
2022-01-10 15:31:36 +01:00
Hendrik Hofstadt 1421e5d76f Add derivation methods for claims and spl meta
Change-Id: I4e8056b37d441caf7bca94037585c37afe25cc24
2021-09-21 16:29:42 +02:00
Hendrik Hofstadt 3968b6eb7f Split nft transfer in 2 ixs
This also changes the required confirmation level to finalized

Change-Id: I4793619634e7bac587b20d2776c0b166b95a6de7
2021-09-21 15:29:40 +02:00
Hendrik Hofstadt 64b17d851a Encode mint in token ID on Solana
Change-Id: Ice9c2b64992e60bb8a0eb5d0a109043eda2d44ac
2021-09-20 15:56:39 +02:00
Hendrik Hofstadt 371c9b3dcc Resolve warnings in the NFT bridge
Change-Id: I6d5e5a7d66e8e35418eaf9346c53b3439314c9c5
2021-09-20 12:23:40 +02:00
Reisen 3a9264f6e4 solana/nft_bridge: allow invalid utf-8 metadata
Change-Id: If2fba5d394b8afab34ed0f12714851d0121a2924
2021-09-13 11:52:41 +00:00
Reisen ca509f2d73 solana/bridge: re-organize account data
Change-Id: Ia215c584e5d00145d8ad0250c303ca9503d8432a
2021-09-13 10:29:29 +00:00
Evan Gray 9ea0369ab0 nft_bridge fixes
Change-Id: I9420863384e752725cfc75c8b5a21f64be2792b1
2021-09-10 20:32:46 -04:00
Hendrik Hofstadt a2b3d111f4 add nft bridge skeleton
Change-Id: I69449e95415cd94b7de4528fe4002b241e1e6b95
2021-09-10 17:12:42 +00:00