Skip to content

Commit 5904ed9

Browse files
authored
Merge branch 'main' into transceiver-type
2 parents 8171aca + bd1f7ef commit 5904ed9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+10300
-312
lines changed

.github/workflows/solana.yml

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ jobs:
9797
cargo build-sbf --features "mainnet"
9898
cargo test-sbf --features "mainnet"
9999
cargo test
100+
check-version:
101+
name: Check version
102+
runs-on: ubuntu-latest
103+
steps:
104+
- uses: actions/checkout@v4
105+
- run: ./scripts/sync-versions --check
106+
shell: bash
107+
100108
anchor-test:
101109
name: Anchor Test
102110
runs-on: ubuntu-latest

Tiltfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load('ext://namespace', 'namespace_create', 'namespace_inject')
22
load('ext://git_resource', 'git_checkout')
33

44
git_checkout('https://github.com/wormhole-foundation/wormhole.git#main', '.wormhole/', unsafe_mode=True)
5-
local(['sed','-i','/{chainId: vaa.ChainIDEthereum, addr: "000000000000000000000000855FA758c77D68a04990E992aA4dcdeF899F654A"},/i {chainId: vaa.ChainIDSolana, addr: "8bf0b547c96edc5c1d512ca25c5c1d1812a180438a0046e511d1fb61561d5cdf"},{chainId: vaa.ChainIDSolana, addr: "0a490691c21334ca173d9ce386e2a86774ce173f351db10d5d0cccc5c4875376"},{chainId: vaa.ChainIDEthereum, addr: "0000000000000000000000006f84742680311cef5ba42bc10a71a4708b4561d1"},{chainId: vaa.ChainIDEthereum, addr: "000000000000000000000000c3ef4965b788cc4b905084d01f2eb7d4b6e93abf"},{chainId: vaa.ChainIDBSC, addr: "0000000000000000000000006f84742680311cef5ba42bc10a71a4708b4561d1"},{chainId: vaa.ChainIDBSC, addr: "0000000000000000000000003f4e941ef5071a1d09c2eb4a24da1fc43f76fcff"},', '.wormhole/node/pkg/accountant/ntt_config.go'])
5+
local(['sed','-i','/{chainId: vaa.ChainIDEthereum, addr: "000000000000000000000000855FA758c77D68a04990E992aA4dcdeF899F654A"},/i {chainId: vaa.ChainIDSolana, addr: "8bf0b547c96edc5c1d512ca25c5c1d1812a180438a0046e511d1fb61561d5cdf"},{chainId: vaa.ChainIDSolana, addr: "0a490691c21334ca173d9ce386e2a86774ce173f351db10d5d0cccc5c4875376"},{chainId: vaa.ChainIDEthereum, addr: "00000000000000000000000042D4BA5e542d9FeD87EA657f0295F1968A61c00A"},{chainId: vaa.ChainIDEthereum, addr: "000000000000000000000000c3ef4965b788cc4b905084d01f2eb7d4b6e93abf"},{chainId: vaa.ChainIDBSC, addr: "000000000000000000000000C5aFE31AE505594B190AC71EA689B58139d1C354"},{chainId: vaa.ChainIDBSC, addr: "0000000000000000000000003f4e941ef5071a1d09c2eb4a24da1fc43f76fcff"},', '.wormhole/node/pkg/accountant/ntt_config.go'])
66

77
load(".wormhole/Tiltfile", "namespace", "k8s_yaml_with_ns")
88

sdk/__tests__/utils.ts

+9
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,15 @@ async function deploySolana(ctx: Ctx): Promise<Ctx> {
558558
await signSendWait(ctx.context, initTxs, signer);
559559
console.log("Initialized ntt at", manager.program.programId.toString());
560560

561+
// NOTE: this is a hack. The next instruction will fail if we don't wait
562+
// here, because the address lookup table is not yet available, despite
563+
// the transaction having been confirmed.
564+
// Looks like a bug, but I haven't investigated further. In practice, this
565+
// won't be an issue, becase the address lookup table will have been
566+
// created well before anyone is trying to use it, but we might want to be
567+
// mindful in the deploy script too.
568+
await new Promise((resolve) => setTimeout(resolve, 400));
569+
561570
const registrTxs = manager.registerTransceiver({
562571
payer: keypair,
563572
owner: keypair,

sdk/solana/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"test:ci": "jest --config ./jest.config.ts",
4242
"copy:idl": "cp ../../solana/target/idl/*.json ./src/anchor-idl/$IDL_VERSION/",
4343
"copy:types": "cp ../../solana/target/types/*.ts ./src/anchor-idl/$IDL_VERSION/",
44-
"generate": "export IDL_VERSION=`tsx scripts/readVersion.ts` && mkdir ./src/anchor-idl/$IDL_VERSION && npm run copy:idl && npm run copy:types",
44+
"generate": "export IDL_VERSION=`../../solana/scripts/program-version | sed s/\\\\\\./_/g` && mkdir -p ./src/anchor-idl/$IDL_VERSION && npm run copy:idl && npm run copy:types",
4545
"build:contracts": "cd ../../solana && make build"
4646
},
4747
"devDependencies": {

sdk/solana/scripts/readVersion.ts

-16
This file was deleted.

sdk/solana/src/anchor-idl/2_0_0.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import ntt from "./2_0_0/example_native_token_transfers.json";
2+
import quoter from "./2_0_0/ntt_quoter.json";
3+
import governance from "./2_0_0/wormhole_governance.json";
4+
5+
import type { ExampleNativeTokenTransfers } from "./2_0_0/example_native_token_transfers.js";
6+
import type { NttQuoter } from "./2_0_0/ntt_quoter.js";
7+
import type { WormholeGovernance } from "./2_0_0/wormhole_governance.js";
8+
9+
export namespace _2_0_0 {
10+
export const idl = { ntt, quoter, governance };
11+
12+
export type RawExampleNativeTokenTransfers = ExampleNativeTokenTransfers;
13+
export type RawNttQuoter = NttQuoter;
14+
export type RawWormholeGovernance = WormholeGovernance;
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"version": "2.0.0",
3+
"name": "dummy_transfer_hook",
4+
"instructions": [
5+
{
6+
"name": "initializeExtraAccountMetaList",
7+
"accounts": [
8+
{
9+
"name": "payer",
10+
"isMut": true,
11+
"isSigner": true
12+
},
13+
{
14+
"name": "extraAccountMetaList",
15+
"isMut": true,
16+
"isSigner": false
17+
},
18+
{
19+
"name": "mint",
20+
"isMut": false,
21+
"isSigner": false
22+
},
23+
{
24+
"name": "tokenProgram",
25+
"isMut": false,
26+
"isSigner": false
27+
},
28+
{
29+
"name": "associatedTokenProgram",
30+
"isMut": false,
31+
"isSigner": false
32+
},
33+
{
34+
"name": "counter",
35+
"isMut": true,
36+
"isSigner": false
37+
},
38+
{
39+
"name": "systemProgram",
40+
"isMut": false,
41+
"isSigner": false
42+
}
43+
],
44+
"args": []
45+
},
46+
{
47+
"name": "transferHook",
48+
"accounts": [
49+
{
50+
"name": "sourceToken",
51+
"isMut": false,
52+
"isSigner": false
53+
},
54+
{
55+
"name": "mint",
56+
"isMut": false,
57+
"isSigner": false
58+
},
59+
{
60+
"name": "destinationToken",
61+
"isMut": false,
62+
"isSigner": false
63+
},
64+
{
65+
"name": "authority",
66+
"isMut": false,
67+
"isSigner": false
68+
},
69+
{
70+
"name": "extraAccountMetaList",
71+
"isMut": false,
72+
"isSigner": false
73+
},
74+
{
75+
"name": "dummyAccount",
76+
"isMut": false,
77+
"isSigner": false,
78+
"docs": [
79+
"computes and the on-chain code correctly passes on the PDA."
80+
]
81+
},
82+
{
83+
"name": "counter",
84+
"isMut": true,
85+
"isSigner": false
86+
}
87+
],
88+
"args": [
89+
{
90+
"name": "amount",
91+
"type": "u64"
92+
}
93+
]
94+
}
95+
],
96+
"accounts": [
97+
{
98+
"name": "Counter",
99+
"type": {
100+
"kind": "struct",
101+
"fields": [
102+
{
103+
"name": "count",
104+
"type": "u64"
105+
}
106+
]
107+
}
108+
}
109+
]
110+
}

0 commit comments

Comments
 (0)