Skip to content

Commit

Permalink
solana: bump version to 2.0.0
Browse files Browse the repository at this point in the history
add script to sync/check crate versions
  • Loading branch information
kcsongor authored and johnsaigle committed Jun 6, 2024
1 parent 547ca80 commit a72e72f
Show file tree
Hide file tree
Showing 32 changed files with 8,463 additions and 44 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/solana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ jobs:
cargo build-sbf --features "mainnet"
cargo test-sbf --features "mainnet"
cargo test
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/sync-versions --check
shell: bash

anchor-test:
name: Anchor Test
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion sdk/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test:ci": "jest --config ./jest.config.ts",
"copy:idl": "cp ../../solana/target/idl/*.json ./src/anchor-idl/$IDL_VERSION/",
"copy:types": "cp ../../solana/target/types/*.ts ./src/anchor-idl/$IDL_VERSION/",
"generate": "export IDL_VERSION=`tsx scripts/readVersion.ts` && mkdir -p ./src/anchor-idl/$IDL_VERSION && npm run copy:idl && npm run copy:types",
"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",
"build:contracts": "cd ../../solana && make build"
},
"devDependencies": {
Expand Down
16 changes: 0 additions & 16 deletions sdk/solana/scripts/readVersion.ts

This file was deleted.

15 changes: 15 additions & 0 deletions sdk/solana/src/anchor-idl/2_0_0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import ntt from "./2_0_0/example_native_token_transfers.json";
import quoter from "./2_0_0/ntt_quoter.json";
import governance from "./2_0_0/wormhole_governance.json";

import type { ExampleNativeTokenTransfers } from "./2_0_0/example_native_token_transfers.js";
import type { NttQuoter } from "./2_0_0/ntt_quoter.js";
import type { WormholeGovernance } from "./2_0_0/wormhole_governance.js";

export namespace _2_0_0 {
export const idl = { ntt, quoter, governance };

export type RawExampleNativeTokenTransfers = ExampleNativeTokenTransfers;
export type RawNttQuoter = NttQuoter;
export type RawWormholeGovernance = WormholeGovernance;
}
110 changes: 110 additions & 0 deletions sdk/solana/src/anchor-idl/2_0_0/dummy_transfer_hook.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"version": "2.0.0",
"name": "dummy_transfer_hook",
"instructions": [
{
"name": "initializeExtraAccountMetaList",
"accounts": [
{
"name": "payer",
"isMut": true,
"isSigner": true
},
{
"name": "extraAccountMetaList",
"isMut": true,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "tokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "associatedTokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "counter",
"isMut": true,
"isSigner": false
},
{
"name": "systemProgram",
"isMut": false,
"isSigner": false
}
],
"args": []
},
{
"name": "transferHook",
"accounts": [
{
"name": "sourceToken",
"isMut": false,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "destinationToken",
"isMut": false,
"isSigner": false
},
{
"name": "authority",
"isMut": false,
"isSigner": false
},
{
"name": "extraAccountMetaList",
"isMut": false,
"isSigner": false
},
{
"name": "dummyAccount",
"isMut": false,
"isSigner": false,
"docs": [
"computes and the on-chain code correctly passes on the PDA."
]
},
{
"name": "counter",
"isMut": true,
"isSigner": false
}
],
"args": [
{
"name": "amount",
"type": "u64"
}
]
}
],
"accounts": [
{
"name": "Counter",
"type": {
"kind": "struct",
"fields": [
{
"name": "count",
"type": "u64"
}
]
}
}
]
}
221 changes: 221 additions & 0 deletions sdk/solana/src/anchor-idl/2_0_0/dummy_transfer_hook.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
export type DummyTransferHook = {
"version": "2.0.0",
"name": "dummy_transfer_hook",
"instructions": [
{
"name": "initializeExtraAccountMetaList",
"accounts": [
{
"name": "payer",
"isMut": true,
"isSigner": true
},
{
"name": "extraAccountMetaList",
"isMut": true,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "tokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "associatedTokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "counter",
"isMut": true,
"isSigner": false
},
{
"name": "systemProgram",
"isMut": false,
"isSigner": false
}
],
"args": []
},
{
"name": "transferHook",
"accounts": [
{
"name": "sourceToken",
"isMut": false,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "destinationToken",
"isMut": false,
"isSigner": false
},
{
"name": "authority",
"isMut": false,
"isSigner": false
},
{
"name": "extraAccountMetaList",
"isMut": false,
"isSigner": false
},
{
"name": "dummyAccount",
"isMut": false,
"isSigner": false,
"docs": [
"computes and the on-chain code correctly passes on the PDA."
]
},
{
"name": "counter",
"isMut": true,
"isSigner": false
}
],
"args": [
{
"name": "amount",
"type": "u64"
}
]
}
],
"accounts": [
{
"name": "counter",
"type": {
"kind": "struct",
"fields": [
{
"name": "count",
"type": "u64"
}
]
}
}
]
};

export const IDL: DummyTransferHook = {
"version": "2.0.0",
"name": "dummy_transfer_hook",
"instructions": [
{
"name": "initializeExtraAccountMetaList",
"accounts": [
{
"name": "payer",
"isMut": true,
"isSigner": true
},
{
"name": "extraAccountMetaList",
"isMut": true,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "tokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "associatedTokenProgram",
"isMut": false,
"isSigner": false
},
{
"name": "counter",
"isMut": true,
"isSigner": false
},
{
"name": "systemProgram",
"isMut": false,
"isSigner": false
}
],
"args": []
},
{
"name": "transferHook",
"accounts": [
{
"name": "sourceToken",
"isMut": false,
"isSigner": false
},
{
"name": "mint",
"isMut": false,
"isSigner": false
},
{
"name": "destinationToken",
"isMut": false,
"isSigner": false
},
{
"name": "authority",
"isMut": false,
"isSigner": false
},
{
"name": "extraAccountMetaList",
"isMut": false,
"isSigner": false
},
{
"name": "dummyAccount",
"isMut": false,
"isSigner": false,
"docs": [
"computes and the on-chain code correctly passes on the PDA."
]
},
{
"name": "counter",
"isMut": true,
"isSigner": false
}
],
"args": [
{
"name": "amount",
"type": "u64"
}
]
}
],
"accounts": [
{
"name": "counter",
"type": {
"kind": "struct",
"fields": [
{
"name": "count",
"type": "u64"
}
]
}
}
]
};
Loading

0 comments on commit a72e72f

Please sign in to comment.