Skip to content

Commit b96a80a

Browse files
authored
Bump Sol BnM LnR Contract versions (#1183)
* Bump Sol BnM LnR Contract versions * Pin solana version to v2 * test lower version * test again * Another test * test * test * now? * More tests * Test * Undo * Add log * Set gossip port
1 parent dc1eb96 commit b96a80a

File tree

8 files changed

+29
-21
lines changed

8 files changed

+29
-21
lines changed

chains/solana/contracts/Cargo.lock

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

chains/solana/contracts/programs/burnmint-token-pool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "burnmint-token-pool"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Created with Anchor"
55
edition = "2021"
66

chains/solana/contracts/programs/lockrelease-token-pool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lockrelease-token-pool"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "Created with Anchor"
55
edition = "2021"
66

chains/solana/contracts/target/idl/burnmint_token_pool.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.1",
2+
"version": "0.1.2",
33
"name": "burnmint_token_pool",
44
"instructions": [
55
{

chains/solana/contracts/target/idl/lockrelease_token_pool.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.1",
2+
"version": "0.1.2",
33
"name": "lockrelease_token_pool",
44
"instructions": [
55
{

chains/solana/contracts/target/types/burnmint_token_pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type BurnmintTokenPool = {
2-
"version": "0.1.1",
2+
"version": "0.1.2",
33
"name": "burnmint_token_pool",
44
"instructions": [
55
{
@@ -947,7 +947,7 @@ export type BurnmintTokenPool = {
947947
};
948948

949949
export const IDL: BurnmintTokenPool = {
950-
"version": "0.1.1",
950+
"version": "0.1.2",
951951
"name": "burnmint_token_pool",
952952
"instructions": [
953953
{

chains/solana/contracts/target/types/lockrelease_token_pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export type LockreleaseTokenPool = {
2-
"version": "0.1.1",
2+
"version": "0.1.2",
33
"name": "lockrelease_token_pool",
44
"instructions": [
55
{
@@ -983,7 +983,7 @@ export type LockreleaseTokenPool = {
983983
};
984984

985985
export const IDL: LockreleaseTokenPool = {
986-
"version": "0.1.1",
986+
"version": "0.1.2",
987987
"name": "lockrelease_token_pool",
988988
"instructions": [
989989
{

chains/solana/contracts/tests/testutils/localvalidator.go

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,50 @@ func SetupLocalSolNode(t *testing.T) string {
2727
}
2828

2929
// helper function to get a set of different random open ports
30-
func getPorts(t *testing.T) (port string, wsPort string, faucetPort string) {
30+
func getPorts(t *testing.T) (rpcPort, wsPort, faucetPort, gossipPort string) {
3131
t.Helper()
32-
3332
attempts := 5
3433

3534
for i := 0; i < attempts; i++ {
36-
port = utils.MustRandomPort(t)
35+
rpcPort = utils.MustRandomPort(t)
36+
37+
portInt, _ := strconv.Atoi(rpcPort)
38+
wsPort = strconv.Itoa(portInt + 1) // WS port must be RPC+1
3739

38-
portInt, _ := strconv.Atoi(port)
39-
wsPort = strconv.Itoa(portInt + 1) // ws port is always +1 from the rpc port, required by solana
4040
if !utils.IsPortOpen(t, wsPort) {
4141
continue
4242
}
4343

4444
faucetPort = utils.MustRandomPort(t)
45-
if faucetPort != port && faucetPort != wsPort {
46-
return
45+
if faucetPort == rpcPort || faucetPort == wsPort {
46+
continue
4747
}
48-
}
4948

49+
gossipPort = utils.MustRandomPort(t)
50+
if gossipPort == rpcPort || gossipPort == wsPort || gossipPort == faucetPort {
51+
continue
52+
}
53+
54+
// All distinct and open
55+
return
56+
}
5057
panic(fmt.Sprintf("unable to find unique open ports after %d attempts", attempts))
5158
}
5259

5360
// SetupLocalSolNode sets up a local solana node via solana cli, and returns the url
5461
func SetupLocalSolNodeWithFlags(t *testing.T, flags ...string) (string, string) {
5562
t.Helper()
5663

57-
port, wsPort, faucetPort := getPorts(t)
64+
rpcPort, wsPort, faucetPort, gossipPort := getPorts(t)
5865

59-
url := "http://127.0.0.1:" + port
66+
url := "http://127.0.0.1:" + rpcPort
6067
wsURL := "ws://127.0.0.1:" + wsPort
6168

6269
args := append([]string{
6370
"--reset",
64-
"--rpc-port", port,
71+
"--rpc-port", rpcPort,
6572
"--faucet-port", faucetPort,
73+
"--gossip-port", gossipPort,
6674
"--ledger", t.TempDir(),
6775
// Configurations to make the local cluster faster
6876
"--ticks-per-slot", "8", // value in mainnet: 64

0 commit comments

Comments
 (0)