From efe5766dae6135f69f7e6087fbd5166a9df46045 Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Thu, 16 Dec 2021 17:54:58 -0500 Subject: [PATCH] Embed program at genesis for tests (#206) --- scripts/travis/dex-tests.sh | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/scripts/travis/dex-tests.sh b/scripts/travis/dex-tests.sh index 6d15265..47d1861 100755 --- a/scripts/travis/dex-tests.sh +++ b/scripts/travis/dex-tests.sh @@ -5,6 +5,7 @@ set -euxo pipefail CLUSTER=localnet KEYPAIR_FILE=$HOME/.config/solana/id.json CLUSTER_URL=http://localhost:8899 +PROGRAM_ID="2SXFv8tTmavm8uSAg3ft1JjttzJvgwXZiUPa9xuUbqH2" # # Assumes the current working directory is top-level serum-dex dir. @@ -12,14 +13,24 @@ CLUSTER_URL=http://localhost:8899 main() { set +e # + # Build the program. + # + cd ./dex && cargo build-bpf && cd ../ + # # Start the local validator. # - solana-test-validator > validator.log & + solana-test-validator --bpf-program $PROGRAM_ID dex/target/deploy/serum_dex.so > validator.log & # # Wait for the validator to start. # sleep 5 # + # Run the whole-shebang. + # + pushd dex/crank + cargo run -- $CLUSTER whole-shebang $KEYPAIR_FILE $PROGRAM_ID + popd + # # Create a keypair for the tests. # yes | solana-keygen new --outfile $KEYPAIR_FILE @@ -34,27 +45,6 @@ main() { pushd dex cargo test popd - # - # Run the integration tests. - # - dex_whole_shebang -} - -dex_whole_shebang() { - # - # Build the program. - # - cd ./dex && cargo build-bpf && cd ../ - # - # Deploy the program. - # - local dex_program_id="$(solana deploy --output json-compact --url ${CLUSTER_URL} dex/target/deploy/serum_dex.so | jq .programId -r)" - # - # Run the whole-shebang. - # - pushd dex/crank - cargo run -- $CLUSTER whole-shebang $KEYPAIR_FILE $dex_program_id - popd } main