Skip to content

Commit 1e60c05

Browse files
kingpinXDskosito
andauthored
test: add a program to verify upgrade of solana gateway program (#81)
* prototyping cpi for withdraw and call * revert msg hash in args * extend poc with remaining accounts * add tss signature to execute function * change sender to be eth address * update test * uncomment tests * fmt and comments * withdraw and call spl * PR comments and cleanup * PR comments refactoring * merge and cleanup * typo * fix typo * generate * add data to hash * add increment nonce instruction * add revert to spl connected * comments * fmt * add some validation of remaining accounts * add a new version of gateway contract used for testing upgrades * format files * format files * add a separate upgrade instruction instead of a field in PDA * move connected contracts to their own directory * add makefile target * add makefile target * use latest rust version * use latest rust version * use latest rust version * use latest rust version * move to examples folder --------- Co-authored-by: skosito <[email protected]>
1 parent 2559ed6 commit 1e60c05

File tree

7 files changed

+1319
-1
lines changed

7 files changed

+1319
-1
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[workspace]
22
members = [
33
"programs/gateway",
4+
"programs/examples/gateway_upgrade",
45
"programs/examples/connected",
56
"programs/examples/connectedSPL"
67
]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ generate:
1414
(cd go-idl && go run ./generator "$$input_file" "$$output_file"); \
1515
(cd go-idl && go fmt $$output_file); \
1616
done
17+
18+
19+
build-gateway-upgrade:
20+
cargo build-sbf --features dev --manifest-path programs/examples/gateway_upgrade/Cargo.toml
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "gateway-upgrade"
3+
version = "0.1.0"
4+
description = "program for testing upgrades on solana network"
5+
edition = "2021"
6+
7+
[lib]
8+
crate-type = ["cdylib", "lib"]
9+
name = "gateway_upgrade"
10+
11+
[features]
12+
dev = []
13+
default = []
14+
cpi = ["no-entrypoint"]
15+
no-entrypoint = []
16+
no-idl = []
17+
no-log-ix-name = []
18+
idl-build = ["anchor-lang/idl-build"]
19+
20+
[dependencies]
21+
anchor-lang = { version = "=0.30.0" }
22+
anchor-spl = { version = "=0.30.0", features = ["idl-build"] }
23+
spl-associated-token-account = "3.0.2"
24+
solana-program = "=1.18.15"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.bpfel-unknown-unknown.dependencies.std]
2+
features = []

0 commit comments

Comments
 (0)