Skip to content

Commit

Permalink
Update anchor to 0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
archseer committed Jan 9, 2022
1 parent e87a8ae commit 9bd3341
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/contract-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
release-artifacts:
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.19.0
image: projectserum/build:v0.20.0
env:
RUSTUP_HOME: "/root/.rustup"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.0
image: projectserum/build:v0.20.0
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Test
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.0
image: projectserum/build:v0.20.0
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
name: Lint
runs-on: ubuntu-latest
container:
image: projectserum/build:v0.18.0
image: projectserum/build:v0.20.0
env:
RUSTUP_HOME: "/root/.rustup"
FORCE_COLOR: 1
Expand Down
2 changes: 1 addition & 1 deletion contracts/Anchor.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
anchor_version = "0.19.0"
anchor_version = "0.20.0"

[registry]
url = "https://anchor.projectserum.com"
Expand Down
49 changes: 25 additions & 24 deletions contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@project-serum/anchor": "^0.19.0",
"@project-serum/anchor": "^0.20.0",
"@solana/spl-token": "^0.1.8",
"@solana/web3.js": "1.30.2",
"@types/chai": "^4.2.22",
Expand Down
2 changes: 1 addition & 1 deletion contracts/programs/access-controller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ localnet = []
default = ["localnet"]

[dependencies]
anchor-lang = "0.19.0"
anchor-lang = "0.20.0"
static_assertions = "1.1.0"
arrayvec = { version = "0.1.0", path = "../../crates/arrayvec" }
4 changes: 2 additions & 2 deletions contracts/programs/ocr2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ localnet = ["access-controller/localnet", "store/localnet"]
default = ["localnet"]

[dependencies]
anchor-lang = "0.19.0"
anchor-spl = "0.19.0"
anchor-lang = "0.20.0"
anchor-spl = "0.20.0"
static_assertions = "1.1.0"
access-controller = { version = "0.1.0", path = "../access-controller", default-features = false, features = ["cpi"] }
store = { version = "0.1.0", path = "../store", default-features = false, features = ["cpi"] }
Expand Down
4 changes: 2 additions & 2 deletions contracts/programs/ocr2/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ pub struct LeftoverPayment {

#[zero_copy]
pub struct Oracles {
xs: [Oracle; 19], // sadly we can't use const https://github.com/project-serum/anchor/issues/632
xs: [Oracle; MAX_ORACLES],
len: u64,
}
arrayvec!(Oracles, Oracle, u64);

#[zero_copy]
pub struct LeftoverPayments {
xs: [LeftoverPayment; 19], // sadly we can't use const https://github.com/project-serum/anchor/issues/632
xs: [LeftoverPayment; MAX_ORACLES],
len: u64,
}
arrayvec!(LeftoverPayments, LeftoverPayment, u64);
Expand Down
2 changes: 1 addition & 1 deletion contracts/programs/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ localnet = ["access-controller/localnet"]
default = ["localnet"]

[dependencies]
anchor-lang = "0.19.0"
anchor-lang = "0.20.0"
access-controller = { version = "0.1.0", path = "../access-controller", default-features = false, features = ["cpi"] }
bytemuck = "1.7.2"
arrayvec = { version = "0.1.0", path = "../../crates/arrayvec" }
4 changes: 3 additions & 1 deletion contracts/programs/store/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use anchor_lang::prelude::*;
use arrayvec::arrayvec;

const MAX_FLAGS: usize = 128;

#[zero_copy]
pub struct Flags {
xs: [Pubkey; 128], // sadly we can't use const https://github.com/project-serum/anchor/issues/632
xs: [Pubkey; MAX_FLAGS],
len: u64,
}

Expand Down
33 changes: 21 additions & 12 deletions contracts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"@ethersproject/logger" "^5.5.0"
hash.js "1.1.7"

"@project-serum/anchor@^0.19.0":
version "0.19.0"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.19.0.tgz#79f1fbe7c3134860ccbfe458a0e09daf79644885"
integrity sha512-cs0LBmJOrL9eJ8MRNqitnzbpCT5QEzVdJmiIjfNV5YaGn1K9vISR7DtISj3Bdl3KBdLqii4CTw1mpHdi8iXUCg==
"@project-serum/anchor@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.20.0.tgz#547f5c0ff7e66809fa7118b2e3abd8087b5ec519"
integrity sha512-p1KOiqGBIbNsopMrSVoPwgxR1iPffsdjMNCOysahTPL9whX2CLX9HQCdopHjYaGl7+SdHRuXml6Wahk/wUmC8g==
dependencies:
"@project-serum/borsh" "^0.2.2"
"@solana/web3.js" "^1.17.0"
Expand Down Expand Up @@ -151,9 +151,9 @@
integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA==

"@types/node@^14.14.37":
version "14.18.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.0.tgz#98df2397f6936bfbff4f089e40e06fa5dd88d32a"
integrity sha512-0GeIl2kmVMXEnx8tg1SlG6Gg8vkqirrW752KqolYo1PHevhhZN3bhJ67qHj+bQaINhX0Ra3TlWwRvMCd9iEfNQ==
version "14.18.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.5.tgz#0dd636fe7b2c6055cbed0d4ca3b7fb540f130a96"
integrity sha512-LMy+vDDcQR48EZdEx5wRX1q/sEl6NdGuHXPnfeL8ixkwCOSZ2qnIyIZmcCbdX0MeRqHhAcHmX+haCbrS8Run+A==

"@types/pbkdf2@^3.0.0":
version "3.1.0"
Expand Down Expand Up @@ -553,7 +553,7 @@ dotenv@10.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==

elliptic@^6.5.2:
elliptic@^6.5.2, elliptic@^6.5.4:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
Expand Down Expand Up @@ -1135,7 +1135,7 @@ scrypt-js@^3.0.0:
resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312"
integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==

secp256k1@^4.0.1, secp256k1@^4.0.2:
secp256k1@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1"
integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==
Expand All @@ -1144,6 +1144,15 @@ secp256k1@^4.0.1, secp256k1@^4.0.2:
node-addon-api "^2.0.0"
node-gyp-build "^4.2.0"

secp256k1@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303"
integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==
dependencies:
elliptic "^6.5.4"
node-addon-api "^2.0.0"
node-gyp-build "^4.2.0"

serialize-javascript@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
Expand Down Expand Up @@ -1313,9 +1322,9 @@ type-detect@^4.0.0, type-detect@^4.0.5:
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==

typescript@^4.4.4:
version "4.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.2.tgz#8ac1fba9f52256fdb06fb89e4122fa6a346c2998"
integrity sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==
version "4.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8"
integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==

utf-8-validate@^5.0.2:
version "5.0.7"
Expand Down
2 changes: 1 addition & 1 deletion gauntlet/packages/gauntlet-solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"@chainlink/gauntlet-core": "0.0.7",
"@project-serum/anchor": "^0.18.0",
"@project-serum/anchor": "^0.20.0",
"@project-serum/borsh": "^0.2.2",
"@solana/web3.js": "^1.30.2"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/anchor-shell.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -it -v $(pwd):/workdir --entrypoint bash projectserum/build:v0.19.0
docker run --rm -it -v $(pwd):/workdir --entrypoint bash projectserum/build:v0.20.0

0 comments on commit 9bd3341

Please sign in to comment.