Skip to content

Commit

Permalink
tilt: solana-test-validator multi-platform support
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Dec 11, 2024
1 parent 6359412 commit e9b080b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
7 changes: 0 additions & 7 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ update_settings(max_parallel_updates = 10)
# Runtime configuration
config.define_bool("ci", False, "We are running in CI")
config.define_bool("manual", False, "Set TRIGGER_MODE_MANUAL by default")
config.define_bool("m1", False, "Use this flag for M-series Macs (e.g. use an arm64 solana-test-validator due to AVX requirement)")

config.define_string("num", False, "Number of guardian nodes to run")
config.define_string("maxWorkers", False, "Maximum number of workers for sdk-ci-tests. See https://jestjs.io/docs/cli#--maxworkersnumstring")
Expand Down Expand Up @@ -103,7 +102,6 @@ btc = cfg.get("btc", False)
redis = cfg.get('redis', ci)
generic_relayer = cfg.get("generic_relayer", ci)
query_server = cfg.get("query_server", ci)
m1 = cfg.get("m1", False)

if ci:
guardiand_loglevel = cfg.get("guardiand_loglevel", "warn")
Expand Down Expand Up @@ -489,15 +487,10 @@ if solana or pythnet:

# solana local devnet

build_args = {}
if m1:
build_args = {"BASE_IMAGE": "ghcr.io/wormholelabs-xyz/solana-test-validator-m1:1.17.29@sha256:c5a43c0762f2dab4873a9e632a389029b6d5f706be7dfb89a42a66cc65a3dd24"}

docker_build(
ref = "solana-test-validator",
context = "solana",
dockerfile = "solana/Dockerfile.test-validator",
build_args = build_args
)

k8s_yaml_with_ns("devnet/solana-devnet.yaml")
Expand Down
44 changes: 33 additions & 11 deletions sdk/js-query/src/query/solana.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[0].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand All @@ -216,7 +218,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[1].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[1].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand Down Expand Up @@ -268,7 +272,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[0].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand All @@ -280,7 +286,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[1].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[1].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand Down Expand Up @@ -398,7 +406,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).not.toEqual(
BigInt(0).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(Buffer.from(sar.results[0].owner).toString("hex")).toEqual(
"02c806312cbe5b79ef8aa6c17e3f423d8fdfe1d46909fb1f6cdf65ee8e2e6faa"
Expand Down Expand Up @@ -455,7 +465,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).not.toEqual(
BigInt(0).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(Buffer.from(sar.results[0].owner).toString("hex")).toEqual(
"02c806312cbe5b79ef8aa6c17e3f423d8fdfe1d46909fb1f6cdf65ee8e2e6faa"
Expand Down Expand Up @@ -519,7 +531,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[0].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand All @@ -531,7 +545,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[1].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[1].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand Down Expand Up @@ -584,7 +600,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[0].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand All @@ -596,7 +614,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).toEqual(
BigInt(1461600).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[1].executable).toEqual(false);
expect(base58.encode(Buffer.from(sar.results[1].owner))).toEqual(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
Expand Down Expand Up @@ -654,7 +674,9 @@ describe("solana", () => {
expect(sar.results[0].lamports.toString()).not.toEqual(
BigInt(0).toString()
);
expect(sar.results[0].rentEpoch.toString()).toEqual(BigInt(0).toString());
expect(sar.results[0].rentEpoch.toString()).toEqual(
BigInt("18446744073709551615").toString()
);
expect(sar.results[0].executable).toEqual(false);
expect(Buffer.from(sar.results[0].owner).toString("hex")).toEqual(
"02c806312cbe5b79ef8aa6c17e3f423d8fdfe1d46909fb1f6cdf65ee8e2e6faa"
Expand Down
3 changes: 1 addition & 2 deletions solana/Dockerfile.test-validator
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
ARG BASE_IMAGE=solana-contract
FROM ${BASE_IMAGE}
FROM ghcr.io/wormholelabs-xyz/solana-test-validator:1.17.29@sha256:b1f85eed2d33a2bd0378204ab4d1e16537de35407cdcfeedbd021b31636618bc
COPY --from=solana-contract /opt/solana/deps/ /opt/solana/deps/

0 comments on commit e9b080b

Please sign in to comment.