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
This commit is contained in:
parent
2092484e73
commit
18eac4e3d3
|
@ -1,18 +1,13 @@
|
|||
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
||||
FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5
|
||||
FROM ghcr.io/certusone/solana:1.10.31@sha256:d31e8db926a1d3fbaa9d9211d9979023692614b7b64912651aba0383e8c01bad AS solana
|
||||
|
||||
RUN apt-get update && apt-get install -yq libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang ncat
|
||||
# libudev is needed by spl-token-cli, and ncat is needed by the devnet setup
|
||||
# script to be able to signal a health status for tilt
|
||||
RUN apt-get update && apt-get install -yq libudev-dev ncat
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
|
||||
RUN curl -sSfL https://release.solana.com/v1.9.4/install | sh
|
||||
|
||||
RUN rustup default nightly-2022-01-02
|
||||
RUN rustup component add rustfmt
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache \
|
||||
cargo install --version =2.0.12 spl-token-cli
|
||||
|
||||
ENV SOLANA_BIN_PATH="/root/.local/share/solana/install/active_release/bin"
|
||||
ENV PATH="$SOLANA_BIN_PATH:$PATH"
|
||||
cargo install --version =2.0.12 --locked spl-token-cli
|
||||
|
||||
WORKDIR /usr/src/clients/js
|
||||
COPY clients/js/package.json clients/js/package-lock.json ./
|
||||
|
|
|
@ -34,13 +34,13 @@ opt-level = 3
|
|||
lto = "thin"
|
||||
|
||||
[dependencies]
|
||||
borsh = { version="=0.9.1" }
|
||||
borsh = { version="=0.9.3" }
|
||||
nom = { version="7", default-features=false, features=["alloc"] }
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
wormhole-core = { path="../core", version="0.1.0" }
|
||||
|
||||
# Solana Specific
|
||||
solana-program = { version="=1.9.4", optional=true }
|
||||
solana-program = { version="=1.10.31", optional=true }
|
||||
|
||||
# Terra Specific
|
||||
cosmwasm-std = { version = "0.16.0", optional=true }
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,16 +3,16 @@
|
|||
To speed up builds and ensure that upstream dependencies remain available, we
|
||||
publish prebuilt docker images to https://github.com/orgs/certusone/packages.
|
||||
|
||||
The base images have names ending in `*.base`, such as `Dockerfile.base` and
|
||||
`Dockerfile.wasm.base`. To push a new image:
|
||||
The base images have names ending in `*.base`, such as `Dockerfile.base`.
|
||||
To push a new image:
|
||||
|
||||
```sh
|
||||
# first build the image
|
||||
DOCKER_BUILDKIT=1 docker build -f Dockerfile.wasm.base -t wasm-pack .
|
||||
DOCKER_BUILDKIT=1 docker build -f Dockerfile.base -t solana .
|
||||
# tag the image with the appropriate version
|
||||
docker tag wasm-pack:latest ghcr.io/certusone/wasm-pack:0.9.1
|
||||
docker tag solana:latest ghcr.io/certusone/solana:1.10.31
|
||||
# push to ghcr
|
||||
docker push ghcr.io/certusone/wasm-pack:0.9.1
|
||||
docker push ghcr.io/certusone/solana:1.10.31
|
||||
```
|
||||
|
||||
Finally, modify the reference in `Dockerfile.wasm` (make sure to update the sha256 hash too).
|
||||
Finally, modify the reference in `Dockerfile` (make sure to update the sha256 hash too).
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
||||
FROM ghcr.io/certusone/solana:1.9.4@sha256:5389eccba0ba59ae119bc1438b61be8904707e26df8f0732116a8dce0f64eb52 AS solana
|
||||
FROM ghcr.io/certusone/solana:1.10.31@sha256:d31e8db926a1d3fbaa9d9211d9979023692614b7b64912651aba0383e8c01bad AS solana
|
||||
|
||||
# Support additional root CAs
|
||||
COPY cert.pem* /certs/
|
||||
|
@ -49,20 +49,24 @@ RUN [ -n "${BRIDGE_ADDRESS}" ]
|
|||
|
||||
# This is a pre-built contract.
|
||||
RUN --mount=type=cache,target=target,id=test \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
|
||||
mkdir -p target/deploy && \
|
||||
cp modules/token_bridge/token-metadata/spl_token_metadata.so target/deploy/
|
||||
|
||||
RUN --mount=type=cache,target=target,id=test \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
|
||||
cargo test-bpf \
|
||||
--manifest-path bridge/program/Cargo.toml \
|
||||
--features trace,instructions
|
||||
|
||||
RUN --mount=type=cache,target=target,id=test \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
|
||||
cargo test-bpf \
|
||||
--manifest-path modules/token_bridge/program/Cargo.toml \
|
||||
--features trace,instructions
|
||||
|
||||
RUN --mount=type=cache,target=target,id=test \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry,id=cargo_registry \
|
||||
cargo test-bpf \
|
||||
--manifest-path modules/nft_bridge/program/Cargo.toml \
|
||||
--features trace,instructions
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#syntax=docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc
|
||||
FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5 AS solana
|
||||
FROM docker.io/library/rust:1.60.0@sha256:9fe1f39bec70576e2bd568fafb194b2a532a6f2928bc0b951ac2c0a69a2be9fe as solana
|
||||
|
||||
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.9.4/install)"
|
||||
RUN sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"
|
||||
|
||||
ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965b
|
|||
|
||||
RUN apt-get update && apt-get install -y libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang
|
||||
RUN rustup component add rustfmt
|
||||
RUN rustup default nightly-2022-01-02
|
||||
|
||||
WORKDIR /usr/src/bridge
|
||||
|
||||
|
@ -18,6 +17,7 @@ ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime:
|
|||
ENV EMITTER_ADDRESS="11111111111111111111111111111115"
|
||||
ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
|
||||
|
||||
COPY rust-toolchain .
|
||||
COPY bridge bridge
|
||||
COPY modules modules
|
||||
COPY solitaire solitaire
|
||||
|
|
|
@ -6,16 +6,16 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1.0.40"
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
clap = "2.33.0"
|
||||
cpi-poster = { path = "../cpi_poster", features = ["no-entrypoint"] }
|
||||
hex = "0.4.3"
|
||||
rand = "0.7.3"
|
||||
shellexpand = "2.1.0"
|
||||
solana-client = "=1.9.4"
|
||||
solana-program = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
solana-cli-config = "=1.9.4"
|
||||
solana-clap-utils = "=1.9.4"
|
||||
solana-client = "=1.10.31"
|
||||
solana-program = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
solana-cli-config = "=1.10.31"
|
||||
solana-clap-utils = "=1.10.31"
|
||||
solitaire = { path = "../../solitaire/program" }
|
||||
wormhole-bridge-solana = { path = "../program", features = ["client"] }
|
||||
|
|
|
@ -426,6 +426,7 @@ fn main() {
|
|||
preflight_commitment: None,
|
||||
encoding: None,
|
||||
max_retries: None,
|
||||
min_context_slot: None,
|
||||
},
|
||||
)?;
|
||||
println!("Signature: {}", signature);
|
||||
|
|
|
@ -16,11 +16,11 @@ no-entrypoint = ["solitaire/no-entrypoint"]
|
|||
trace = ["solitaire/trace"]
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
byteorder = "1.4.3"
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
solana-program = "=1.10.31"
|
||||
wormhole-bridge-solana = { path = "../program", features = ["no-entrypoint"] }
|
||||
solitaire = { path = "../../solitaire/program" }
|
||||
|
||||
|
@ -29,5 +29,5 @@ hex = "*"
|
|||
rand = "0.7.3"
|
||||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
solana-client = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
solana-client = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
|
|
|
@ -18,19 +18,20 @@ trace = ["solitaire/trace"]
|
|||
instructions = []
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
byteorder = "1.4.3"
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
solana-program = "=1.10.31"
|
||||
solitaire = { path = "../../solitaire/program" }
|
||||
wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
hex = "*"
|
||||
rand = "0.7.3"
|
||||
getrandom = {version = "0.2.6", features = ["custom"]}
|
||||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
solana-program-test = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
solana-program-test = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
|
|
|
@ -17,6 +17,7 @@ use solana_program::{
|
|||
use solana_program_test::{
|
||||
BanksClient,
|
||||
ProgramTest,
|
||||
BanksClientError,
|
||||
};
|
||||
use solana_sdk::{
|
||||
commitment_config::CommitmentLevel,
|
||||
|
@ -27,7 +28,6 @@ use solana_sdk::{
|
|||
},
|
||||
signers::Signers,
|
||||
transaction::Transaction,
|
||||
transport::TransportError,
|
||||
};
|
||||
use std::{
|
||||
env,
|
||||
|
@ -58,7 +58,7 @@ pub async fn execute<T: Signers>(
|
|||
signers: &T,
|
||||
instructions: &[Instruction],
|
||||
commitment_level: CommitmentLevel,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let mut transaction = Transaction::new_with_payer(instructions, Some(&payer.pubkey()));
|
||||
let recent_blockhash = client.get_latest_blockhash().await?;
|
||||
transaction.sign(signers, recent_blockhash);
|
||||
|
@ -208,7 +208,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
initial_guardians: &[[u8; 20]],
|
||||
fee: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -236,7 +236,7 @@ mod helpers {
|
|||
nonce: u32,
|
||||
data: Vec<u8>,
|
||||
fee: u64,
|
||||
) -> Result<Pubkey, TransportError> {
|
||||
) -> Result<Pubkey, BanksClientError> {
|
||||
// Transfer money into the fee collector as it needs a balance/must exist.
|
||||
let fee_collector = FeeCollector::<'_>::key(None, program);
|
||||
|
||||
|
@ -283,7 +283,7 @@ mod helpers {
|
|||
nonce: u32,
|
||||
data: Vec<u8>,
|
||||
fee: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
// Transfer money into the fee collector as it needs a balance/must exist.
|
||||
let fee_collector = FeeCollector::<'_>::key(None, program);
|
||||
|
||||
|
@ -319,7 +319,7 @@ mod helpers {
|
|||
body: [u8; 32],
|
||||
secret_keys: &[SecretKey],
|
||||
guardian_set_version: u32,
|
||||
) -> Result<Pubkey, TransportError> {
|
||||
) -> Result<Pubkey, BanksClientError> {
|
||||
let signature_set = Keypair::new();
|
||||
let tx_signers = [payer, &signature_set];
|
||||
// Push Secp256k1 instructions for each signature we want to verify.
|
||||
|
@ -357,7 +357,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
signature_set: Pubkey,
|
||||
vaa: PostVAAData,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -383,7 +383,7 @@ mod helpers {
|
|||
old_index: u32,
|
||||
new_index: u32,
|
||||
sequence: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -412,7 +412,7 @@ mod helpers {
|
|||
new_contract: Pubkey,
|
||||
spill: Pubkey,
|
||||
sequence: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -438,7 +438,7 @@ mod helpers {
|
|||
message: Pubkey,
|
||||
emitter: Pubkey,
|
||||
sequence: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -463,7 +463,7 @@ mod helpers {
|
|||
emitter: Pubkey,
|
||||
recipient: Pubkey,
|
||||
sequence: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
|
|
@ -16,11 +16,11 @@ no-entrypoint = ["solitaire/no-entrypoint"]
|
|||
trace = ["solitaire/trace"]
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
byteorder = "1.4.3"
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
solana-program = "=1.10.31"
|
||||
solitaire = { path = "../../solitaire/program" }
|
||||
wormhole-bridge-solana = { path = "../program", features = ["no-entrypoint"] }
|
||||
|
||||
|
@ -29,5 +29,5 @@ hex = "*"
|
|||
rand = "0.7.3"
|
||||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
solana-client = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
solana-client = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
|
|
|
@ -17,13 +17,13 @@ cpi = ["no-entrypoint"]
|
|||
default = []
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
byteorder = "1.4.3"
|
||||
rocksalt = { path = "../solitaire/rocksalt" }
|
||||
solitaire = { path = "../solitaire/program" }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "*"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
rand = { version = "0.7.3", optional = true }
|
||||
|
@ -32,6 +32,6 @@ rand = { version = "0.7.3", optional = true }
|
|||
hex = "*"
|
||||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
solana-client = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
solana-client = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
|
|
|
@ -19,14 +19,14 @@ default = []
|
|||
|
||||
[dependencies]
|
||||
wormhole-bridge-solana = { path = "../../../bridge/program", features = ["no-entrypoint", "cpi"] }
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
bstr = "0.2.16"
|
||||
byteorder = "1.4.3"
|
||||
rocksalt = { path = "../../../solitaire/rocksalt" }
|
||||
solitaire = { path = "../../../solitaire/program" }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "*"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
spl-associated-token-account = { version = "1.0.2", features = ["no-entrypoint"] }
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
spl-token-metadata = { path = "../../token_bridge/token-metadata" }
|
||||
|
@ -39,7 +39,7 @@ hex = "*"
|
|||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
rand = "0.7.3"
|
||||
solana-program-test = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
solana-program-test = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
spl-token-metadata = { path = "../../token_bridge/token-metadata" }
|
||||
|
|
|
@ -18,6 +18,7 @@ use solana_program::{
|
|||
};
|
||||
use solana_program_test::{
|
||||
BanksClient,
|
||||
BanksClientError,
|
||||
ProgramTest,
|
||||
};
|
||||
use solana_sdk::{
|
||||
|
@ -30,7 +31,6 @@ use solana_sdk::{
|
|||
},
|
||||
signers::Signers,
|
||||
transaction::Transaction,
|
||||
transport::TransportError,
|
||||
};
|
||||
use solitaire::processors::seeded::Seeded;
|
||||
use std::{
|
||||
|
@ -56,7 +56,7 @@ pub async fn execute<T: Signers>(
|
|||
signers: &T,
|
||||
instructions: &[Instruction],
|
||||
commitment_level: CommitmentLevel,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let mut transaction = Transaction::new_with_payer(instructions, Some(&payer.pubkey()));
|
||||
let recent_blockhash = client.get_latest_blockhash().await?;
|
||||
transaction.sign(signers, recent_blockhash);
|
||||
|
@ -163,7 +163,7 @@ mod helpers {
|
|||
program: Pubkey,
|
||||
payer: &Keypair,
|
||||
initial_guardians: &[[u8; 20]],
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -186,7 +186,7 @@ mod helpers {
|
|||
program: Pubkey,
|
||||
payer: &Keypair,
|
||||
bridge: Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::initialize(program, payer.pubkey(), bridge)
|
||||
.expect("Could not create Initialize instruction");
|
||||
|
||||
|
@ -210,7 +210,7 @@ mod helpers {
|
|||
from: &Keypair,
|
||||
from_owner: &Keypair,
|
||||
mint: Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::transfer_native(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -259,7 +259,7 @@ mod helpers {
|
|||
token_chain: u16,
|
||||
token_address: Address,
|
||||
token_id: U256,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::transfer_wrapped(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -307,7 +307,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadGovernanceRegisterChain,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::register_chain(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -340,7 +340,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
to_authority: Pubkey,
|
||||
mint: Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::complete_native(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -373,7 +373,7 @@ mod helpers {
|
|||
payload: PayloadTransfer,
|
||||
to: Pubkey,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::complete_wrapped(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -404,7 +404,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadTransfer,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::complete_wrapped_meta(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -431,7 +431,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
mint_authority: &Pubkey,
|
||||
mint: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let mint_key = mint.pubkey();
|
||||
execute(
|
||||
client,
|
||||
|
@ -465,7 +465,7 @@ mod helpers {
|
|||
token_acc: &Keypair,
|
||||
token_authority: &Pubkey,
|
||||
mint: &Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let token_key = token_acc.pubkey();
|
||||
execute(
|
||||
client,
|
||||
|
@ -503,7 +503,7 @@ mod helpers {
|
|||
name: String,
|
||||
symbol: String,
|
||||
uri: String,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -535,7 +535,7 @@ mod helpers {
|
|||
mint: &Keypair,
|
||||
token_account: &Pubkey,
|
||||
amount: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -616,7 +616,7 @@ mod helpers {
|
|||
body: [u8; 32],
|
||||
secret_keys: &[SecretKey],
|
||||
guardian_set_version: u32,
|
||||
) -> Result<Pubkey, TransportError> {
|
||||
) -> Result<Pubkey, BanksClientError> {
|
||||
let signature_set = Keypair::new();
|
||||
let tx_signers = [payer, &signature_set];
|
||||
// Push Secp256k1 instructions for each signature we want to verify.
|
||||
|
@ -654,7 +654,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
signature_set: Pubkey,
|
||||
vaa: PostVAAData,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction =
|
||||
bridge::instructions::post_vaa(program, payer.pubkey(), signature_set, vaa);
|
||||
|
||||
|
@ -680,7 +680,7 @@ mod helpers {
|
|||
nonce: u32,
|
||||
data: Vec<u8>,
|
||||
fee: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
// Transfer money into the fee collector as it needs a balance/must exist.
|
||||
let fee_collector = FeeCollector::<'_>::key(None, &program);
|
||||
|
||||
|
|
|
@ -5,16 +5,16 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1.0.40"
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
token-bridge = { path = "../program", features = ["client"] }
|
||||
clap = "2.33.0"
|
||||
rand = "0.7.3"
|
||||
shellexpand = "2.1.0"
|
||||
solana-client = "=1.9.4"
|
||||
solana-program = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
solana-cli-config = "=1.9.4"
|
||||
solana-client = "=1.10.31"
|
||||
solana-program = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
solana-cli-config = "=1.10.31"
|
||||
solitaire = { path = "../../../solitaire/program" }
|
||||
solana-clap-utils = "=1.9.4"
|
||||
solana-clap-utils = "=1.10.31"
|
||||
hex = "0.4.3"
|
||||
spl-token-metadata = { path = "../token-metadata" }
|
||||
|
|
|
@ -363,6 +363,7 @@ fn main() {
|
|||
preflight_commitment: None,
|
||||
encoding: None,
|
||||
max_retries: None,
|
||||
min_context_slot: None,
|
||||
},
|
||||
)?;
|
||||
println!("Signature: {}", signature);
|
||||
|
|
|
@ -19,14 +19,14 @@ instructions = []
|
|||
|
||||
[dependencies]
|
||||
wormhole-bridge-solana = { path = "../../../bridge/program", features = ["no-entrypoint", "cpi"] }
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
bstr = "0.2.16"
|
||||
byteorder = "1.4.3"
|
||||
rocksalt = { path = "../../../solitaire/rocksalt" }
|
||||
solitaire = { path = "../../../solitaire/program" }
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "*"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
spl-token-metadata = { path = "../token-metadata" }
|
||||
wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true }
|
||||
|
@ -38,7 +38,7 @@ hex = "*"
|
|||
hex-literal = "0.3.1"
|
||||
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||
rand = "0.7.3"
|
||||
solana-program-test = "=1.9.4"
|
||||
solana-sdk = "=1.9.4"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
solana-program-test = "=1.10.31"
|
||||
solana-sdk = "=1.10.31"
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
spl-token-metadata = { path = "../token-metadata" }
|
||||
|
|
|
@ -21,6 +21,7 @@ use solana_program::{
|
|||
use solana_program_test::{
|
||||
BanksClient,
|
||||
ProgramTest,
|
||||
BanksClientError,
|
||||
};
|
||||
use solana_sdk::{
|
||||
commitment_config::CommitmentLevel,
|
||||
|
@ -32,7 +33,6 @@ use solana_sdk::{
|
|||
},
|
||||
signers::Signers,
|
||||
transaction::Transaction,
|
||||
transport::TransportError,
|
||||
};
|
||||
use std::{
|
||||
env,
|
||||
|
@ -61,7 +61,7 @@ pub async fn execute<T: Signers>(
|
|||
signers: &T,
|
||||
instructions: &[Instruction],
|
||||
commitment_level: CommitmentLevel,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let mut transaction = Transaction::new_with_payer(instructions, Some(&payer.pubkey()));
|
||||
let recent_blockhash = client.get_latest_blockhash().await?;
|
||||
transaction.sign(signers, recent_blockhash);
|
||||
|
@ -199,7 +199,7 @@ mod helpers {
|
|||
program: Pubkey,
|
||||
payer: &Keypair,
|
||||
initial_guardians: &[[u8; 20]],
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -223,7 +223,7 @@ mod helpers {
|
|||
from: &Keypair,
|
||||
to: &Pubkey,
|
||||
lamports: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
from,
|
||||
|
@ -239,7 +239,7 @@ mod helpers {
|
|||
program: Pubkey,
|
||||
payer: &Keypair,
|
||||
bridge: Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::initialize(program, payer.pubkey(), bridge)
|
||||
.expect("Could not create Initialize instruction");
|
||||
|
||||
|
@ -265,7 +265,7 @@ mod helpers {
|
|||
message: &Keypair,
|
||||
mint: Pubkey,
|
||||
nonce: u32,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::attest(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -301,7 +301,7 @@ mod helpers {
|
|||
from_owner: &Keypair,
|
||||
mint: Pubkey,
|
||||
amount: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::transfer_native(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -356,7 +356,7 @@ mod helpers {
|
|||
token_chain: u16,
|
||||
token_address: Address,
|
||||
amount: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::transfer_wrapped(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -409,7 +409,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadGovernanceRegisterChain,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::register_chain(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -443,7 +443,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadTransfer,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::complete_native(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -479,7 +479,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadTransfer,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let to = Pubkey::new(&payload.to[..]);
|
||||
|
||||
let instruction = instructions::complete_wrapped(
|
||||
|
@ -519,7 +519,7 @@ mod helpers {
|
|||
to: Pubkey,
|
||||
redeemer: &Keypair,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::complete_native_with_payload(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -556,7 +556,7 @@ mod helpers {
|
|||
vaa: PostVAAData,
|
||||
payload: PayloadAssetMeta,
|
||||
payer: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction = instructions::create_wrapped(
|
||||
program,
|
||||
bridge,
|
||||
|
@ -587,7 +587,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
mint_authority: &Pubkey,
|
||||
mint: &Keypair,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let mint_key = mint.pubkey();
|
||||
execute(
|
||||
client,
|
||||
|
@ -625,7 +625,7 @@ mod helpers {
|
|||
update_authority: Pubkey,
|
||||
name: String,
|
||||
symbol: String,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -656,7 +656,7 @@ mod helpers {
|
|||
token_acc: &Keypair,
|
||||
token_authority: &Pubkey,
|
||||
mint: &Pubkey,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let token_key = token_acc.pubkey();
|
||||
execute(
|
||||
client,
|
||||
|
@ -690,7 +690,7 @@ mod helpers {
|
|||
mint: &Keypair,
|
||||
token_account: &Pubkey,
|
||||
amount: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
execute(
|
||||
client,
|
||||
payer,
|
||||
|
@ -771,7 +771,7 @@ mod helpers {
|
|||
body: [u8; 32],
|
||||
secret_keys: &[SecretKey],
|
||||
guardian_set_version: u32,
|
||||
) -> Result<Pubkey, TransportError> {
|
||||
) -> Result<Pubkey, BanksClientError> {
|
||||
let signature_set = Keypair::new();
|
||||
let tx_signers = [payer, &signature_set];
|
||||
// Push Secp256k1 instructions for each signature we want to verify.
|
||||
|
@ -809,7 +809,7 @@ mod helpers {
|
|||
payer: &Keypair,
|
||||
signature_set: Pubkey,
|
||||
vaa: PostVAAData,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
let instruction =
|
||||
bridge::instructions::post_vaa(program, payer.pubkey(), signature_set, vaa);
|
||||
|
||||
|
@ -838,7 +838,7 @@ mod helpers {
|
|||
nonce: u32,
|
||||
data: Vec<u8>,
|
||||
fee: u64,
|
||||
) -> Result<(), TransportError> {
|
||||
) -> Result<(), BanksClientError> {
|
||||
// Transfer money into the fee collector as it needs a balance/must exist.
|
||||
let fee_collector = FeeCollector::<'_>::key(None, &program);
|
||||
|
||||
|
|
|
@ -15,6 +15,6 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
spl-token = { version = "=3.2.0", features = ["no-entrypoint"] }
|
||||
borsh = "=0.9.3"
|
||||
solana-program = "=1.10.31"
|
||||
spl-token = { version = "=3.3.0", features = ["no-entrypoint"] }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# This version should be kept up to date with the value in ci/rust-version.sh in
|
||||
# the branch of the solana repo that corresponds with the version we're using.
|
||||
[toolchain]
|
||||
channel = "nightly-2021-12-03"
|
||||
channel = "nightly-2022-02-24"
|
||||
profile = "minimal"
|
||||
|
|
|
@ -16,9 +16,9 @@ no-entrypoint = []
|
|||
trace = []
|
||||
|
||||
[dependencies]
|
||||
borsh = "=0.9.1"
|
||||
borsh = "=0.9.3"
|
||||
byteorder = "1.4.3"
|
||||
rocksalt = { path = "../../solitaire/rocksalt" }
|
||||
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
solana-program = "=1.10.31"
|
||||
|
|
|
@ -17,5 +17,5 @@ byteorder = "1.4.3"
|
|||
proc-macro2 = "1.0"
|
||||
quote = "1.0"
|
||||
sha3 = "0.9.1"
|
||||
solana-program = "=1.9.4"
|
||||
solana-program = "=1.10.31"
|
||||
syn = "1.0"
|
||||
|
|
Loading…
Reference in New Issue