From 99a0cb9a85d54f1db96b3646e933f46932a52aa1 Mon Sep 17 00:00:00 2001 From: Ahesui <137135822+Ahesui@users.noreply.github.com> Date: Sun, 26 May 2024 17:40:43 +0800 Subject: [PATCH] Update Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solve the error that occurs when executing the build command, such as described on the following two websites: https://users.rust-lang.org/t/use-of-undeclared-crate-or-module-imp-on-getrandom-0-2-3-when-building-for-wasm32-unknown-unknown/70171 https://solana.stackexchange.com/questions/511/rust-target-is-not-supported-error-when-solana-program-version-at-or-above-1-1 --- hello-solana/src/program/Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hello-solana/src/program/Cargo.toml b/hello-solana/src/program/Cargo.toml index ca0e1df..f25a483 100644 --- a/hello-solana/src/program/Cargo.toml +++ b/hello-solana/src/program/Cargo.toml @@ -7,10 +7,11 @@ edition = "2021" [dependencies] solana-program = "1.9.9" +getrandom = { version = "0.2", features = ["js"] } [dev-dependencies] solana-program-test = "1.9.9" solana-sdk = "1.9.9" [lib] -crate-type = ["cdylib", "lib"] \ No newline at end of file +crate-type = ["cdylib", "lib"]