diff --git a/README.md b/README.md index f002154..491a652 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,11 @@ brew install mdbook Next, clone this repo and serve the book: ```sh -git clone https://github.com/project-serum/anchor-book.git +git clone https://github.com/coral-xyz/anchor-book.git cd anchor-book mdbook serve ``` + The book will be available at `http://localhost:3000` in your browser. ### Run an older version diff --git a/book.toml b/book.toml index 61c4683..c69dc7d 100644 --- a/book.toml +++ b/book.toml @@ -1,5 +1,5 @@ [book] -title = "The Anchor Book v0.24.0" +title = "The Anchor Book v0.29.0" authors = [] language = "en" multilingual = false diff --git a/programs/tic-tac-toe/Anchor.toml b/programs/tic-tac-toe/Anchor.toml index ecfc70d..0fcca07 100644 --- a/programs/tic-tac-toe/Anchor.toml +++ b/programs/tic-tac-toe/Anchor.toml @@ -1,9 +1,6 @@ [programs.localnet] tic_tac_toe = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS" -[registry] -url = "https://anchor.projectserum.com" - [provider] cluster = "localnet" wallet = "~/.config/solana/id.json" diff --git a/programs/tic-tac-toe/Cargo.lock b/programs/tic-tac-toe/Cargo.lock index 19b124b..b86d699 100644 --- a/programs/tic-tac-toe/Cargo.lock +++ b/programs/tic-tac-toe/Cargo.lock @@ -8,178 +8,169 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.5", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] -name = "aho-corasick" -version = "0.7.18" +name = "ahash" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ - "memchr", + "cfg-if", + "getrandom 0.2.11", + "once_cell", + "version_check", + "zerocopy", ] [[package]] name = "anchor-attribute-access-control" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5be76607b9625327c7491daedb99706d8eb68cec67e3c2fe4bdbbe303a0d6c3" +checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2", "quote", - "regex", - "syn", + "syn 1.0.89", ] [[package]] name = "anchor-attribute-account" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ba761139de778852b0bf86e3857d988cd135c15fb4d8ee75b925b9646b5a84" +checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" dependencies = [ "anchor-syn", - "anyhow", - "bs58 0.4.0", + "bs58 0.5.0", "proc-macro2", "quote", - "rustversion", - "syn", + "syn 1.0.89", ] [[package]] name = "anchor-attribute-constant" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e59bb75c94133e1ffeb688144456b572c9ff08120c0c03235c02d7048ca294" +checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" dependencies = [ "anchor-syn", - "proc-macro2", - "syn", + "quote", + "syn 1.0.89", ] [[package]] name = "anchor-attribute-error" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51537dfabe3b50d56c412ff01a3ed9bc76dccd7d6d3991a8ee298258fd37f2ee" +checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" dependencies = [ "anchor-syn", - "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] name = "anchor-attribute-event" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9260684556a09bca3dc8c3b5388c322707ee56b34846498d219979d013fedfa6" +checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] -name = "anchor-attribute-interface" -version = "0.24.1" +name = "anchor-attribute-program" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70262c877203f2716f10cc36d88b777425c0bc8953629934fe729f9cad707d09" +checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" dependencies = [ "anchor-syn", - "anyhow", - "heck", - "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] -name = "anchor-attribute-program" -version = "0.24.1" +name = "anchor-derive-accounts" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3291238f560a2d51c255df4e10269be99c64d4e611d53428b33abbeb642b9db8" +checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" dependencies = [ "anchor-syn", - "anyhow", - "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] -name = "anchor-attribute-state" -version = "0.24.1" +name = "anchor-derive-serde" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c51579b76c0ec6f03f0f581dd32fd52698f065da3d8c5176d84730164c1e2f0" +checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" dependencies = [ "anchor-syn", - "anyhow", + "borsh-derive-internal 0.9.3", "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] -name = "anchor-derive-accounts" -version = "0.24.1" +name = "anchor-derive-space" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c6cceba2f29b42b0fd8d84f9a27bbc732749c4c49d2b25fcecb89be9fd2d8e" +checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" dependencies = [ - "anchor-syn", - "anyhow", "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] name = "anchor-lang" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a524cf43a3859d0715bca53fdfbcb75b0b0028952499bbafd52deaef9df271f4" +checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", "anchor-attribute-constant", "anchor-attribute-error", "anchor-attribute-event", - "anchor-attribute-interface", "anchor-attribute-program", - "anchor-attribute-state", "anchor-derive-accounts", + "anchor-derive-serde", + "anchor-derive-space", "arrayref", "base64 0.13.0", "bincode", - "borsh", + "borsh 0.9.3", "bytemuck", + "getrandom 0.2.11", "solana-program", "thiserror", ] [[package]] name = "anchor-syn" -version = "0.24.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f501db049fbf4e6284413f5b97dddd647f9e8581dd6a31114516b5c8d49b3a1" +checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" dependencies = [ "anyhow", - "bs58 0.3.1", + "bs58 0.5.0", "heck", "proc-macro2", - "proc-macro2-diagnostics", "quote", "serde", "serde_json", - "sha2", - "syn", + "sha2 0.10.8", + "syn 1.0.89", "thiserror", ] @@ -190,28 +181,140 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" [[package]] -name = "arrayref" -version = "0.3.6" +name = "ark-bn254" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] [[package]] -name = "arrayvec" -version = "0.7.2" +name = "ark-ec" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] [[package]] -name = "atty" -version = "0.2.14" +name = "ark-ff" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ - "hermit-abi", - "libc", - "winapi", + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.89", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.89", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.89", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", ] +[[package]] +name = "array-bytes" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "autocfg" version = "1.1.0" @@ -230,6 +333,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + [[package]] name = "bincode" version = "1.3.3" @@ -245,18 +354,27 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "blake3" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "digest 0.10.3", + "digest 0.10.7", ] [[package]] @@ -265,33 +383,36 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding", "generic-array", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] -name = "block-padding" -version = "0.2.1" +name = "borsh" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] [[package]] name = "borsh" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ - "borsh-derive", - "hashbrown", + "borsh-derive 0.10.3", + "hashbrown 0.11.2", ] [[package]] @@ -300,11 +421,24 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate", + "proc-macro2", + "syn 1.0.89", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", "proc-macro-crate", "proc-macro2", - "syn", + "syn 1.0.89", ] [[package]] @@ -315,7 +449,18 @@ checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.89", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.89", ] [[package]] @@ -326,14 +471,19 @@ checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.89", ] [[package]] -name = "bs58" -version = "0.3.1" +name = "borsh-schema-derive-internal" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.89", +] [[package]] name = "bs58" @@ -341,6 +491,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.9.1" @@ -359,22 +518,22 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.8.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e851ca7c24871e7336801608a4797d7376545b6928a10d32d75685687141ead" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.0.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -385,9 +544,13 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "jobserver", + "libc", +] [[package]] name = "cfg-if" @@ -407,9 +570,9 @@ dependencies = [ [[package]] name = "console_log" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" dependencies = [ "log", "web-sys", @@ -417,9 +580,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "cpufeatures" @@ -430,6 +593,39 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -464,11 +660,23 @@ checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core", + "rand_core 0.5.1", + "serde", "subtle", "zeroize", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.89", +] + [[package]] name = "digest" version = "0.9.0" @@ -480,33 +688,20 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.4", "crypto-common", "subtle", ] [[package]] name = "either" -version = "1.6.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "feature-probe" @@ -516,9 +711,9 @@ checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "serde", "typenum", @@ -540,13 +735,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.5" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -555,25 +752,25 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] -name = "heck" -version = "0.3.3" +name = "hashbrown" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "unicode-segmentation", + "ahash 0.8.6", ] [[package]] -name = "hermit-abi" -version = "0.1.19" +name = "heck" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ - "libc", + "unicode-segmentation", ] [[package]] @@ -598,25 +795,26 @@ dependencies = [ ] [[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "instant" -version = "0.1.12" +name = "im" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" dependencies = [ - "cfg-if", + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "rayon", + "serde", + "sized-chunks", + "typenum", + "version_check", ] [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -627,20 +825,32 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] [[package]] name = "lazy_static" @@ -650,9 +860,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.121" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efaa7b300f3b5fe8eb6bf21ce3895e1751d9665086af2d64b42f19701015ff4f" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libsecp256k1" @@ -667,9 +877,9 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.7.3", "serde", - "sha2", + "sha2 0.9.9", "typenum", ] @@ -714,26 +924,37 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memmap2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ - "cfg-if", + "libc", ] [[package]] -name = "memchr" -version = "2.4.1" +name = "memoffset" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] [[package]] -name = "memmap2" -version = "0.5.3" +name = "num-bigint" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ - "libc", + "autocfg", + "num-integer", + "num-traits", ] [[package]] @@ -744,7 +965,17 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.89", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", ] [[package]] @@ -758,9 +989,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.10.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -770,27 +1001,40 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", - "instant", "libc", "redox_syscall", "smallvec", - "winapi", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", ] [[package]] @@ -810,31 +1054,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "proc-macro2-diagnostics" -version = "0.9.1" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ - "proc-macro2", - "quote", - "syn", - "version_check", - "yansi", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.16" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -847,11 +1078,21 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.2.2", + "rand_core 0.5.1", "rand_hc", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -859,7 +1100,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] @@ -871,40 +1122,67 @@ dependencies = [ "getrandom 0.1.16", ] +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.11", +] + [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", ] [[package]] -name = "redox_syscall" -version = "0.2.13" +name = "rand_xoshiro" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ - "bitflags", + "rand_core 0.6.4", +] + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", ] [[package]] -name = "regex" -version = "1.5.5" +name = "rayon-core" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "regex-syntax" -version = "0.6.25" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -917,9 +1195,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" @@ -941,38 +1219,38 @@ checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" [[package]] name = "serde" -version = "1.0.136" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.5" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -992,16 +1270,35 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha3" -version = "0.9.1" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", + "digest 0.10.7", "keccak", - "opaque-debug", +] + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", ] [[package]] @@ -1012,101 +1309,115 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "solana-frozen-abi" -version = "1.9.15" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0a9783aac947e789852cbd6f4650521f8f6f744cba5fc0524a8bc104fa11e01" +checksum = "7e77bfd59ad4e64c0f06fbcbe16d58f3a40bdbcc050fb78fc7134a55a5c290b9" dependencies = [ + "ahash 0.8.6", + "blake3", + "block-buffer 0.10.4", "bs58 0.4.0", "bv", + "byteorder", + "cc", + "either", "generic-array", + "getrandom 0.1.16", + "im", + "lazy_static", "log", "memmap2", + "once_cell", + "rand_core 0.6.4", "rustc_version", "serde", + "serde_bytes", "serde_derive", - "sha2", + "serde_json", + "sha2 0.10.8", "solana-frozen-abi-macro", - "solana-logger", + "subtle", "thiserror", ] [[package]] name = "solana-frozen-abi-macro" -version = "1.9.15" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32ebf882f69105e64e283966d9ce0dd22696aec8b8de9bb6b61ea26c7fc896a" +checksum = "992b866b9f0510fd3c290afe6a37109ae8d15b74fa24e3fb6d164be2971ee94f" dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn", -] - -[[package]] -name = "solana-logger" -version = "1.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8b0587f360598ef3a9444e05dce63e701a5c008c54101f54707b5f5852ec09" -dependencies = [ - "env_logger", - "lazy_static", - "log", + "syn 2.0.39", ] [[package]] name = "solana-program" -version = "1.9.15" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252118d7b708b0bec7e1ec5aeb3397843c8d9dbe8946f04fcebed06c5d3a32c7" +checksum = "aa5ac2110c5b927d6114b2d4f32af7f749fde0e6fd8f34777407ce89d66630be" dependencies = [ - "base64 0.13.0", + "ark-bn254", + "ark-ec", + "ark-ff", + "ark-serialize", + "array-bytes", + "base64 0.21.5", "bincode", "bitflags", "blake3", - "borsh", - "borsh-derive", + "borsh 0.10.3", + "borsh 0.9.3", "bs58 0.4.0", "bv", "bytemuck", + "cc", "console_error_panic_hook", "console_log", "curve25519-dalek", - "getrandom 0.1.16", + "getrandom 0.2.11", "itertools", "js-sys", "lazy_static", + "libc", "libsecp256k1", "log", + "memoffset", + "num-bigint", "num-derive", "num-traits", "parking_lot", - "rand", + "rand 0.7.3", + "rand_chacha 0.2.2", "rustc_version", "rustversion", "serde", "serde_bytes", "serde_derive", - "sha2", + "serde_json", + "sha2 0.10.8", "sha3", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-logger", "solana-sdk-macro", "thiserror", + "tiny-bip39", "wasm-bindgen", + "zeroize", ] [[package]] name = "solana-sdk-macro" -version = "1.9.15" +version = "1.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6340ca326c8a919575e594a3ca71a380c233ae2615f62acd15c7af4f2aafb21d" +checksum = "9fe4363d2503a75325ec94aa18b063574edb3454d38840e01c5af477b3b0689d" dependencies = [ "bs58 0.4.0", "proc-macro2", "quote", "rustversion", - "syn", + "syn 2.0.39", ] [[package]] @@ -1127,32 +1438,34 @@ dependencies = [ ] [[package]] -name = "termcolor" -version = "1.1.3" +name = "syn" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ - "winapi-util", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1164,6 +1477,40 @@ dependencies = [ "num-traits", ] +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml" version = "0.5.8" @@ -1179,6 +1526,21 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.9.0" @@ -1205,15 +1567,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1221,24 +1583,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1246,22 +1608,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" @@ -1274,44 +1636,98 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.3.9" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows_aarch64_gnullvm" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows_aarch64_msvc" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows_i686_gnu" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "yansi" -version = "0.5.0" +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "zeroize" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/programs/tic-tac-toe/migrations/deploy.ts b/programs/tic-tac-toe/migrations/deploy.ts index 325cf3d..82fb175 100644 --- a/programs/tic-tac-toe/migrations/deploy.ts +++ b/programs/tic-tac-toe/migrations/deploy.ts @@ -2,11 +2,11 @@ // single deploy script that's invoked from the CLI, injecting a provider // configured from the workspace's Anchor.toml. -const anchor = require("@project-serum/anchor"); +const anchor = require("@coral-xyz/anchor"); module.exports = async function (provider) { // Configure client to use the provider. anchor.setProvider(provider); // Add your deploy script here. -} +}; diff --git a/programs/tic-tac-toe/package.json b/programs/tic-tac-toe/package.json index 80a6b53..5403713 100644 --- a/programs/tic-tac-toe/package.json +++ b/programs/tic-tac-toe/package.json @@ -1,14 +1,14 @@ { - "dependencies": { - "@project-serum/anchor": "0.24.1" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/chai": "^4.3.0", - "chai": "^4.3.4", - "chai-as-promised": "^7.1.1", - "mocha": "^9.0.3", - "ts-mocha": "^8.0.0", - "typescript": "^4.3.5" - } + "dependencies": { + "@coral-xyz/anchor": "0.29.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/chai": "^4.3.0", + "chai": "^4.3.4", + "chai-as-promised": "^7.1.1", + "mocha": "^9.0.3", + "ts-mocha": "^10.0.0", + "typescript": "^4.3.5" + } } diff --git a/programs/tic-tac-toe/programs/tic-tac-toe/Cargo.toml b/programs/tic-tac-toe/programs/tic-tac-toe/Cargo.toml index 3a0b821..08a0d76 100644 --- a/programs/tic-tac-toe/programs/tic-tac-toe/Cargo.toml +++ b/programs/tic-tac-toe/programs/tic-tac-toe/Cargo.toml @@ -16,6 +16,6 @@ cpi = ["no-entrypoint"] default = [] [dependencies] -anchor-lang = "=0.24.1" +anchor-lang = "0.29.0" num-traits = "0.2" num-derive = "0.3" diff --git a/programs/tic-tac-toe/tests/tic-tac-toe.ts b/programs/tic-tac-toe/tests/tic-tac-toe.ts index 5d3c379..e0a2ab1 100644 --- a/programs/tic-tac-toe/tests/tic-tac-toe.ts +++ b/programs/tic-tac-toe/tests/tic-tac-toe.ts @@ -1,5 +1,5 @@ -import * as anchor from '@project-serum/anchor'; -import { AnchorError, Program } from '@project-serum/anchor'; +import * as anchor from '@coral-xyz/anchor'; +import { AnchorError, Program } from '@coral-xyz/anchor'; import { TicTacToe } from '../target/types/tic_tac_toe'; import chai from 'chai'; import chaiAsPromised from 'chai-as-promised'; diff --git a/programs/tic-tac-toe/tsconfig.json b/programs/tic-tac-toe/tsconfig.json index cd5d2e3..26e67f6 100644 --- a/programs/tic-tac-toe/tsconfig.json +++ b/programs/tic-tac-toe/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "types": ["mocha", "chai"], - "typeRoots": ["./node_modules/@types"], - "lib": ["es2015"], + "lib": ["es2020"], "module": "commonjs", "target": "es6", - "esModuleInterop": true + "esModuleInterop": true, + "skipLibCheck": true } } diff --git a/programs/tic-tac-toe/yarn.lock b/programs/tic-tac-toe/yarn.lock index 05869c0..833dfee 100644 --- a/programs/tic-tac-toe/yarn.lock +++ b/programs/tic-tac-toe/yarn.lock @@ -2,95 +2,80 @@ # yarn lockfile v1 -"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.7.tgz#03ff99f64106588c9c403c6ecb8c3bafbbdff1fa" - integrity sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ== - dependencies: - regenerator-runtime "^0.13.4" - -"@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/sha2@^5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" - integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - hash.js "1.1.7" - -"@project-serum/anchor@0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.1.tgz#521c3d610d3db7e24f143736e9c945b54fb8ef85" - integrity sha512-Oab6rPKsoBKf7/m/AyZcx3ahzcRiOFbqYRoDX6Gnxiqeu2zLKS+LyV6v/2XEVnwhIhOtwETtsgSZAwbqjM5Ywg== - dependencies: - "@project-serum/borsh" "^0.2.5" - "@solana/web3.js" "^1.36.0" - base64-js "^1.5.1" +"@babel/runtime@^7.17.2", "@babel/runtime@^7.23.2": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.4.tgz#36fa1d2b36db873d25ec631dcc4923fdc1cf2e2e" + integrity sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg== + dependencies: + regenerator-runtime "^0.14.0" + +"@coral-xyz/anchor@0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.29.0.tgz#bd0be95bedfb30a381c3e676e5926124c310ff12" + integrity sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA== + dependencies: + "@coral-xyz/borsh" "^0.29.0" + "@noble/hashes" "^1.3.1" + "@solana/web3.js" "^1.68.0" bn.js "^5.1.2" bs58 "^4.0.1" buffer-layout "^1.2.2" - camelcase "^5.3.1" + camelcase "^6.3.0" cross-fetch "^3.1.5" crypto-hash "^1.3.0" eventemitter3 "^4.0.7" - js-sha256 "^0.9.0" pako "^2.0.3" snake-case "^3.0.4" + superstruct "^0.15.4" toml "^3.0.0" -"@project-serum/borsh@^0.2.5": - version "0.2.5" - resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.5.tgz#6059287aa624ecebbfc0edd35e4c28ff987d8663" - integrity sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q== +"@coral-xyz/borsh@^0.29.0": + version "0.29.0" + resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.29.0.tgz#79f7045df2ef66da8006d47f5399c7190363e71f" + integrity sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ== dependencies: bn.js "^5.1.2" buffer-layout "^1.2.0" -"@solana/buffer-layout@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-3.0.0.tgz#b9353caeb9a1589cb77a1b145bcb1a9a93114326" - integrity sha512-MVdgAKKL39tEs0l8je0hKaXLQFb7Rdfb0Xg2LjFZd8Lfdazkg6xiS98uAZrEKvaoF3i4M95ei9RydkGIDMeo3w== +"@noble/curves@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: - buffer "~6.0.3" + "@noble/hashes" "1.3.2" + +"@noble/hashes@1.3.2", "@noble/hashes@^1.3.1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@solana/web3.js@^1.36.0": - version "1.36.0" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.36.0.tgz#79d7d5217b49b80139f4de68953adc5b9a9a264f" - integrity sha512-RNT1451iRR7TyW7EJKMCrH/0OXawIe4zVm0DWQASwXlR/u1jmW6FrmH0lujIh7cGTlfOVbH+2ZU9AVUPLBFzwA== +"@solana/buffer-layout@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15" + integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA== dependencies: - "@babel/runtime" "^7.12.5" - "@ethersproject/sha2" "^5.5.0" - "@solana/buffer-layout" "^3.0.0" - bn.js "^5.0.0" - borsh "^0.4.0" + buffer "~6.0.3" + +"@solana/web3.js@^1.68.0": + version "1.87.6" + resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.87.6.tgz#6744cfc5f4fc81e0f58241c0a92648a7320bb3bf" + integrity sha512-LkqsEBgTZztFiccZZXnawWa8qNCATEqE97/d0vIwjTclmVlc8pBpD1DmjfVHtZ1HS5fZorFlVhXfpwnCNDZfyg== + dependencies: + "@babel/runtime" "^7.23.2" + "@noble/curves" "^1.2.0" + "@noble/hashes" "^1.3.1" + "@solana/buffer-layout" "^4.0.0" + agentkeepalive "^4.3.0" + bigint-buffer "^1.1.5" + bn.js "^5.2.1" + borsh "^0.7.0" bs58 "^4.0.1" - buffer "6.0.1" - cross-fetch "^3.1.4" - jayson "^3.4.4" - js-sha3 "^0.8.0" - rpc-websockets "^7.4.2" - secp256k1 "^4.0.2" + buffer "6.0.3" + fast-stable-stringify "^1.0.0" + jayson "^4.1.0" + node-fetch "^2.6.12" + rpc-websockets "^7.5.1" superstruct "^0.14.2" - tweetnacl "^1.0.0" - -"@types/bn.js@^4.11.5": - version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== - dependencies: - "@types/node" "*" "@types/chai@^4.3.0": version "4.3.0" @@ -104,25 +89,11 @@ dependencies: "@types/node" "*" -"@types/express-serve-static-core@^4.17.9": - version "4.17.27" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.27.tgz#7a776191e47295d2a05962ecbb3a4ce97e38b401" - integrity sha512-e/sVallzUTPdyOTiqi8O8pMdBBphscvI6E4JYaKlja4Lm+zh7UFSSdW5VMkRbhDtmrONqOUHOXRguPsDckzxNA== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.159": - version "4.14.178" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" - integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== - "@types/mocha@^9.0.0": version "9.0.0" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" @@ -138,16 +109,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.41.tgz#81d7734c5257da9f04354bd9084a6ebbdd5198a5" integrity sha512-f6xOqucbDirG7LOzedpvzjP3UTmHttRou3Mosx3vL9wr9AIQGhcPgVnqa8ihpZYnxyM1rxeNCvTyukPKZtq10Q== -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - "@types/ws@^7.4.4": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -168,6 +129,13 @@ JSONStream@^1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" +agentkeepalive@^4.3.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" + integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== + dependencies: + humanize-ms "^1.2.1" + ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -220,33 +188,46 @@ base-x@^3.0.2: dependencies: safe-buffer "^5.0.1" -base64-js@^1.3.1, base64-js@^1.5.1: +base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +bigint-buffer@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" + integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== + dependencies: + bindings "^1.3.0" + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" -bn.js@^5.0.0, bn.js@^5.1.2: +bn.js@^5.1.2: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -borsh@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.4.0.tgz#9dd6defe741627f1315eac2a73df61421f6ddb9f" - integrity sha512-aX6qtLya3K0AkT66CmYWCCDr77qsE9arV05OmdFpmat9qu8Pg9J5tBUPDztAW5fNh/d/MyVG/OYziP52Ndzx1g== +bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +borsh@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" + integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA== dependencies: - "@types/bn.js" "^4.11.5" - bn.js "^5.0.0" + bn.js "^5.2.0" bs58 "^4.0.0" text-encoding-utf-8 "^1.0.2" @@ -265,11 +246,6 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -292,15 +268,7 @@ buffer-layout@^1.2.0, buffer-layout@^1.2.2: resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5" integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA== -buffer@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.1.tgz#3cbea8c1463e5a0779e30b66d4c88c6ffa182ac2" - integrity sha512-rVAXBwEcEoYtxnHSO5iWyhzV/O1WMtkUYWlfdLS7FjU4PnSJJHEfHXi/uHPI5EwltmOA794gN3bm3/pzuctWjQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" - -buffer@~6.0.3: +buffer@6.0.3, buffer@~6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== @@ -315,12 +283,7 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "^4.3.0" -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: +camelcase@^6.0.0, camelcase@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== @@ -372,11 +335,6 @@ chokidar@3.5.2: optionalDependencies: fsevents "~2.3.2" -circular-json@^0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.5.9.tgz#932763ae88f4f7dead7a0d09c8a51a4743a53b1d" - integrity sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ== - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -408,13 +366,6 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -cross-fetch@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" - integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== - dependencies: - node-fetch "2.6.1" - cross-fetch@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" @@ -469,19 +420,6 @@ dot-case@^3.0.4: no-case "^3.0.4" tslib "^2.0.3" -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== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -519,6 +457,16 @@ eyes@^0.1.8: resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= +fast-stable-stringify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" + integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -588,27 +536,17 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - he@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" + ms "^2.0.0" ieee754@^1.2.1: version "1.2.1" @@ -623,7 +561,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@^2.0.4: +inherits@2: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -677,14 +615,12 @@ isomorphic-ws@^4.0.1: resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== -jayson@^3.4.4: - version "3.6.6" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-3.6.6.tgz#189984f624e398f831bd2be8e8c80eb3abf764a1" - integrity sha512-f71uvrAWTtrwoww6MKcl9phQTC+56AopLyEenWvKVAIMz+q0oVGj6tenLZ7Z6UiPBkJtKLj4kt0tACllFQruGQ== +jayson@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.0.tgz#60dc946a85197317f2b1439d672a8b0a99cea2f9" + integrity sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A== dependencies: "@types/connect" "^3.4.33" - "@types/express-serve-static-core" "^4.17.9" - "@types/lodash" "^4.14.159" "@types/node" "^12.12.54" "@types/ws" "^7.4.4" JSONStream "^1.3.5" @@ -694,20 +630,9 @@ jayson@^3.4.4: eyes "^0.1.8" isomorphic-ws "^4.0.1" json-stringify-safe "^5.0.1" - lodash "^4.17.20" uuid "^8.3.2" ws "^7.4.5" -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - -js-sha3@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - js-yaml@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" @@ -739,11 +664,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash@^4.17.20: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - log-symbols@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" @@ -764,16 +684,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -828,7 +738,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3: +ms@2.1.3, ms@^2.0.0: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -846,16 +756,6 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - node-fetch@2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -863,7 +763,14 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" -node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: +node-fetch@^2.6.12: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + +node-gyp-build@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== @@ -933,26 +840,25 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -rpc-websockets@^7.4.2: - version "7.4.16" - resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.4.16.tgz#eb701cdef577d4357ba5f526d50e25f370396fac" - integrity sha512-0b7OVhutzwRIaYAtJo5tqtaQTWKfwAsKnaThOSOy+VkhVdleNUgb8eZnWSdWITRZZEigV5uPEIDr5KZe4DBrdQ== +rpc-websockets@^7.5.1: + version "7.8.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.8.0.tgz#1bcf571f65c51803e81f0824e9540a0da35a5287" + integrity sha512-AStkq6KDvSAmA4WiwlK1pDvj/33BWmExTATUokC0v+NhWekXSTNzXS5OGXeYwq501/pj6lBZMofg/h4dx4/tCg== dependencies: - "@babel/runtime" "^7.11.2" - circular-json "^0.5.9" + "@babel/runtime" "^7.17.2" eventemitter3 "^4.0.7" - uuid "^8.3.0" - ws "^7.4.5" + uuid "^8.3.2" + ws "^8.5.0" optionalDependencies: bufferutil "^4.0.1" utf-8-validate "^5.0.2" @@ -962,15 +868,6 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -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" @@ -1030,6 +927,11 @@ superstruct@^0.14.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^0.15.4: + version "0.15.5" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab" + integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ== + supports-color@8.1.1: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" @@ -1071,10 +973,10 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= -ts-mocha@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" - integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== +ts-mocha@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-10.0.0.tgz#41a8d099ac90dbbc64b06976c5025ffaebc53cb9" + integrity sha512-VRfgDO+iiuJFlNB18tzOfypJ21xn2xbuZyDvJvqpTbWgkAgD17ONGr8t+Tl8rcBtOBdjXp5e/Rk+d39f7XBHRw== dependencies: ts-node "7.0.1" optionalDependencies: @@ -1109,11 +1011,6 @@ tslib@^2.0.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== -tweetnacl@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -1131,7 +1028,7 @@ utf-8-validate@^5.0.2: dependencies: node-gyp-build "^4.3.0" -uuid@^8.3.0, uuid@^8.3.2: +uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -1180,6 +1077,11 @@ ws@^7.4.5: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.6.tgz#e59fc509fb15ddfb65487ee9765c5a51dec5fe7b" integrity sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA== +ws@^8.5.0: + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" diff --git a/src/anchor_in_depth/CPIs.md b/src/anchor_in_depth/CPIs.md index b1d0f4c..929def7 100644 --- a/src/anchor_in_depth/CPIs.md +++ b/src/anchor_in_depth/CPIs.md @@ -7,6 +7,7 @@ Consider the following example of a puppet and a puppet master. Admittedly, it i ## Setting up basic CPI functionality Create a new workspace + ``` anchor init puppet ``` @@ -56,9 +57,11 @@ pub struct Data { There's nothing special happening here. It's a pretty simple program! The interesting part is how it interacts with the next program we are going to create. Run + ``` anchor new puppet-master ``` + inside the workspace and copy the following code: ```rust,ignore @@ -91,6 +94,7 @@ pub struct PullStrings<'info> { ``` Also add the line `puppet_master = "HmbTLCmaGvZhKnn1Zfa1JVnp7vkMV4DYVxPLWBVoN65L"` in the `[programs.localnet]` section of your `Anchor.toml`. Finally, import the puppet program into the puppet-master program by adding the following line to the `[dependencies]` section of the `Cargo.toml` file inside the `puppet-master` program folder: + ```toml puppet = { path = "../puppet", features = ["cpi"]} ``` @@ -100,6 +104,7 @@ The `features = ["cpi"]` is used so we can not only use puppet's types but also In the case of the puppet program, the puppet-master uses the `SetData` instruction builder struct provided by the `puppet::cpi::accounts` module to submit the accounts the `SetData` instruction of the puppet program expects. Then, the puppet-master creates a new cpi context and passes it to the `puppet::cpi::set_data` cpi function. This function has the exact same function as the `set_data` function in the puppet program with the exception that it expects a `CpiContext` instead of a `Context`. Setting up a CPI can distract from the business logic of the program so it's recommended to move the CPI setup into the `impl` block of the instruction. The puppet-master program then looks like this: + ```rust,ignore use anchor_lang::prelude::*; use puppet::cpi::accounts::SetData; @@ -135,43 +140,48 @@ impl<'info> PullStrings<'info> { ``` We can verify that everything works as expected by replacing the contents of the `puppet.ts` file with: + ```ts -import * as anchor from '@project-serum/anchor'; -import { Program } from '@project-serum/anchor'; -import { Keypair } from '@solana/web3.js'; -import { expect } from 'chai'; -import { Puppet } from '../target/types/puppet'; -import { PuppetMaster } from '../target/types/puppet_master'; - -describe('puppet', () => { +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { Keypair } from "@solana/web3.js"; +import { expect } from "chai"; +import { Puppet } from "../target/types/puppet"; +import { PuppetMaster } from "../target/types/puppet_master"; + +describe("puppet", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const puppetProgram = anchor.workspace.Puppet as Program; - const puppetMasterProgram = anchor.workspace.PuppetMaster as Program; + const puppetMasterProgram = anchor.workspace + .PuppetMaster as Program; const puppetKeypair = Keypair.generate(); - it('Does CPI!', async () => { + it("Does CPI!", async () => { await puppetProgram.methods - .initialize() - .accounts({ - puppet: puppetKeypair.publicKey, - user: provider.wallet.publicKey, - }) - .signers([puppetKeypair]) - .rpc(); + .initialize() + .accounts({ + puppet: puppetKeypair.publicKey, + user: provider.wallet.publicKey, + }) + .signers([puppetKeypair]) + .rpc(); await puppetMasterProgram.methods - .pullStrings(new anchor.BN(42)) - .accounts({ - puppetProgram: puppetProgram.programId, - puppet: puppetKeypair.publicKey - }) - .rpc(); - - expect((await puppetProgram.account.data - .fetch(puppetKeypair.publicKey)).data.toNumber()).to.equal(42); + .pullStrings(new anchor.BN(42)) + .accounts({ + puppetProgram: puppetProgram.programId, + puppet: puppetKeypair.publicKey, + }) + .rpc(); + + expect( + ( + await puppetProgram.account.data.fetch(puppetKeypair.publicKey) + ).data.toNumber() + ).to.equal(42); }); }); ``` @@ -183,6 +193,7 @@ and running `anchor test`. CPIs extend the privileges of the caller to the callee. The puppet account was passed as a mutable account to the puppet-master but it was still mutable in the puppet program as well (otherwise the `expect` in the test would've failed). The same applies to signatures. If you want to prove this for yourself, add an `authority` field to the `Data` struct in the puppet program. + ```rust,ignore #[account] pub struct Data { @@ -192,6 +203,7 @@ pub struct Data { ``` and adjust the `initialize` function: + ```rust,ignore pub fn initialize(ctx: Context, authority: Pubkey) -> Result<()> { ctx.accounts.puppet.authority = authority; @@ -200,6 +212,7 @@ pub fn initialize(ctx: Context, authority: Pubkey) -> Result<()> { ``` Add `32` to the `space` constraint of the `puppet` field for the `Pubkey` field in the `Data` struct. + ```rust,ignore #[derive(Accounts)] pub struct Initialize<'info> { @@ -212,6 +225,7 @@ pub struct Initialize<'info> { ``` Then, adjust the `SetData` validation struct: + ```rust,ignore #[derive(Accounts)] pub struct SetData<'info> { @@ -224,6 +238,7 @@ pub struct SetData<'info> { The `has_one` constraint checks that `puppet.authority = authority.key()`. The puppet-master program now also needs adjusting: + ```rust,ignore use anchor_lang::prelude::*; use puppet::cpi::accounts::SetData; @@ -266,45 +281,49 @@ impl<'info> PullStrings<'info> { Finally, change the test: ```ts -import * as anchor from '@project-serum/anchor'; -import { Program } from '@project-serum/anchor'; -import { Keypair } from '@solana/web3.js'; -import { Puppet } from '../target/types/puppet'; -import { PuppetMaster } from '../target/types/puppet_master'; -import { expect } from 'chai'; - -describe('puppet', () => { +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { Keypair } from "@solana/web3.js"; +import { Puppet } from "../target/types/puppet"; +import { PuppetMaster } from "../target/types/puppet_master"; +import { expect } from "chai"; + +describe("puppet", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const puppetProgram = anchor.workspace.Puppet as Program; - const puppetMasterProgram = anchor.workspace.PuppetMaster as Program; + const puppetMasterProgram = anchor.workspace + .PuppetMaster as Program; const puppetKeypair = Keypair.generate(); const authorityKeypair = Keypair.generate(); - it('Does CPI!', async () => { + it("Does CPI!", async () => { await puppetProgram.methods - .initialize(authorityKeypair.publicKey) - .accounts({ - puppet: puppetKeypair.publicKey, - user: provider.wallet.publicKey, - }) - .signers([puppetKeypair]) - .rpc(); + .initialize(authorityKeypair.publicKey) + .accounts({ + puppet: puppetKeypair.publicKey, + user: provider.wallet.publicKey, + }) + .signers([puppetKeypair]) + .rpc(); await puppetMasterProgram.methods - .pullStrings(new anchor.BN(42)) - .accounts({ - puppetProgram: puppetProgram.programId, - puppet: puppetKeypair.publicKey, - authority: authorityKeypair.publicKey - }) - .signers([authorityKeypair]) - .rpc(); - - expect((await puppetProgram.account.data - .fetch(puppetKeypair.publicKey)).data.toNumber()).to.equal(42); + .pullStrings(new anchor.BN(42)) + .accounts({ + puppetProgram: puppetProgram.programId, + puppet: puppetKeypair.publicKey, + authority: authorityKeypair.publicKey, + }) + .signers([authorityKeypair]) + .rpc(); + + expect( + ( + await puppetProgram.account.data.fetch(puppetKeypair.publicKey) + ).data.toNumber() + ).to.equal(42); }); }); ``` @@ -325,6 +344,7 @@ In the puppet program, the `Account<'info, T>` type is used for the `puppet` acc the caller's account does not change during the instruction. You can easily see this for yourself by adding the following right after the `puppet::cpi::set_data(ctx.accounts.set_data_ctx(), data)` cpi call. + ```rust,ignore puppet::cpi::set_data(ctx.accounts.set_data_ctx(), data)?; if ctx.accounts.puppet.data != 42 { @@ -332,6 +352,7 @@ if ctx.accounts.puppet.data != 42 { } Ok(()) ``` + Now your test will fail. But why? After all the test used to pass, so the cpi definitely did change the `data` field to `42`. The reason the `data` field has not been updated to `42` in the caller is that at the beginning of the instruction the `Account<'info, T>` type deserializes the incoming bytes into a new struct. This struct is no longer connected to the underlying data in the account. The CPI changes the data in the underlying account but since the struct in the caller has no connection to the underlying account the struct in the caller remains unchanged. diff --git a/src/anchor_in_depth/PDAs.md b/src/anchor_in_depth/PDAs.md index c3364ab..cecabae 100644 --- a/src/anchor_in_depth/PDAs.md +++ b/src/anchor_in_depth/PDAs.md @@ -12,6 +12,7 @@ Unlike normal addresses, PDAs are not public keys and therefore do not have an a Before we dive into how to use PDAs in anchor, here's a short explainer on what PDAs are. PDAs are created by hashing a number of seeds the user can choose and the id of a program: + ```rust,ignore // pseudo code let pda = hash(seeds, program_id); @@ -20,6 +21,7 @@ let pda = hash(seeds, program_id); The seeds can be anything. A pubkey, a string, an array of numbers etc. There's a 50% chance that this hash function results in a public key (but PDAs are not public keys), so a bump has to be searched for so that we get a PDA: + ```rust,ignore // pseudo code fn find_pda(seeds, program_id) { @@ -67,6 +69,7 @@ The `authority` would be the user the accounts belongs to. This approach creates the following problem. It's easy to go from the user stats account to the user account address (just read the `authority` field) but if you just have the user account address (which is more likely), how do you find the user stats account? You can't. This is a problem because your game probably has instructions that require both the user stats account and its authority which means the client needs to pass those accounts into the instruction (for example, a `ChangeName` instruction). So maybe the frontend could store a mapping between a user's account address and a user's info address in local storage. This works until the user accidentally wipes their local storage. With PDAs you can have a layout like this: + ```rust,ignore pub struct UserStats { level: u16, @@ -74,6 +77,7 @@ pub struct UserStats { bump: u8 } ``` + and encode the information about the relationship between the user and the user stats account in the address of the user stats account itself. Reusing the pseudo code from above: @@ -84,7 +88,8 @@ let seeds = [b"user-stats", authority]; let (pda, bump) = find_pda(seeds, game_program_id); ``` -When a user connects to your website, this pda calculation can be done client-side using their user account address as the `authority`. The resulting pda then serves as the address of the user's stats account. The `b"user-stats"` is added in case there are other account types that are also PDAs. If there were an inventory account, it could be inferred using these seeds: +When a user connects to your website, this pda calculation can be done client-side using their user account address as the `authority`. The resulting pda then serves as the address of the user's stats account. The `b"user-stats"` is added in case there are other account types that are also PDAs. If there were an inventory account, it could be inferred using these seeds: + ```rust,ignore let seeds = [b"inventory", authority]; ``` @@ -94,6 +99,7 @@ To summarize, we have used PDAs to create a mapping between a user and their use #### How to build PDA hashmaps in Anchor Continuing with the example from the previous sections, create a new workspace + ``` anchor init game ``` @@ -151,6 +157,7 @@ Then, in the handler, we access `ctx.bumps.user_stats` to get the bump anchor fo account as an extra property. If we then want to use the created pda in a different instruction, we can add a new validation struct (This will check that the `user_stats` account is the pda created by running `hash(seeds, user_stats.bump, game_program_id)`): + ```rust,ignore // validation struct #[derive(Accounts)] @@ -160,7 +167,9 @@ pub struct ChangeUserName<'info> { pub user_stats: Account<'info, UserStats>, } ``` + and another handler function: + ```rust,ignore // handler function (add this next to the create_user_stats function in the game module) pub fn change_user_name(ctx: Context, new_name: String) -> Result<()> { @@ -176,27 +185,26 @@ pub fn change_user_name(ctx: Context, new_name: String) -> Resul Finally, let's add a test. Copy this into `game.ts` ```ts -import * as anchor from '@project-serum/anchor'; -import { Program } from '@project-serum/anchor'; -import { PublicKey } from '@solana/web3.js'; -import { Game } from '../target/types/game'; -import { expect } from 'chai'; +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { PublicKey } from "@solana/web3.js"; +import { Game } from "../target/types/game"; +import { expect } from "chai"; -describe('game', async() => { +describe("game", async () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const program = anchor.workspace.Game as Program; - it('Sets and changes name!', async () => { - const [userStatsPDA, _] = await PublicKey - .findProgramAddress( - [ - anchor.utils.bytes.utf8.encode("user-stats"), - provider.wallet.publicKey.toBuffer() - ], - program.programId - ); + it("Sets and changes name!", async () => { + const [userStatsPDA, _] = await PublicKey.findProgramAddress( + [ + anchor.utils.bytes.utf8.encode("user-stats"), + provider.wallet.publicKey.toBuffer(), + ], + program.programId + ); await program.methods .createUserStats("brian") @@ -206,17 +214,21 @@ describe('game', async() => { }) .rpc(); - expect((await program.account.userStats.fetch(userStatsPDA)).name).to.equal("brian"); + expect((await program.account.userStats.fetch(userStatsPDA)).name).to.equal( + "brian" + ); await program.methods .changeUserName("tom") .accounts({ user: provider.wallet.publicKey, - userStats: userStatsPDA + userStats: userStatsPDA, }) .rpc(); - expect((await program.account.userStats.fetch(userStatsPDA)).name).to.equal("tom"); + expect((await program.account.userStats.fetch(userStatsPDA)).name).to.equal( + "tom" + ); }); }); ``` @@ -232,7 +244,7 @@ A subtle result of this hashmap structure is enforced uniqueness. When `init` is Creating PDAs requires them to sign the `createAccount` CPI of the system program. How does that work? PDAs are not public keys so it's impossible for them to sign anything. However, PDAs can still pseudo sign CPIs. -In anchor, to sign with a pda you have to change `CpiContext::new(cpi_program, cpi_accounts)` to `CpiContext::new_with_signer(cpi_program, cpi_accounts, seeds)` where the `seeds` argument are the seeds _and_ the bump the PDA was created with. +In anchor, to sign with a pda you have to change `CpiContext::new(cpi_program, cpi_accounts)` to `CpiContext::new_with_signer(cpi_program, cpi_accounts, seeds)` where the `seeds` argument are the seeds _and_ the bump the PDA was created with. When the CPI is invoked, for each account in `cpi_accounts` the Solana runtime will check whether`hash(seeds, current_program_id) == account address` is true. If yes, that account's `is_signer` flag will be turned to true. This means a PDA derived from some program X, may only be used to sign CPIs that originate from that program X. This means that on a high level, PDA signatures can be considered program signatures. @@ -242,6 +254,7 @@ For instance, lending protocol programs need to manage deposited collateral and Let's revisit the puppet workspace and add a PDA signature. First, adjust the puppet-master code: + ```rust,ignore use anchor_lang::prelude::*; use puppet::cpi::accounts::SetData; @@ -286,26 +299,28 @@ impl<'info> PullStrings<'info> { The `authority` account is now an `UncheckedAccount` instead of a `Signer`. When the puppet-master is invoked, the `authority` pda is not a signer yet so we mustn't add a check for it. We just care about the puppet-master being able to sign so we don't add any additional seeds. Just a bump that is calculated off-chain and then passed to the function. Finally, this is the new `puppet.ts`: + ```ts -import * as anchor from '@project-serum/anchor'; -import { Program } from '@project-serum/anchor'; -import { Keypair, PublicKey } from '@solana/web3.js'; -import { Puppet } from '../target/types/puppet'; -import { PuppetMaster } from '../target/types/puppet_master'; -import { expect } from 'chai'; - -describe('puppet', () => { +import * as anchor from "@coral-xyz/anchor"; +import { Program } from "@coral-xyz/anchor"; +import { Keypair, PublicKey } from "@solana/web3.js"; +import { Puppet } from "../target/types/puppet"; +import { PuppetMaster } from "../target/types/puppet_master"; +import { expect } from "chai"; + +describe("puppet", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const puppetProgram = anchor.workspace.Puppet as Program; - const puppetMasterProgram = anchor.workspace.PuppetMaster as Program; + const puppetMasterProgram = anchor.workspace + .PuppetMaster as Program; const puppetKeypair = Keypair.generate(); - it('Does CPI!', async () => { - const [puppetMasterPDA, puppetMasterBump] = await PublicKey - .findProgramAddress([], puppetMasterProgram.programId); + it("Does CPI!", async () => { + const [puppetMasterPDA, puppetMasterBump] = + await PublicKey.findProgramAddress([], puppetMasterProgram.programId); await puppetProgram.methods .initialize(puppetMasterPDA) @@ -321,12 +336,15 @@ describe('puppet', () => { .accounts({ puppetProgram: puppetProgram.programId, puppet: puppetKeypair.publicKey, - authority: puppetMasterPDA + authority: puppetMasterPDA, }) .rpc(); - expect((await puppetProgram.account.data - .fetch(puppetKeypair.publicKey)).data.toNumber()).to.equal(42); + expect( + ( + await puppetProgram.account.data.fetch(puppetKeypair.publicKey) + ).data.toNumber() + ).to.equal(42); }); }); ``` diff --git a/src/anchor_in_depth/milestone_project_tic-tac-toe.md b/src/anchor_in_depth/milestone_project_tic-tac-toe.md index 30edba9..3d7f176 100644 --- a/src/anchor_in_depth/milestone_project_tic-tac-toe.md +++ b/src/anchor_in_depth/milestone_project_tic-tac-toe.md @@ -1,5 +1,6 @@ # Milestone Project - Tic-Tac-Toe -> [Program Code](https://github.com/project-serum/anchor-book/tree/master/programs/tic-tac-toe) + +> [Program Code](https://github.com/coral-xyz/anchor-book/tree/master/programs/tic-tac-toe) You're now ready to build your first anchor project. Create a new anchor workspace with @@ -16,6 +17,7 @@ We recommend keeping programs in a single `lib.rs` file until they get too big. ### State Let's begin by thinking about what data we should store. Each game has players, turns, a board, and a game state. This game state describes whether the game is active, tied, or one of the two players won. We can save all this data in an account. This means that each new game will have its own account. Add the following to the bottom of the `lib.rs` file: + ```rust,ignore #[account] pub struct Game { @@ -25,7 +27,9 @@ pub struct Game { state: GameState, // 32 + 1 } ``` + This is the game account. Next to the field definitions, you can see how many bytes each field requires. This will be very important later. Let's also add the `Sign` and the `GameState` type. + ```rust,ignore #[derive(AnchorSerialize, AnchorDeserialize, Clone, PartialEq, Eq)] pub enum GameState { @@ -53,11 +57,14 @@ pub enum Sign { Both `GameState` and `Sign` derive some traits. `AnchorSerialize` and `AnchorDeserialize` are the crucial ones. All types that are used in types that are marked with `#[account]` must implement these two traits (or be marked with `#[account]` themselves). All other traits are important to our game logic and we are going to use them later. Generally, it is good practice to derive even more traits to make the life of others trying to interface with your program easier (see [Rust's API guidelines](https://rust-lang.github.io/api-guidelines/interoperability.html#types-eagerly-implement-common-traits-c-common-traits)) but for brevity's sake, we are not going to do that in this guide. This won't quite work yet because `FromPrimitive` and `ToPrimitive` are unknown. Go to the `Cargo.toml` file right outside `src` (not the one at the root of the workspace) and add these two dependencies: + ```toml num-traits = "0.2" num-derive = "0.3" ``` + Then, import them at the top of `lib.rs`: + ```rust,ignore use num_derive::*; use num_traits::*; @@ -168,14 +175,16 @@ impl Game { ``` We are not going to explore this code in detail together because it's rather simple rust code. It's just tic-tac-toe after all! Roughly, what happens when `play` is called: + 1. Return error if game is over or -return error if given row or column are outside the 3x3 board or -return error if tile on board is already set + return error if given row or column are outside the 3x3 board or + return error if tile on board is already set 2. Determine current player and set tile to X or O 3. Update game state 4. If game is still active, increase the turn Currently, the code doesn't compile because we need to add the `Tile` + ```rust,ignore #[derive(AnchorSerialize, AnchorDeserialize)] pub struct Tile { @@ -185,6 +194,7 @@ pub struct Tile { ``` and the `TicTacToeError` type. + ```rust,ignore #[error_code] pub enum TicTacToeError { @@ -199,6 +209,7 @@ pub enum TicTacToeError { ### The Setup Instruction Before we write any game logic, we can add the instruction that will set up the game in its initial state. Rename the already existing instruction function and accounts struct to `setup_game` and `SetupGame` respectively. Now think about which accounts are needed to set up the game. Clearly, we need the game account. Before we can fill it with values, we need to create it. For that, we use the `init` constraint. + ```rust,ignore #[derive(Accounts)] pub struct SetupGame<'info> { @@ -206,7 +217,9 @@ pub struct SetupGame<'info> { pub game: Account<'info, Game> } ``` + `init` immediately shouts at us and tells us to add a payer. Why do we need it? Because `init` creates `rent-exempt` accounts and someone has to pay for that. Naturally, if we want to take money from someone, we should make them sign as well as mark their account as mutable. + ```rust,ignore #[derive(Accounts)] pub struct SetupGame<'info> { @@ -216,7 +229,9 @@ pub struct SetupGame<'info> { pub player_one: Signer<'info> } ``` + `init` is not happy yet. It wants the system program to be inside the struct because `init` creates the game account by making a call to that program. So let's add it. + ```rust,ignore #[derive(Accounts)] pub struct SetupGame<'info> { @@ -229,6 +244,7 @@ pub struct SetupGame<'info> { ``` There's one more thing to do to complete `SetupGame`. Every account is created with a fixed amount of space, so we have to add this space to the instruction as well. This is what the comments next to the `Game` struct indicated. + ```rust,ignore #[derive(Accounts)] pub struct SetupGame<'info> { @@ -242,7 +258,7 @@ pub struct SetupGame<'info> { Let us briefly explain how we arrived at the `Game::MAXIMUM_SIZE`. Anchor uses the [borsh](https://borsh.io) specification to (de)serialize its state accounts. -- Pubkey has a length of `32` bytes so `2*32 = 64` +- Pubkey has a length of `32` bytes so `2*32 = 64` - u8 as a vector has a length of `1` - the `board` has a length of (`9 * (1 + 1)`). We know the board has 9 tiles (-> `9`) of type `Option` which borsh serializes with 1 byte (set to `1` for Some and `0` for None) plus the size of whatever's in the `Option`. In this case, it's a simple enum with types that don't hold more types so the maximum size of the enum is also just `1` (for its discriminant). In total that means we get `9 (tiles) * (1 (Option) + 1(Sign discriminant))`. - `state` is also an enum so we need `1` byte for the discriminant. We have to init the account with the maximum size and the maximum size of an enum is the size of its biggest variant. In this case that's the `winner` variant which holds a Pubkey. A Pubkey is `32` bytes long so the size of `state` is `1 (discriminant) + 32 (winner pubkey)` (`MAXIMUM_SIZE` is a [`const`](https://doc.rust-lang.org/std/keyword.const.html) variable so specifying it in terms of a sum of the sizes of `Game`'s members' fields does not incur any runtime cost). @@ -256,14 +272,17 @@ In addition to the game's size, we have to add another 8 to the space. This is s And with this, `SetupGame` is complete and we can move on to the `setup_game` function. (If you like playing detective, you can pause here and try to figure out why what we just did will not work. Hint: Have a look at the [specification](https://borsh.io/) of the serialization library Anchor uses. If you cannot figure it out, don't worry. We are going to fix it very soon, together.) Let's start by adding an argument to the `setup_game` function. + ```rust,ignore pub fn setup_game(ctx: Context, player_two: Pubkey) -> Result<()> { - + } ``` + Why didn't we just add `player_two` as an account in the accounts struct? There are two reasons for this. First, adding it there requires a little more space in the transaction that saves whether the account is writable and whether it's a signer. But we care about neither the mutability of the account nor whether it's a signer. We just need its address. This brings us to the second and more important reason: Simultaneous network transactions can affect each other if they share the same accounts. For example, if we add `player_two` to the accounts struct, during our transaction, no other transaction can edit `player_two`'s account. Therefore, we block all other transactions that want to edit `player_two`'s account, even though we neither want to read from nor write to the account. We just care about its address! Finish the instruction function by setting the game to its initial values: + ```rust,ignore pub fn setup_game(ctx: Context, player_two: Pubkey) -> Result<()> { ctx.accounts.game.start([ctx.accounts.player_one.key(), player_two]) @@ -275,35 +294,37 @@ Now, run `anchor build`. On top of compiling your program, this command creates ### Testing the Setup Instruction Time to test our code! Head over into the `tests` folder in the root directory. Open the `tic-tac-toe.ts` file and remove the existing `it` test. Then, put the following into the `describe` section: + ```typescript - it('setup game!', async() => { - const gameKeypair = anchor.web3.Keypair.generate(); - const playerOne = (program.provider as anchor.AnchorProvider).wallet; - const playerTwo = anchor.web3.Keypair.generate(); - await program.methods - .setupGame(playerTwo.publicKey) - .accounts({ - game: gameKeypair.publicKey, - playerOne: playerOne.publicKey, - }) - .signers([gameKeypair]) - .rpc(); - - let gameState = await program.account.game.fetch(gameKeypair.publicKey); - expect(gameState.turn).to.equal(1); - expect(gameState.players) - .to - .eql([playerOne.publicKey, playerTwo.publicKey]); - expect(gameState.state).to.eql({ active: {} }); - expect(gameState.board) - .to - .eql([[null,null,null],[null,null,null],[null,null,null]]); - }); +it("setup game!", async () => { + const gameKeypair = anchor.web3.Keypair.generate(); + const playerOne = (program.provider as anchor.AnchorProvider).wallet; + const playerTwo = anchor.web3.Keypair.generate(); + await program.methods + .setupGame(playerTwo.publicKey) + .accounts({ + game: gameKeypair.publicKey, + playerOne: playerOne.publicKey, + }) + .signers([gameKeypair]) + .rpc(); + + let gameState = await program.account.game.fetch(gameKeypair.publicKey); + expect(gameState.turn).to.equal(1); + expect(gameState.players).to.eql([playerOne.publicKey, playerTwo.publicKey]); + expect(gameState.state).to.eql({ active: {} }); + expect(gameState.board).to.eql([ + [null, null, null], + [null, null, null], + [null, null, null], + ]); +}); ``` and add this to the top of your file: + ```typescript -import { expect } from 'chai'; +import { expect } from "chai"; ``` > When you adjust your test files it may happen that you'll see errors everywhere. @@ -315,7 +336,7 @@ Then, we send the transaction. The structure of the transaction function is as follows: First come the instruction arguments. For this function, the public key of the second player. Then come the accounts. Lastly, we add a signers array. We have to add the `gameKeypair` here because whenever an account gets created, it has to sign its creation transaction. We don't have to add `playerOne` even though we gave it the `Signer` type in the program because it is the program provider and therefore signs the transaction by default. We did not have to specify the `system_program` account. This is because anchor recognizes this account and is able to infer it. This is also true for other known accounts such as the `token_program` or the `rent` sysvar account. -After the transaction returns, we can fetch the state of the game account. You can fetch account state using the `program.account` namespace. +After the transaction returns, we can fetch the state of the game account. You can fetch account state using the `program.account` namespace. Finally, we verify the game has been set up properly by comparing the actual state and the expected state. To learn how Anchor maps the Rust types to the js/ts types, check out the [Javascript Anchor Types Reference](./../anchor_references/javascript_anchor_types_reference.md). Now, run `anchor test`. This starts up (and subsequently shuts down) a local validator (make sure you don't have one running before) and runs your tests using the test script defined in `Anchor.toml`. @@ -327,6 +348,7 @@ Now, run `anchor test`. This starts up (and subsequently shuts down) a local val ### The Play Instruction The `Play` accounts struct is straightforward. We need the game and a player: + ```rust,ignore #[derive(Accounts)] pub struct Play<'info> { @@ -339,6 +361,7 @@ pub struct Play<'info> { `player` needs to sign or someone else could play for the player. Finally, we can add the `play` function inside the program module. + ```rust,ignore pub fn play(ctx: Context, tile: Tile) -> Result<()> { let game = &mut ctx.accounts.game; @@ -358,14 +381,22 @@ We've checked in the accounts struct that the `player` account has signed the tr ### Testing the Play Instruction Testing the `play` instruction works the exact same way. To avoid repeating yourself, create a helper function at the top of the test file: + ```typescript -async function play(program: Program, game, player, - tile, expectedTurn, expectedGameState, expectedBoard) { +async function play( + program: Program, + game, + player, + tile, + expectedTurn, + expectedGameState, + expectedBoard +) { await program.methods .play(tile) .accounts({ player: player.publicKey, - game + game, }) .signers(player instanceof (anchor.Wallet as any) ? [] : [player]) .rpc(); @@ -373,111 +404,114 @@ async function play(program: Program, game, player, const gameState = await program.account.game.fetch(game); expect(gameState.turn).to.equal(expectedTurn); expect(gameState.state).to.eql(expectedGameState); - expect(gameState.board) - .to - .eql(expectedBoard); + expect(gameState.board).to.eql(expectedBoard); } ``` You can create then a new `it` test, setup the game like in the previous test, but then keep calling the `play` function you just added to simulate a complete run of the game. Let's begin with the first turn: + ```typescript -it('player one wins', async() => { - const gameKeypair = anchor.web3.Keypair.generate(); - const playerOne = program.provider.wallet; - const playerTwo = anchor.web3.Keypair.generate(); - await program.methods - .setupGame(playerTwo.publicKey) - .accounts({ - game: gameKeypair.publicKey, - playerOne: playerOne.publicKey, - }) - .signers([gameKeypair]) - .rpc(); - - let gameState = await program.account.game.fetch(gameKeypair.publicKey); - expect(gameState.turn).to.equal(1); - expect(gameState.players) - .to - .eql([playerOne.publicKey, playerTwo.publicKey]); - expect(gameState.state).to.eql({ active: {} }); - expect(gameState.board) - .to - .eql([[null,null,null],[null,null,null],[null,null,null]]); - - await play( - program, - gameKeypair.publicKey, - playerOne, - {row: 0, column: 0}, - 2, - { active: {}, }, - [ - [{x:{}},null,null], - [null,null,null], - [null,null,null] - ] - ); +it("player one wins", async () => { + const gameKeypair = anchor.web3.Keypair.generate(); + const playerOne = program.provider.wallet; + const playerTwo = anchor.web3.Keypair.generate(); + await program.methods + .setupGame(playerTwo.publicKey) + .accounts({ + game: gameKeypair.publicKey, + playerOne: playerOne.publicKey, + }) + .signers([gameKeypair]) + .rpc(); + + let gameState = await program.account.game.fetch(gameKeypair.publicKey); + expect(gameState.turn).to.equal(1); + expect(gameState.players).to.eql([playerOne.publicKey, playerTwo.publicKey]); + expect(gameState.state).to.eql({ active: {} }); + expect(gameState.board).to.eql([ + [null, null, null], + [null, null, null], + [null, null, null], + ]); + + await play( + program, + gameKeypair.publicKey, + playerOne, + { row: 0, column: 0 }, + 2, + { active: {} }, + [ + [{ x: {} }, null, null], + [null, null, null], + [null, null, null], + ] + ); }); ``` and run `anchor test`. -You can finish writing the test by yourself (or check out [the reference implementation](https://github.com/project-serum/anchor-book/tree/master/programs/tic-tac-toe)). Try to simulate a win and a tie! +You can finish writing the test by yourself (or check out [the reference implementation](https://github.com/coral-xyz/anchor-book/tree/master/programs/tic-tac-toe)). Try to simulate a win and a tie! Proper testing also includes tests that try to exploit the contract. You can check whether you've protected yourself properly by calling `play` with unexpected parameters. You can also familiarize yourself with the returned `AnchorErrors` this way. For example: + ```typescript try { await play( program, gameKeypair.publicKey, playerTwo, - {row: 5, column: 1}, // ERROR: out of bounds row + { row: 5, column: 1 }, // ERROR: out of bounds row 4, - { active: {}, }, + { active: {} }, [ - [{x:{}},{x: {}},null], - [{o:{}},null,null], - [null,null,null] + [{ x: {} }, { x: {} }, null], + [{ o: {} }, null, null], + [null, null, null], ] ); // we use this to make sure we definitely throw an error chai.assert(false, "should've failed but didn't "); } catch (_err) { - expect(_err).to.be.instanceOf(AnchorError); - const err: AnchorError = _err; - expect(err.error.errorCode.number).to.equal(6000); + expect(_err).to.be.instanceOf(AnchorError); + const err: AnchorError = _err; + expect(err.error.errorCode.number).to.equal(6000); } ``` -or +or ```typescript try { - await play( + await play( program, gameKeypair.publicKey, playerOne, // ERROR: same player in subsequent turns - + // change sth about the tx because // duplicate tx that come in too fast // after each other may get dropped - {row: 1, column: 0}, + { row: 1, column: 0 }, 2, - { active: {}, }, + { active: {} }, [ - [{x:{}},null,null], - [null,null,null], - [null,null,null] + [{ x: {} }, null, null], + [null, null, null], + [null, null, null], ] - ); - chai.assert(false, "should've failed but didn't "); + ); + chai.assert(false, "should've failed but didn't "); } catch (_err) { - expect(_err).to.be.instanceOf(AnchorError); - const err: AnchorError = _err; - expect(err.error.errorCode.code).to.equal("NotPlayersTurn"); - expect(err.error.errorCode.number).to.equal(6003); - expect(err.program.equals(program.programId)).is.true; - expect(err.error.comparedValues).to.deep.equal([playerTwo.publicKey, playerOne.publicKey]); + expect(_err).to.be.instanceOf(AnchorError); + const err: AnchorError = _err; + expect(err.error.errorCode.code).to.equal("NotPlayersTurn"); + expect(err.error.errorCode.number).to.equal(6003); + expect(err.program.equals(program.programId)).is.true; + expect(err.error.comparedValues).to.deep.equal([ + playerTwo.publicKey, + playerOne.publicKey, + ]); } ``` @@ -500,13 +534,15 @@ Here is your deployment checklist 🚀 There is more to deployments than this e.g. understanding how the BPFLoader works, how to manage keys, how to upgrade your programs and more. Keep reading to learn more! ## Program directory organization -> [Program Code](https://github.com/project-serum/anchor-book/tree/master/programs/tic-tac-toe) -Eventually, some programs become too big to keep them in a single file and it makes sense to break them up. +> [Program Code](https://github.com/coral-xyz/anchor-book/tree/master/programs/tic-tac-toe) + +Eventually, some programs become too big to keep them in a single file and it makes sense to break them up. Splitting a program into multiple files works almost the exact same way as splitting up a regular rust program, so if you haven't already, now is the time to read all about that in the [rust book](https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html). We recommend the following directory structure (using the tic-tac-toe program as an example): + ``` . +-- lib.rs @@ -524,5 +560,4 @@ The crucial difference to a normal rust layout is the way that instructions have To make the imports shorter you can re-export the instruction modules in the `mod.rs` file in the instructions directory with the `pub use` syntax and then import all instructions in the `lib.rs` file with `use instructions::*;`. - Well done! You've finished the essentials section. You can now move on to the more advanced parts of Anchor. diff --git a/src/anchor_references/cli.md b/src/anchor_references/cli.md index f8eca22..3109364 100644 --- a/src/anchor_references/cli.md +++ b/src/anchor_references/cli.md @@ -1,4 +1,5 @@ # CLI + A CLI is provided to support building and managing an Anchor workspace. For a comprehensive list of commands and options, run `anchor -h` on any of the following subcommands. @@ -31,7 +32,6 @@ SUBCOMMANDS: Cargo.toml ``` - ## Build ``` @@ -75,7 +75,7 @@ Deploys all programs in the workspace to the configured cluster. ::: tip Note This is different from the `solana program deploy` command, because every time it's run -it will generate a *new* program address. +it will generate a _new_ program address. ::: ## Expand @@ -161,13 +161,13 @@ anchor init Initializes a project workspace with the following structure. -* `Anchor.toml`: Anchor configuration file. -* `Cargo.toml`: Rust workspace configuration file. -* `package.json`: JavaScript dependencies file. -* `programs/`: Directory for Solana program crates. -* `app/`: Directory for your application frontend. -* `tests/`: Directory for JavaScript integration tests. -* `migrations/deploy.js`: Deploy script. +- `Anchor.toml`: Anchor configuration file. +- `Cargo.toml`: Rust workspace configuration file. +- `package.json`: JavaScript dependencies file. +- `programs/`: Directory for Solana program crates. +- `app/`: Directory for your application frontend. +- `tests/`: Directory for JavaScript integration tests. +- `migrations/deploy.js`: Deploy script. ## Migrate @@ -181,13 +181,13 @@ from the workspace's `Anchor.toml`. For example, ```javascript // File: migrations/deploys.js -const anchor = require("@project-serum/anchor"); +const anchor = require("@coral-xyz/anchor"); module.exports = async function (provider) { anchor.setProvider(provider); // Add your deploy script here. -} +}; ``` Migrations are a new feature @@ -222,7 +222,7 @@ If the configured network is a localnet, then automatically starts the localnetw the test. > Note: Be sure to shutdown any other local validators, otherwise `anchor test` will fail to run. -> +> > If you'd prefer to run the program against your local validator use `anchor test --skip-local-validator`. When running tests we stream program logs to `.anchor/program-logs/
..log` diff --git a/src/getting_started/installation.md b/src/getting_started/installation.md index 2afb193..389a665 100644 --- a/src/getting_started/installation.md +++ b/src/getting_started/installation.md @@ -21,7 +21,7 @@ Anchor version manager is a tool for using multiple versions of the anchor-cli. Install `avm` using Cargo. Note this will replace your `anchor` binary if you had one installed. ``` -cargo install --git https://github.com/project-serum/anchor avm --locked --force +cargo install --git https://github.com/coral-xyz/anchor avm --locked --force ``` On Linux systems you may need to install additional dependencies if cargo install fails. E.g. on Ubuntu: @@ -45,14 +45,14 @@ anchor --version ### Install using pre-build binary on x86_64 Linux -Anchor binaries are available via an NPM package [`@project-serum/anchor-cli`](https://www.npmjs.com/package/@project-serum/anchor-cli). Only `x86_64` Linux is supported currently, you must build from source for other OS'. +Anchor binaries are available via an NPM package [`@coral-xyz/anchor-cli`](https://www.npmjs.com/package/@coral-xyz/anchor-cli). Only `x86_64` Linux is supported currently, you must build from source for other OS'. ### Build from source for other operating systems without avm We can also use Cargo to install the CLI directly. Make sure that the `--tag` argument uses the version you want (the version here is just an example). ``` -cargo install --git https://github.com/project-serum/anchor --tag v0.24.1 anchor-cli --locked +cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli --locked ``` On Linux systems you may need to install additional dependencies if cargo install fails. On Ubuntu, diff --git a/src/introduction/introduction.md b/src/introduction/introduction.md index 9edce47..6ebb3b0 100644 --- a/src/introduction/introduction.md +++ b/src/introduction/introduction.md @@ -4,4 +4,4 @@ Welcome to The Anchor Book! âš“ This chapter covers what anchor is, how its documentation is structured, and what you should know to have a good time with this guide. -If you find errors or something doesn't work, please report it [here](https://github.com/project-serum/anchor-book/issues). \ No newline at end of file +If you find errors or something doesn't work, please report it [here](https://github.com/coral-xyz/anchor-book/issues).