Update all solana dependencies to 1.7.3, fix issues (#1958)
* Update all dependencies to 1.7.3, fix issues * Remove esm from mocha * Fix missed token test * Also update rust version * token-swap: update tolerance on sim test * Run `cargo clippy --fix` for needless_borrow errors * Rerun cargo fmt
This commit is contained in:
parent
586e5f9ec5
commit
21f8af34e7
|
@ -393,12 +393,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.49"
|
||||
version = "1.0.68"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e450b8da92aa6f274e7c6437692f9f2ce6d701fb73bacfcf87897b3f89a4c20e"
|
||||
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"num_cpus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -436,9 +435,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "chrono-humanize"
|
||||
version = "0.1.2"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8164ae3089baf04ff71f32aeb70213283dcd236dce8bc976d00b17a458f5f71c"
|
||||
checksum = "2eddc119501d583fd930cb92144e605f44e0252c38dd89d9247fffa1993375cb"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
]
|
||||
|
@ -1039,12 +1038,6 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fs_extra"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
|
||||
|
||||
[[package]]
|
||||
name = "fuchsia-zircon"
|
||||
version = "0.3.3"
|
||||
|
@ -1584,38 +1577,6 @@ version = "0.4.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
|
||||
|
||||
[[package]]
|
||||
name = "jemalloc-ctl"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c502a5ff9dd2924f1ed32ba96e3b65735d837b4bfd978d3161b1702e66aca4b7"
|
||||
dependencies = [
|
||||
"jemalloc-sys",
|
||||
"libc",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jemalloc-sys"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"fs_extra",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jemallocator"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
|
||||
dependencies = [
|
||||
"jemalloc-sys",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.21"
|
||||
|
@ -2639,13 +2600,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.16.12"
|
||||
version = "0.16.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ba5a8ec64ee89a76c98c549af81ff14813df09c3e6dc4766c3856da48597a0c"
|
||||
checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"spin",
|
||||
"untrusted",
|
||||
"web-sys",
|
||||
|
@ -3022,9 +2983,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-account-decoder"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5eb4860be724565c9664939a498424baa392b3ccdec4cc2677f5397afd20fd8c"
|
||||
checksum = "e49c9e97fbaa91220924064f23ce367c02af1a3bc8cc514f84168b47cbb075c7"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"base64 0.12.3",
|
||||
|
@ -3037,18 +2998,17 @@ dependencies = [
|
|||
"serde_json",
|
||||
"solana-config-program",
|
||||
"solana-sdk",
|
||||
"solana-stake-program",
|
||||
"solana-vote-program",
|
||||
"spl-token 3.1.0",
|
||||
"spl-token 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thiserror",
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-banks-client"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9977706df3b1d69e91eb4d0c53d60bd262f96de4116b606afea8728d33e8072e"
|
||||
checksum = "570ed9c8e78fabbd2f93140f731c9361b7aa6292341e03811e5b6d3ed2470c5a"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"borsh",
|
||||
|
@ -3065,9 +3025,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-banks-interface"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0066bd7c2655141b095cfe25afc1aa76879254e0fe02ac212b858449cbddf275"
|
||||
checksum = "f3b253e4d53eef373ab186829988a9ad4f7bfce886cf0e1fade1ad866c294df2"
|
||||
dependencies = [
|
||||
"mio 0.7.11",
|
||||
"serde",
|
||||
|
@ -3077,9 +3037,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-banks-server"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "950c7a4061aaf4f79293caf06c12f639a4a55cfd5f3ec9f5323be869e4426ef9"
|
||||
checksum = "a350a47e84f4e28a28e985e96150a222559b0e23f71a3b34760b7463091d0877"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"futures 0.3.14",
|
||||
|
@ -3097,9 +3057,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-bpf-loader-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ba7fcf2994963a758c97b6c9d205036ea9b1baf84227398f9bbc47d25877e00"
|
||||
checksum = "7305c923737fc515d88454dd991b8c21c5e9270f72db3cd52da888d4d233fe07"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder",
|
||||
|
@ -3117,9 +3077,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-clap-utils"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a515dc715a2a57636e7f8025184bd2d08cdfaf697b1733894ffa9ae5a440de83"
|
||||
checksum = "29dca103fa63d4fa564c719d2f043feb4a116722362cbcbf027d4404fc65e7b3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap",
|
||||
|
@ -3134,9 +3094,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-cli-config"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3667436885eb17fc016858a1b8e19500e6dd47565b5c2a55388c95bf1124412"
|
||||
checksum = "f22f4acf359df9e859878fc456bb98cfd3d008ee239a6300259c439a2356d1c9"
|
||||
dependencies = [
|
||||
"dirs-next",
|
||||
"lazy_static",
|
||||
|
@ -3148,14 +3108,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-cli-output"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "65aaaf890913d51e8362a4e255ff478774a29720f49362ec17302b49d9706f04"
|
||||
checksum = "7e90601ae12c8bea054ed0f896f8871564087b094fd3d45fa1f4e0f45df492f9"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"base64 0.13.0",
|
||||
"chrono",
|
||||
"console 0.11.3",
|
||||
"console 0.14.1",
|
||||
"humantime",
|
||||
"indicatif",
|
||||
"serde",
|
||||
|
@ -3165,7 +3125,6 @@ dependencies = [
|
|||
"solana-clap-utils",
|
||||
"solana-client",
|
||||
"solana-sdk",
|
||||
"solana-stake-program",
|
||||
"solana-transaction-status",
|
||||
"solana-vote-program",
|
||||
"spl-memo 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3173,9 +3132,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-client"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "984434a42a0c49275cb1c290bbc89b03b08a857ca4d7f34465eb30a3ba572170"
|
||||
checksum = "15a149653548051cdcfdfb3494ad46a9810e647cbf004b0f65dccafd92eec152"
|
||||
dependencies = [
|
||||
"base64 0.13.0",
|
||||
"bincode",
|
||||
|
@ -3207,9 +3166,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-config-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e9341b8d8c32b970b6aa3e4a58795f5120154b3896b7231b830a5a9a13bc8083"
|
||||
checksum = "056a9300b5e2665d0f6cf1dfbc5f9778ec616485adbe35af01fec234e1f9b288"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
|
@ -3222,9 +3181,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-crate-features"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d62c8e8a526b62e3cefe51f079cc48585a5026d1d5a86a99ce38d782273027f"
|
||||
checksum = "887ff45393b195ab7d93cdc94511c7cc2319a379b659e8008de77028c2326846"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes 0.4.12",
|
||||
|
@ -3237,6 +3196,7 @@ dependencies = [
|
|||
"rand_chacha 0.2.2",
|
||||
"regex-syntax",
|
||||
"reqwest",
|
||||
"ring",
|
||||
"serde",
|
||||
"syn 0.15.44",
|
||||
"syn 1.0.69",
|
||||
|
@ -3246,9 +3206,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-faucet"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be5f5f36174686ca4ec091578050d73cddd2bbdf3e486bbe817fdca0c857364a"
|
||||
checksum = "981359d3f0f420dfa6d5eee4d33357d619817425a64ad090f2f88e521c9a24bd"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"byteorder",
|
||||
|
@ -3269,9 +3229,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-frozen-abi"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "439fb97ca6bf4098973413e806071116a0d87dcb197c0c2ae01f71a1588d6dcc"
|
||||
checksum = "dc00a9f7c3eb2fb8687d34ce6d8672fbf7bd8f67002a5f75ccd6f6c4e8cd8a91"
|
||||
dependencies = [
|
||||
"bs58 0.3.1",
|
||||
"bv",
|
||||
|
@ -3289,11 +3249,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-frozen-abi-macro"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa4b1844deb909101f83735504f41f7ce539fe0c448fa52bda1a7d2233aaefc3"
|
||||
checksum = "bc381a29ab68515e69dcfad633ab78dd98d83c0b959c2cae9a9a98df6e265acf"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"proc-macro2 1.0.26",
|
||||
"quote 1.0.9",
|
||||
"rustc_version",
|
||||
|
@ -3302,9 +3261,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-logger"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01545ecd73ca356dd3d31db303e0ecc1989b67a1561dce0c8d8ae2d4c536562d"
|
||||
checksum = "62f8e4921602f61681d8d29d2606d4f8e1c848d4f6b9964813bfc1b457dfd7ce"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
|
@ -3313,12 +3272,10 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-measure"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2ddf22ce1f47ebc723bceec387100a52a27ed6a807092ac90ecc70189bb10ce2"
|
||||
checksum = "958b8dab77246d9c71c78a4e9c5c31a1092dafb70294ce0334acf572442b9d84"
|
||||
dependencies = [
|
||||
"jemalloc-ctl",
|
||||
"jemallocator",
|
||||
"log",
|
||||
"solana-metrics",
|
||||
"solana-sdk",
|
||||
|
@ -3326,9 +3283,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-metrics"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc2aa796e88a5fc8628474a55929cc3d8c5dd2d10900cd591917eac22de86a5a"
|
||||
checksum = "77968c10909ef49d7a3cccc3ca8de9415e8750411ad917889ef8ba9ae8692d94"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"gethostname",
|
||||
|
@ -3340,9 +3297,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-net-utils"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "00ca51d139c4b6768a0a73500725281a6feb833daf5666222dd605db1c8e6623"
|
||||
checksum = "9de765ffc78c8068b9efce0ff08b399a94105b004588c90a4b0835995dfc4712"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"clap",
|
||||
|
@ -3354,6 +3311,7 @@ dependencies = [
|
|||
"socket2 0.3.19",
|
||||
"solana-clap-utils",
|
||||
"solana-logger",
|
||||
"solana-sdk",
|
||||
"solana-version",
|
||||
"tokio 1.5.0",
|
||||
"url",
|
||||
|
@ -3361,9 +3319,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ac6cafe3bb91070644839600e65b185292e285abc31ac626ddab6a79c0cc18e"
|
||||
checksum = "9f9c454274436aac77286369e35835fafa1f79d1da1c4b7a1c662b2c41705f77"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"blake3",
|
||||
|
@ -3395,9 +3353,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-program-test"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5c6637e910327d7dbcd23b121437eb7bc64f98bc1080bc50db944f015f21d43"
|
||||
checksum = "4cd5922e4a9a7437a19ff5d79f60bac64ea2636a365586cb3511f4d562a20cf7"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.12.3",
|
||||
|
@ -3421,9 +3379,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-rayon-threadlimit"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e0a2dbe5f36a32c5f4c366bde65ac10f516693f0342da36dd6b3daf012ba50f"
|
||||
checksum = "d837161f598afd30c445a7f9c39d640cd4cdf362c30062ed0831b71daaf63a45"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"num_cpus",
|
||||
|
@ -3431,12 +3389,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-remote-wallet"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "975ad7bac4f07188e4d70df8c018f429da3c02d3cc2f1e8a56c4d9f03261dc9d"
|
||||
checksum = "24087b3048534e154db68c4cdd8233f3a35dd6f860d97e5ad1008c44e0d311f5"
|
||||
dependencies = [
|
||||
"base32",
|
||||
"console 0.11.3",
|
||||
"console 0.14.1",
|
||||
"dialoguer",
|
||||
"hidapi",
|
||||
"log",
|
||||
|
@ -3452,9 +3410,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-runtime"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f4ca322a5fbcc3b647de773d8b8f30659b0b956f0226ec1a8fadc08159cc8be"
|
||||
checksum = "224e6ef5ea772d9636493dd4fd196cf3b167ff73b7d54e7f591b2f2d452c70d6"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"bincode",
|
||||
|
@ -3503,9 +3461,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-sdk"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a978bfd23136d5af402c5b932ffc6cb5a9a047d3dddc2522b729b270b8df546"
|
||||
checksum = "339cc1a9d437ae2f5f05d2d678c8f6d19ea6cf57cbdf719b7726156d294487bd"
|
||||
dependencies = [
|
||||
"assert_matches",
|
||||
"bincode",
|
||||
|
@ -3552,9 +3510,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-sdk-macro"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9205b47aa8e2474d014033375dea8734f14038fc860feed2ef654ee17c73353"
|
||||
checksum = "85ee9c0af66098ec40bf9012b7910c8cdb1ce8b95fc9fad90e6a0cbe692a48fe"
|
||||
dependencies = [
|
||||
"bs58 0.3.1",
|
||||
"proc-macro2 1.0.26",
|
||||
|
@ -3565,9 +3523,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-secp256k1-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eade5b09385c7139a8aab6420d76087a4ef6e47a03343cb70e77a50d6567eb62"
|
||||
checksum = "2666ffed520bff7d0eb6747da156435def7f97341634e72af39fefc0d27496f1"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"digest 0.9.0",
|
||||
|
@ -3580,9 +3538,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-stake-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a42ec32e879eb261fa847f659cd5631111c7a4b824bc29d90f4d9d497b93774"
|
||||
checksum = "42f9e0309f95b3160c4961f11a3940d98126a86a7410b04bf88ff79448984257"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
|
@ -3602,9 +3560,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-transaction-status"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8d51bde7edc91f03220eb2399ba313e8bea7c9394d90c79783863942323ddd9"
|
||||
checksum = "952083e52e835be5c0f10707d9019df84f3be5f0c524391848d4c8c7e05151da"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"base64 0.12.3",
|
||||
|
@ -3617,19 +3575,18 @@ dependencies = [
|
|||
"solana-account-decoder",
|
||||
"solana-runtime",
|
||||
"solana-sdk",
|
||||
"solana-stake-program",
|
||||
"solana-vote-program",
|
||||
"spl-associated-token-account 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spl-memo 3.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"spl-token 3.1.0",
|
||||
"spl-token 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "solana-version"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44b0676fb5106f50350e46864c5304cd2beb8383bc470b43ccb42e6cf9747686"
|
||||
checksum = "797f12524e5ea25d18f345cd4c34a4839dea83e979a9ccb43a02b486ba9d913c"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rustc_version",
|
||||
|
@ -3643,9 +3600,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana-vote-program"
|
||||
version = "1.6.11"
|
||||
version = "1.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63c69608668f8738cbaa3a25d15943dd202448b6eafe5d480326a91bd87f0eac"
|
||||
checksum = "8583f429404acb3ab8eb255cd9cb1c65496dda7a8be3d73058d63b7d26cc1c3d"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"log",
|
||||
|
@ -3664,9 +3621,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "solana_rbpf"
|
||||
version = "0.2.9"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "debbc13545a1d972955a4fd3014e7c9d6d81da16c3626ee5f64bf3aa619548f8"
|
||||
checksum = "7c1c5bdfa63c68d848d95024c7f4335bae4b1917f7df2e48e2d945f4664a8b45"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"combine",
|
||||
|
@ -3675,6 +3632,7 @@ dependencies = [
|
|||
"libc",
|
||||
"log",
|
||||
"rand 0.7.3",
|
||||
"rustc-demangle",
|
||||
"scroll",
|
||||
"thiserror",
|
||||
"time",
|
||||
|
@ -3703,7 +3661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "4adc47eebe5d2b662cbaaba1843719c28a67e5ec5d0460bc3ca60900a51f74e2"
|
||||
dependencies = [
|
||||
"solana-program",
|
||||
"spl-token 3.1.0",
|
||||
"spl-token 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3927,20 +3885,6 @@ dependencies = [
|
|||
"spl-token 3.1.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spl-token"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b795e50d15dfd35aa5460b80a16414503a322be115a417a43db987c5824c6798"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"num_enum",
|
||||
"solana-program",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spl-token"
|
||||
version = "3.1.1"
|
||||
|
@ -3954,6 +3898,20 @@ dependencies = [
|
|||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spl-token"
|
||||
version = "3.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fbfa8fd791aeb4d7ad5fedb7872478de9f4e8b4fcb02dfd9e7f2f9ae3f3ddd73"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
"num_enum",
|
||||
"solana-program",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spl-token-cli"
|
||||
version = "2.0.12"
|
||||
|
|
|
@ -12,12 +12,12 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { version = "3.1", path = "../../token/program", features = ["no-entrypoint"] }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -34,7 +34,7 @@ pub fn get_associated_token_address(
|
|||
wallet_address: &Pubkey,
|
||||
spl_token_mint_address: &Pubkey,
|
||||
) -> Pubkey {
|
||||
get_associated_token_address_and_bump_seed(&wallet_address, &spl_token_mint_address, &id()).0
|
||||
get_associated_token_address_and_bump_seed(wallet_address, spl_token_mint_address, &id()).0
|
||||
}
|
||||
|
||||
fn get_associated_token_address_and_bump_seed_internal(
|
||||
|
|
|
@ -31,10 +31,10 @@ pub fn process_instruction(
|
|||
let rent_sysvar_info = next_account_info(account_info_iter)?;
|
||||
|
||||
let (associated_token_address, bump_seed) = get_associated_token_address_and_bump_seed_internal(
|
||||
&wallet_account_info.key,
|
||||
&spl_token_mint_info.key,
|
||||
wallet_account_info.key,
|
||||
spl_token_mint_info.key,
|
||||
program_id,
|
||||
&spl_token_program_id,
|
||||
spl_token_program_id,
|
||||
);
|
||||
if associated_token_address != *associated_token_account_info.key {
|
||||
msg!("Error: Associated address does not match seed derivation");
|
||||
|
@ -62,7 +62,7 @@ pub fn process_instruction(
|
|||
);
|
||||
invoke(
|
||||
&system_instruction::transfer(
|
||||
&funder_info.key,
|
||||
funder_info.key,
|
||||
associated_token_account_info.key,
|
||||
required_lamports,
|
||||
),
|
||||
|
@ -84,23 +84,23 @@ pub fn process_instruction(
|
|||
associated_token_account_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&associated_token_account_signer_seeds],
|
||||
&[associated_token_account_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Assign the associated token account to the SPL Token program");
|
||||
invoke_signed(
|
||||
&system_instruction::assign(associated_token_account_info.key, &spl_token_program_id),
|
||||
&system_instruction::assign(associated_token_account_info.key, spl_token_program_id),
|
||||
&[
|
||||
associated_token_account_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&associated_token_account_signer_seeds],
|
||||
&[associated_token_account_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Initialize the associated token account");
|
||||
invoke(
|
||||
&spl_token::instruction::initialize_account(
|
||||
&spl_token_program_id,
|
||||
spl_token_program_id,
|
||||
associated_token_account_info.key,
|
||||
spl_token_mint_info.key,
|
||||
wallet_account_info.key,
|
||||
|
|
|
@ -13,7 +13,7 @@ test-bpf = []
|
|||
[dependencies]
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { version = "3.1", path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
thiserror = "1.0"
|
||||
uint = "0.8"
|
||||
|
@ -21,8 +21,8 @@ arbitrary = { version = "0.4", features = ["derive"], optional = true }
|
|||
borsh = "0.8.2"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -421,7 +421,7 @@ impl Processor {
|
|||
authority_account_info.clone(),
|
||||
user_transfer_authority_info.clone(),
|
||||
amount,
|
||||
&pool_account_info.key,
|
||||
pool_account_info.key,
|
||||
pool.bump_seed,
|
||||
)?;
|
||||
|
||||
|
@ -446,7 +446,7 @@ impl Processor {
|
|||
authority_account_info.clone(),
|
||||
user_transfer_authority_info.clone(),
|
||||
amount,
|
||||
&pool_account_info.key,
|
||||
pool_account_info.key,
|
||||
pool.bump_seed,
|
||||
)?;
|
||||
|
||||
|
@ -477,7 +477,7 @@ impl Processor {
|
|||
authority_account_info.clone(),
|
||||
user_transfer_authority_info.clone(),
|
||||
possible_withdraw_amount,
|
||||
&pool_account_info.key,
|
||||
pool_account_info.key,
|
||||
pool.bump_seed,
|
||||
)?;
|
||||
|
||||
|
@ -489,7 +489,7 @@ impl Processor {
|
|||
authority_account_info.clone(),
|
||||
user_transfer_authority_info.clone(),
|
||||
amount,
|
||||
&pool_account_info.key,
|
||||
pool_account_info.key,
|
||||
pool.bump_seed,
|
||||
)?;
|
||||
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
if [[ -n $RUST_STABLE_VERSION ]]; then
|
||||
stable_version="$RUST_STABLE_VERSION"
|
||||
else
|
||||
stable_version=1.52.1
|
||||
stable_version=1.53.0
|
||||
fi
|
||||
|
||||
if [[ -n $RUST_NIGHTLY_VERSION ]]; then
|
||||
nightly_version="$RUST_NIGHTLY_VERSION"
|
||||
else
|
||||
nightly_version=2021-04-18
|
||||
nightly_version=2021-06-09
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
if [[ -n $SOLANA_VERSION ]]; then
|
||||
solana_version="$SOLANA_VERSION"
|
||||
else
|
||||
solana_version=v1.6.11
|
||||
solana_version=v1.7.3
|
||||
fi
|
||||
|
||||
export solana_version="$solana_version"
|
||||
|
|
|
@ -13,11 +13,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -15,11 +15,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -8,7 +8,7 @@ use {
|
|||
|
||||
#[tokio::test]
|
||||
async fn test_custom_heap() {
|
||||
let program_id = Pubkey::from_str(&"CustomHeap111111111111111111111111111111111").unwrap();
|
||||
let program_id = Pubkey::from_str("CustomHeap111111111111111111111111111111111").unwrap();
|
||||
let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
|
||||
"spl_example_custom_heap",
|
||||
program_id,
|
||||
|
|
|
@ -13,11 +13,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -11,7 +11,7 @@ use {
|
|||
|
||||
#[tokio::test]
|
||||
async fn test_logging() {
|
||||
let program_id = Pubkey::from_str(&"Logging111111111111111111111111111111111111").unwrap();
|
||||
let program_id = Pubkey::from_str("Logging111111111111111111111111111111111111").unwrap();
|
||||
let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
|
||||
"spl_example_logging",
|
||||
program_id,
|
||||
|
|
|
@ -13,11 +13,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -21,7 +21,7 @@ pub fn process_instruction(
|
|||
let clock_via_sysvar = Clock::get()?;
|
||||
// Or deserialize the account into a clock struct
|
||||
let clock_sysvar_info = next_account_info(account_info_iter)?;
|
||||
let clock_via_account = Clock::from_account_info(&clock_sysvar_info)?;
|
||||
let clock_via_account = Clock::from_account_info(clock_sysvar_info)?;
|
||||
// Both produce the same sysvar
|
||||
assert_eq!(clock_via_sysvar, clock_via_account);
|
||||
// Note: `format!` can be very expensive, use cautiously
|
||||
|
@ -31,7 +31,7 @@ pub fn process_instruction(
|
|||
let rent_via_sysvar = Rent::get()?;
|
||||
// Or deserialize the account into a rent struct
|
||||
let rent_sysvar_info = next_account_info(account_info_iter)?;
|
||||
let rent_via_account = Rent::from_account_info(&rent_sysvar_info)?;
|
||||
let rent_via_account = Rent::from_account_info(rent_sysvar_info)?;
|
||||
// Both produce the same sysvar
|
||||
assert_eq!(rent_via_sysvar, rent_via_account);
|
||||
// Can't print `exemption_threshold` because BPF does not support printing floats
|
||||
|
|
|
@ -12,7 +12,7 @@ use {
|
|||
|
||||
#[tokio::test]
|
||||
async fn test_sysvar() {
|
||||
let program_id = Pubkey::from_str(&"Sysvar1111111111111111111111111111111111111").unwrap();
|
||||
let program_id = Pubkey::from_str("Sysvar1111111111111111111111111111111111111").unwrap();
|
||||
let (mut banks_client, payer, recent_blockhash) = ProgramTest::new(
|
||||
"spl_example_sysvar",
|
||||
program_id,
|
||||
|
|
|
@ -12,11 +12,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -11,7 +11,7 @@ use {
|
|||
|
||||
#[tokio::test]
|
||||
async fn test_lamport_transfer() {
|
||||
let program_id = Pubkey::from_str(&"TransferLamports111111111111111111111111111").unwrap();
|
||||
let program_id = Pubkey::from_str("TransferLamports111111111111111111111111111").unwrap();
|
||||
let source_pubkey = Pubkey::new_unique();
|
||||
let destination_pubkey = Pubkey::new_unique();
|
||||
let mut program_test = ProgramTest::new(
|
||||
|
|
|
@ -10,11 +10,11 @@ edition = "2018"
|
|||
[dependencies]
|
||||
chrono = "0.4.19"
|
||||
clap = "2.33.3"
|
||||
solana-clap-utils = "1.6.11"
|
||||
solana-cli-config = "1.6.11"
|
||||
solana-client = "1.6.11"
|
||||
solana-logger = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-clap-utils = "1.7.3"
|
||||
solana-cli-config = "1.7.3"
|
||||
solana-client = "1.7.3"
|
||||
solana-logger = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
spl-feature-proposal = { version = "1.0", path = "../program", features = ["no-entrypoint"] }
|
||||
|
||||
[[bin]]
|
||||
|
|
|
@ -46,7 +46,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
.global(true)
|
||||
.help("Configuration file to use");
|
||||
if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
|
||||
arg.default_value(&config_file)
|
||||
arg.default_value(config_file)
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ fn process_propose(
|
|||
Some(&config.keypair.pubkey()),
|
||||
);
|
||||
let blockhash = rpc_client.get_recent_blockhash()?.0;
|
||||
transaction.try_sign(&[&config.keypair, &feature_proposal_keypair], blockhash)?;
|
||||
transaction.try_sign(&[&config.keypair, feature_proposal_keypair], blockhash)?;
|
||||
|
||||
println!("JSON RPC URL: {}", config.json_rpc_url);
|
||||
|
||||
|
@ -399,10 +399,9 @@ fn process_tally(
|
|||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let feature_proposal = get_feature_proposal(rpc_client, feature_proposal_address)?;
|
||||
|
||||
let feature_id_address =
|
||||
spl_feature_proposal::get_feature_id_address(&feature_proposal_address);
|
||||
let feature_id_address = spl_feature_proposal::get_feature_id_address(feature_proposal_address);
|
||||
let acceptance_token_address =
|
||||
spl_feature_proposal::get_acceptance_token_address(&feature_proposal_address);
|
||||
spl_feature_proposal::get_acceptance_token_address(feature_proposal_address);
|
||||
|
||||
println!("Feature Id: {}", feature_id_address);
|
||||
println!("Acceptance Token Address: {}", acceptance_token_address);
|
||||
|
|
|
@ -14,12 +14,12 @@ test-bpf = []
|
|||
[dependencies]
|
||||
borsh = "0.8"
|
||||
borsh-derive = "0.8.1"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { version = "3.1", path = "../../token/program", features = ["no-entrypoint"] }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -126,7 +126,7 @@ pub fn process_instruction(
|
|||
mint_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&mint_signer_seeds],
|
||||
&[mint_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Initializing mint");
|
||||
|
@ -159,7 +159,7 @@ pub fn process_instruction(
|
|||
distributor_token_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&distributor_token_signer_seeds],
|
||||
&[distributor_token_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Initializing distributor token account");
|
||||
|
@ -193,7 +193,7 @@ pub fn process_instruction(
|
|||
acceptance_token_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&acceptance_token_signer_seeds],
|
||||
&[acceptance_token_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Initializing acceptance token account");
|
||||
|
@ -216,7 +216,7 @@ pub fn process_instruction(
|
|||
&spl_token::instruction::set_authority(
|
||||
&spl_token::id(),
|
||||
acceptance_token_info.key,
|
||||
Some(&feature_proposal_info.key),
|
||||
Some(feature_proposal_info.key),
|
||||
spl_token::instruction::AuthorityType::CloseAccount,
|
||||
feature_proposal_info.key,
|
||||
&[],
|
||||
|
@ -231,7 +231,7 @@ pub fn process_instruction(
|
|||
&spl_token::instruction::set_authority(
|
||||
&spl_token::id(),
|
||||
acceptance_token_info.key,
|
||||
Some(&program_id),
|
||||
Some(program_id),
|
||||
spl_token::instruction::AuthorityType::AccountOwner,
|
||||
feature_proposal_info.key,
|
||||
&[],
|
||||
|
@ -260,7 +260,7 @@ pub fn process_instruction(
|
|||
distributor_token_info.clone(),
|
||||
spl_token_program_info.clone(),
|
||||
],
|
||||
&[&mint_signer_seeds],
|
||||
&[mint_signer_seeds],
|
||||
)?;
|
||||
|
||||
// Fully fund the feature id account so the `Tally` instruction will not require any
|
||||
|
@ -283,7 +283,7 @@ pub fn process_instruction(
|
|||
invoke_signed(
|
||||
&system_instruction::allocate(feature_id_info.key, Feature::size_of() as u64),
|
||||
&[feature_id_info.clone(), system_program_info.clone()],
|
||||
&[&feature_id_signer_seeds],
|
||||
&[feature_id_signer_seeds],
|
||||
)?;
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ pub fn process_instruction(
|
|||
invoke_signed(
|
||||
&system_instruction::assign(feature_id_info.key, &feature::id()),
|
||||
&[feature_id_info.clone(), system_program_info.clone()],
|
||||
&[&feature_id_signer_seeds],
|
||||
&[feature_id_signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Feature proposal accepted");
|
||||
|
|
|
@ -19,15 +19,15 @@ num-derive = "0.3"
|
|||
num-traits = "0.2"
|
||||
serde = "1.0.121"
|
||||
serde_derive = "1.0.103"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
thiserror = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.5.0"
|
||||
proptest = "0.10"
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -304,7 +304,7 @@ pub fn create_realm(
|
|||
) -> Instruction {
|
||||
let realm_address = get_realm_address(program_id, &name);
|
||||
let community_token_holding_address =
|
||||
get_governing_token_holding_address(program_id, &realm_address, &community_token_mint);
|
||||
get_governing_token_holding_address(program_id, &realm_address, community_token_mint);
|
||||
|
||||
let mut accounts = vec![
|
||||
AccountMeta::new(realm_address, false),
|
||||
|
@ -671,7 +671,7 @@ pub fn cast_vote(
|
|||
// Args
|
||||
vote: Vote,
|
||||
) -> Instruction {
|
||||
let vote_record_address = get_vote_record_address(program_id, &proposal, &token_owner_record);
|
||||
let vote_record_address = get_vote_record_address(program_id, proposal, token_owner_record);
|
||||
|
||||
let accounts = vec![
|
||||
AccountMeta::new_readonly(*governance, false),
|
||||
|
@ -730,7 +730,7 @@ pub fn relinquish_vote(
|
|||
governance_authority: Option<Pubkey>,
|
||||
beneficiary: Option<Pubkey>,
|
||||
) -> Instruction {
|
||||
let vote_record_address = get_vote_record_address(program_id, &proposal, &token_owner_record);
|
||||
let vote_record_address = get_vote_record_address(program_id, proposal, token_owner_record);
|
||||
|
||||
let mut accounts = vec![
|
||||
AccountMeta::new_readonly(*governance, false),
|
||||
|
@ -794,7 +794,7 @@ pub fn insert_instruction(
|
|||
instruction: InstructionData,
|
||||
) -> Instruction {
|
||||
let proposal_instruction_address =
|
||||
get_proposal_instruction_address(program_id, &proposal, &index.to_le_bytes());
|
||||
get_proposal_instruction_address(program_id, proposal, &index.to_le_bytes());
|
||||
|
||||
let accounts = vec![
|
||||
AccountMeta::new_readonly(*governance, false),
|
||||
|
|
|
@ -57,7 +57,7 @@ pub fn process_cast_vote(
|
|||
|
||||
let mut proposal_data = get_proposal_data_for_governance_and_governing_mint(
|
||||
program_id,
|
||||
&proposal_info,
|
||||
proposal_info,
|
||||
governance_info.key,
|
||||
governing_token_mint_info.key,
|
||||
)?;
|
||||
|
@ -65,7 +65,7 @@ pub fn process_cast_vote(
|
|||
|
||||
let mut token_owner_record_data = get_token_owner_record_data_for_realm_and_governing_mint(
|
||||
program_id,
|
||||
&token_owner_record_info,
|
||||
token_owner_record_info,
|
||||
&governance_data.config.realm,
|
||||
governing_token_mint_info.key,
|
||||
)?;
|
||||
|
@ -104,7 +104,7 @@ pub fn process_cast_vote(
|
|||
}
|
||||
};
|
||||
|
||||
let governing_token_supply = get_spl_token_mint_supply(&governing_token_mint_info)?;
|
||||
let governing_token_supply = get_spl_token_mint_supply(governing_token_mint_info)?;
|
||||
proposal_data.try_tip_vote(governing_token_supply, &governance_data.config, clock.slot);
|
||||
|
||||
proposal_data.serialize(&mut *proposal_info.data.borrow_mut())?;
|
||||
|
|
|
@ -44,7 +44,7 @@ pub fn process_create_account_governance(
|
|||
|
||||
create_and_serialize_account_signed::<Governance>(
|
||||
payer_info,
|
||||
&account_governance_info,
|
||||
account_governance_info,
|
||||
&account_governance_data,
|
||||
&get_account_governance_address_seeds(&config.realm, &config.governed_account),
|
||||
program_id,
|
||||
|
|
|
@ -47,7 +47,7 @@ pub fn process_create_program_governance(
|
|||
let rent_sysvar_info = next_account_info(account_info_iter)?; // 6
|
||||
let rent = &Rent::from_account_info(rent_sysvar_info)?;
|
||||
|
||||
assert_is_valid_governance_config(program_id, &config, &realm_info)?;
|
||||
assert_is_valid_governance_config(program_id, &config, realm_info)?;
|
||||
|
||||
let program_governance_data = Governance {
|
||||
account_type: GovernanceAccountType::ProgramGovernance,
|
||||
|
@ -57,7 +57,7 @@ pub fn process_create_program_governance(
|
|||
|
||||
create_and_serialize_account_signed::<Governance>(
|
||||
payer_info,
|
||||
&program_governance_info,
|
||||
program_governance_info,
|
||||
&program_governance_data,
|
||||
&get_program_governance_address_seeds(&config.realm, &config.governed_account),
|
||||
program_id,
|
||||
|
@ -76,8 +76,8 @@ pub fn process_create_program_governance(
|
|||
} else {
|
||||
assert_program_upgrade_authority_is_signer(
|
||||
&config.governed_account,
|
||||
&governed_program_data_info,
|
||||
&governed_program_upgrade_authority_info,
|
||||
governed_program_data_info,
|
||||
governed_program_upgrade_authority_info,
|
||||
)?;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ pub fn process_create_proposal(
|
|||
|
||||
let token_owner_record_data = get_token_owner_record_data_for_realm_and_governing_mint(
|
||||
program_id,
|
||||
&token_owner_record_info,
|
||||
token_owner_record_info,
|
||||
&governance_data.config.realm,
|
||||
&governing_token_mint,
|
||||
)?;
|
||||
|
|
|
@ -87,7 +87,7 @@ pub fn process_create_realm(
|
|||
|
||||
create_and_serialize_account_signed::<Realm>(
|
||||
payer_info,
|
||||
&realm_info,
|
||||
realm_info,
|
||||
&realm_data,
|
||||
&get_realm_address_seeds(&name),
|
||||
program_id,
|
||||
|
|
|
@ -55,9 +55,9 @@ pub fn process_deposit_governing_tokens(
|
|||
let amount = get_spl_token_amount(governing_token_source_info)?;
|
||||
|
||||
transfer_spl_tokens(
|
||||
&governing_token_source_info,
|
||||
&governing_token_holding_info,
|
||||
&governing_token_transfer_authority_info,
|
||||
governing_token_source_info,
|
||||
governing_token_holding_info,
|
||||
governing_token_transfer_authority_info,
|
||||
amount,
|
||||
spl_token_info,
|
||||
)?;
|
||||
|
@ -70,7 +70,7 @@ pub fn process_deposit_governing_tokens(
|
|||
|
||||
if token_owner_record_info.data_is_empty() {
|
||||
// Deposited tokens can only be withdrawn by the owner so let's make sure the owner signed the transaction
|
||||
let governing_token_owner = get_spl_token_owner(&governing_token_source_info)?;
|
||||
let governing_token_owner = get_spl_token_owner(governing_token_source_info)?;
|
||||
|
||||
if !(governing_token_owner == *governing_token_owner_info.key
|
||||
&& governing_token_owner_info.is_signer)
|
||||
|
|
|
@ -53,7 +53,7 @@ pub fn process_execute_instruction(program_id: &Pubkey, accounts: &[AccountInfo]
|
|||
|
||||
invoke_signed(
|
||||
&instruction,
|
||||
&instruction_account_infos,
|
||||
instruction_account_infos,
|
||||
&[&governance_seeds[..]],
|
||||
)?;
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@ pub fn process_finalize_vote(program_id: &Pubkey, accounts: &[AccountInfo]) -> P
|
|||
|
||||
let mut proposal_data = get_proposal_data_for_governance_and_governing_mint(
|
||||
program_id,
|
||||
&proposal_info,
|
||||
proposal_info,
|
||||
governance_info.key,
|
||||
governing_token_mint_info.key,
|
||||
)?;
|
||||
|
||||
let governing_token_supply = get_spl_token_mint_supply(&governing_token_mint_info)?;
|
||||
let governing_token_supply = get_spl_token_mint_supply(governing_token_mint_info)?;
|
||||
|
||||
proposal_data.finalize_vote(governing_token_supply, &governance_data.config, clock.slot)?;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ pub fn process_insert_instruction(
|
|||
}
|
||||
|
||||
let mut proposal_data =
|
||||
get_proposal_data_for_governance(program_id, &proposal_info, governance_info.key)?;
|
||||
get_proposal_data_for_governance(program_id, proposal_info, governance_info.key)?;
|
||||
proposal_data.assert_can_edit_instructions()?;
|
||||
|
||||
let token_owner_record_data = get_token_owner_record_data_for_proposal_owner(
|
||||
|
|
|
@ -34,14 +34,14 @@ pub fn process_relinquish_vote(program_id: &Pubkey, accounts: &[AccountInfo]) ->
|
|||
|
||||
let mut proposal_data = get_proposal_data_for_governance_and_governing_mint(
|
||||
program_id,
|
||||
&proposal_info,
|
||||
proposal_info,
|
||||
governance_info.key,
|
||||
governing_token_mint_info.key,
|
||||
)?;
|
||||
|
||||
let mut token_owner_record_data = get_token_owner_record_data_for_realm_and_governing_mint(
|
||||
program_id,
|
||||
&token_owner_record_info,
|
||||
token_owner_record_info,
|
||||
&governance_data.config.realm,
|
||||
governing_token_mint_info.key,
|
||||
)?;
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn process_set_governance_delegate(
|
|||
let mut token_owner_record_data =
|
||||
get_token_owner_record_data(program_id, token_owner_record_info)?;
|
||||
|
||||
token_owner_record_data.assert_token_owner_or_delegate_is_signer(&governance_authority_info)?;
|
||||
token_owner_record_data.assert_token_owner_or_delegate_is_signer(governance_authority_info)?;
|
||||
|
||||
token_owner_record_data.governance_delegate = *new_governance_delegate;
|
||||
token_owner_record_data.serialize(&mut *token_owner_record_info.data.borrow_mut())?;
|
||||
|
|
|
@ -56,9 +56,9 @@ pub fn process_withdraw_governing_tokens(
|
|||
}
|
||||
|
||||
transfer_spl_tokens_signed(
|
||||
&governing_token_holding_info,
|
||||
&governing_token_destination_info,
|
||||
&realm_info,
|
||||
governing_token_holding_info,
|
||||
governing_token_destination_info,
|
||||
realm_info,
|
||||
&get_realm_address_seeds(&realm_data.name),
|
||||
program_id,
|
||||
token_owner_record_data.governing_token_deposit_amount,
|
||||
|
|
|
@ -97,8 +97,8 @@ pub fn get_program_governance_address_seeds<'a>(
|
|||
// Note: Only the current program upgrade authority can create an account with this PDA using CreateProgramGovernance instruction
|
||||
[
|
||||
b"program-governance",
|
||||
&realm.as_ref(),
|
||||
&governed_program.as_ref(),
|
||||
realm.as_ref(),
|
||||
governed_program.as_ref(),
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -122,8 +122,8 @@ pub fn get_account_governance_address_seeds<'a>(
|
|||
) -> [&'a [u8]; 3] {
|
||||
[
|
||||
b"account-governance",
|
||||
&realm.as_ref(),
|
||||
&governed_account.as_ref(),
|
||||
realm.as_ref(),
|
||||
governed_account.as_ref(),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -378,7 +378,7 @@ pub fn get_proposal_address_seeds<'a>(
|
|||
PROGRAM_AUTHORITY_SEED,
|
||||
governance.as_ref(),
|
||||
governing_token_mint.as_ref(),
|
||||
&proposal_index_le_bytes,
|
||||
proposal_index_le_bytes,
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ pub fn get_proposal_address<'a>(
|
|||
proposal_index_le_bytes: &'a [u8],
|
||||
) -> Pubkey {
|
||||
Pubkey::find_program_address(
|
||||
&get_proposal_address_seeds(governance, governing_token_mint, &proposal_index_le_bytes),
|
||||
&get_proposal_address_seeds(governance, governing_token_mint, proposal_index_le_bytes),
|
||||
program_id,
|
||||
)
|
||||
.0
|
||||
|
|
|
@ -118,7 +118,7 @@ pub fn get_proposal_instruction_address_seeds<'a>(
|
|||
[
|
||||
PROGRAM_AUTHORITY_SEED,
|
||||
proposal.as_ref(),
|
||||
&instruction_index_le_bytes,
|
||||
instruction_index_le_bytes,
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ pub fn get_proposal_instruction_address<'a>(
|
|||
instruction_index_le_bytes: &'a [u8],
|
||||
) -> Pubkey {
|
||||
Pubkey::find_program_address(
|
||||
&get_proposal_instruction_address_seeds(proposal, &instruction_index_le_bytes),
|
||||
&get_proposal_instruction_address_seeds(proposal, instruction_index_le_bytes),
|
||||
program_id,
|
||||
)
|
||||
.0
|
||||
|
|
|
@ -76,12 +76,12 @@ pub fn get_realm_data(
|
|||
|
||||
/// Returns Realm PDA seeds
|
||||
pub fn get_realm_address_seeds(name: &str) -> [&[u8]; 2] {
|
||||
[PROGRAM_AUTHORITY_SEED, &name.as_bytes()]
|
||||
[PROGRAM_AUTHORITY_SEED, name.as_bytes()]
|
||||
}
|
||||
|
||||
/// Returns Realm PDA address
|
||||
pub fn get_realm_address(program_id: &Pubkey, name: &str) -> Pubkey {
|
||||
Pubkey::find_program_address(&get_realm_address_seeds(&name), program_id).0
|
||||
Pubkey::find_program_address(&get_realm_address_seeds(name), program_id).0
|
||||
}
|
||||
|
||||
/// Returns Realm Token Holding PDA seeds
|
||||
|
|
|
@ -42,8 +42,8 @@ pub fn set_program_upgrade_authority<'a>(
|
|||
) -> Result<(), ProgramError> {
|
||||
let set_upgrade_authority_instruction = bpf_loader_upgradeable::set_upgrade_authority(
|
||||
program_address,
|
||||
&program_upgrade_authority_info.key,
|
||||
Some(&new_authority_info.key),
|
||||
program_upgrade_authority_info.key,
|
||||
Some(new_authority_info.key),
|
||||
);
|
||||
|
||||
invoke(
|
||||
|
|
|
@ -16,14 +16,14 @@ borsh = "0.8"
|
|||
borsh-derive = "0.8.1"
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
thiserror = "1.0"
|
||||
uint = "0.8"
|
||||
|
||||
[dev-dependencies]
|
||||
proptest = "1.0.0"
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -322,7 +322,7 @@ impl PreciseNumber {
|
|||
Some(num) => self.checked_div(&num)?,
|
||||
None => Self::new(0)?,
|
||||
};
|
||||
guess = first_term.checked_add(&second_term)?.checked_div(&root)?;
|
||||
guess = first_term.checked_add(&second_term)?.checked_div(root)?;
|
||||
if last_guess.almost_eq(&guess, precision) {
|
||||
break;
|
||||
} else {
|
||||
|
|
|
@ -12,11 +12,11 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -52,7 +52,7 @@ mod tests {
|
|||
let emoji = "🐆".as_bytes();
|
||||
let bytes = [0xF0, 0x9F, 0x90, 0x86];
|
||||
assert_eq!(emoji, bytes);
|
||||
assert_eq!(Ok(()), process_instruction(&program_id, &[], &emoji));
|
||||
assert_eq!(Ok(()), process_instruction(&program_id, &[], emoji));
|
||||
|
||||
let mut bad_utf8 = bytes;
|
||||
bad_utf8[3] = 0xFF; // Invalid UTF-8 byte
|
||||
|
|
|
@ -14,15 +14,15 @@ no-entrypoint = []
|
|||
test-bpf = []
|
||||
|
||||
[dependencies]
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
num-traits = "0.2"
|
||||
borsh = "0.8.1"
|
||||
num-derive = "0.3.3"
|
||||
thiserror = "1.0.24"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -82,7 +82,7 @@ pub enum NameRegistryInstruction {
|
|||
Delete,
|
||||
}
|
||||
|
||||
#[allow(clippy::clippy::too_many_arguments)]
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn create(
|
||||
name_service_program_id: Pubkey,
|
||||
instruction_data: NameRegistryInstruction,
|
||||
|
|
|
@ -38,7 +38,7 @@ impl Processor {
|
|||
let parent_name_owner = next_account_info(accounts_iter).ok();
|
||||
|
||||
let (name_account_key, seeds) = get_seeds_and_key(
|
||||
&program_id,
|
||||
program_id,
|
||||
hashed_name,
|
||||
Some(name_class.key),
|
||||
Some(parent_name_account.key),
|
||||
|
@ -84,7 +84,7 @@ impl Processor {
|
|||
// The creation is done in three steps: transfer, allocate and assign, because
|
||||
// one cannot `system_instruction::create` an account to which lamports have been transfered before.
|
||||
invoke(
|
||||
&system_instruction::transfer(&payer_account.key, &name_account_key, lamports),
|
||||
&system_instruction::transfer(payer_account.key, &name_account_key, lamports),
|
||||
&[
|
||||
payer_account.clone(),
|
||||
name_account.clone(),
|
||||
|
@ -99,7 +99,7 @@ impl Processor {
|
|||
)?;
|
||||
|
||||
invoke_signed(
|
||||
&system_instruction::assign(name_account.key, &program_id),
|
||||
&system_instruction::assign(name_account.key, program_id),
|
||||
&[name_account.clone(), system_program.clone()],
|
||||
&[&seeds.chunks(32).collect::<Vec<&[u8]>>()],
|
||||
)?;
|
||||
|
|
|
@ -16,12 +16,12 @@ borsh = "0.8.1"
|
|||
borsh-derive = "0.8.1"
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
thiserror = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -12,11 +12,11 @@ test-bpf = []
|
|||
|
||||
[dependencies]
|
||||
arrayref = "0.3.6"
|
||||
solana-program = "=1.6.11"
|
||||
solana-program = "=1.7.3"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-program-test = "=1.6.11"
|
||||
solana-sdk = "=1.6.11"
|
||||
solana-program-test = "=1.7.3"
|
||||
solana-sdk = "=1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -12,13 +12,13 @@ version = "0.2.0"
|
|||
borsh = "0.8"
|
||||
clap = "2.33.3"
|
||||
serde_json = "1.0.62"
|
||||
solana-account-decoder = "1.6.11"
|
||||
solana-clap-utils = "1.6.11"
|
||||
solana-cli-config = "1.6.11"
|
||||
solana-client = "1.6.11"
|
||||
solana-logger = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program = "1.6.11"
|
||||
solana-account-decoder = "1.7.3"
|
||||
solana-clap-utils = "1.7.3"
|
||||
solana-cli-config = "1.7.3"
|
||||
solana-client = "1.7.3"
|
||||
solana-logger = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
solana-program = "1.7.3"
|
||||
spl-associated-token-account = { version = "1.0", path="../../associated-token-account/program", features = [ "no-entrypoint" ] }
|
||||
spl-stake-pool = { version = "0.2", path="../program", features = [ "no-entrypoint" ] }
|
||||
spl-token = { version = "3.1", path="../../token/program", features = [ "no-entrypoint" ] }
|
||||
|
|
|
@ -31,7 +31,7 @@ pub fn get_validator_list(
|
|||
validator_list_address: &Pubkey,
|
||||
) -> Result<ValidatorList, Error> {
|
||||
let account_data = rpc_client.get_account_data(validator_list_address)?;
|
||||
let validator_list = try_from_slice_unchecked::<ValidatorList>(&account_data.as_slice())
|
||||
let validator_list = try_from_slice_unchecked::<ValidatorList>(account_data.as_slice())
|
||||
.map_err(|err| format!("Invalid validator list {}: {}", validator_list_address, err))?;
|
||||
Ok(validator_list)
|
||||
}
|
||||
|
|
|
@ -252,8 +252,8 @@ fn command_create_pool(
|
|||
check_fee_payer_balance(
|
||||
config,
|
||||
total_rent_free_balances
|
||||
+ fee_calculator.calculate_fee(&setup_transaction.message())
|
||||
+ fee_calculator.calculate_fee(&initialize_transaction.message()),
|
||||
+ fee_calculator.calculate_fee(setup_transaction.message())
|
||||
+ fee_calculator.calculate_fee(initialize_transaction.message()),
|
||||
)?;
|
||||
let mut setup_signers = vec![
|
||||
config.fee_payer.as_ref(),
|
||||
|
@ -263,7 +263,7 @@ fn command_create_pool(
|
|||
];
|
||||
unique_signers!(setup_signers);
|
||||
setup_transaction.sign(&setup_signers, recent_blockhash);
|
||||
send_transaction(&config, setup_transaction)?;
|
||||
send_transaction(config, setup_transaction)?;
|
||||
|
||||
println!("Creating stake pool {}", stake_pool_keypair.pubkey());
|
||||
let mut initialize_signers = vec![
|
||||
|
@ -274,7 +274,7 @@ fn command_create_pool(
|
|||
];
|
||||
unique_signers!(initialize_signers);
|
||||
initialize_transaction.sign(&initialize_signers, recent_blockhash);
|
||||
send_transaction(&config, initialize_transaction)?;
|
||||
send_transaction(config, initialize_transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -290,22 +290,22 @@ fn command_vsa_create(
|
|||
// Create new validator stake account address
|
||||
spl_stake_pool::instruction::create_validator_stake_account_with_vote(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&config.staker.pubkey(),
|
||||
&config.fee_payer.pubkey(),
|
||||
&vote_account,
|
||||
vote_account,
|
||||
),
|
||||
],
|
||||
Some(&config.fee_payer.pubkey()),
|
||||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
transaction.sign(
|
||||
&[config.fee_payer.as_ref(), config.staker.as_ref()],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -347,19 +347,19 @@ fn command_vsa_add(
|
|||
let instruction = spl_stake_pool::instruction::add_validator_to_pool_with_vote(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool,
|
||||
&stake_pool_address,
|
||||
&vote_account,
|
||||
stake_pool_address,
|
||||
vote_account,
|
||||
);
|
||||
|
||||
let mut transaction =
|
||||
Transaction::new_with_payer(&[instruction], Some(&config.fee_payer.pubkey()));
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
let mut signers = vec![config.fee_payer.as_ref(), config.staker.as_ref()];
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -393,12 +393,12 @@ fn command_vsa_remove(
|
|||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
transaction.sign(
|
||||
&[config.fee_payer.as_ref(), config.staker.as_ref()],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -426,12 +426,12 @@ fn command_increase_validator_stake(
|
|||
Transaction::new_with_payer(&[instruction], Some(&config.fee_payer.pubkey()));
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
transaction.sign(
|
||||
&[config.fee_payer.as_ref(), config.staker.as_ref()],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -459,12 +459,12 @@ fn command_decrease_validator_stake(
|
|||
Transaction::new_with_payer(&[instruction], Some(&config.fee_payer.pubkey()));
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
transaction.sign(
|
||||
&[config.fee_payer.as_ref(), config.staker.as_ref()],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -478,7 +478,7 @@ fn command_set_preferred_validator(
|
|||
let mut transaction = Transaction::new_with_payer(
|
||||
&[spl_stake_pool::instruction::set_preferred_validator(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&config.staker.pubkey(),
|
||||
&stake_pool.validator_list,
|
||||
preferred_type,
|
||||
|
@ -488,11 +488,11 @@ fn command_set_preferred_validator(
|
|||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
let mut signers = vec![config.fee_payer.as_ref(), config.staker.as_ref()];
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ fn command_deposit(
|
|||
}
|
||||
|
||||
let stake_pool = get_stake_pool(&config.rpc_client, stake_pool_address)?;
|
||||
let stake_state = get_stake_state(&config.rpc_client, &stake)?;
|
||||
let stake_state = get_stake_state(&config.rpc_client, stake)?;
|
||||
|
||||
if config.verbose {
|
||||
println!("Depositing stake account {:?}", stake_state);
|
||||
|
@ -568,7 +568,7 @@ fn command_deposit(
|
|||
|
||||
// Create token account if not specified
|
||||
let token_receiver = token_receiver.unwrap_or(add_associated_token_account(
|
||||
&config,
|
||||
config,
|
||||
&stake_pool.pool_mint,
|
||||
&mut instructions,
|
||||
&mut total_rent_free_balances,
|
||||
|
@ -590,11 +590,11 @@ fn command_deposit(
|
|||
|
||||
spl_stake_pool::instruction::deposit_with_authority(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&stake_pool.validator_list,
|
||||
&deposit_authority.pubkey(),
|
||||
&pool_withdraw_authority,
|
||||
&stake,
|
||||
stake,
|
||||
&config.staker.pubkey(),
|
||||
&validator_stake_account,
|
||||
&stake_pool.reserve_stake,
|
||||
|
@ -605,10 +605,10 @@ fn command_deposit(
|
|||
} else {
|
||||
spl_stake_pool::instruction::deposit(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&stake_pool.validator_list,
|
||||
&pool_withdraw_authority,
|
||||
&stake,
|
||||
stake,
|
||||
&config.staker.pubkey(),
|
||||
&validator_stake_account,
|
||||
&stake_pool.reserve_stake,
|
||||
|
@ -626,11 +626,11 @@ fn command_deposit(
|
|||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(
|
||||
config,
|
||||
total_rent_free_balances + fee_calculator.calculate_fee(&transaction.message()),
|
||||
total_rent_free_balances + fee_calculator.calculate_fee(transaction.message()),
|
||||
)?;
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -737,9 +737,9 @@ fn command_update(
|
|||
Transaction::new_with_payer(&[instruction], Some(&config.fee_payer.pubkey()));
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
transaction.sign(&[config.fee_payer.as_ref()], recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -757,7 +757,7 @@ fn prepare_withdraw_accounts(
|
|||
pool_amount: u64,
|
||||
) -> Result<Vec<WithdrawAccount>, Error> {
|
||||
let mut accounts =
|
||||
get_stake_accounts_by_withdraw_authority(rpc_client, &pool_withdraw_authority)?;
|
||||
get_stake_accounts_by_withdraw_authority(rpc_client, pool_withdraw_authority)?;
|
||||
if accounts.is_empty() {
|
||||
return Err("No accounts found.".to_string().into());
|
||||
}
|
||||
|
@ -853,7 +853,7 @@ fn command_withdraw(
|
|||
} else if let Some(vote_account_address) = vote_account_address {
|
||||
let (stake_account_address, _) = find_stake_program_address(
|
||||
&spl_stake_pool::id(),
|
||||
&vote_account_address,
|
||||
vote_account_address,
|
||||
stake_pool_address,
|
||||
);
|
||||
let stake_account = config.rpc_client.get_account(&stake_account_address)?;
|
||||
|
@ -953,7 +953,7 @@ fn command_withdraw(
|
|||
|
||||
instructions.push(spl_stake_pool::instruction::withdraw(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&stake_pool.validator_list,
|
||||
&pool_withdraw_authority,
|
||||
&withdraw_account.address,
|
||||
|
@ -973,11 +973,11 @@ fn command_withdraw(
|
|||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(
|
||||
config,
|
||||
total_rent_free_balances + fee_calculator.calculate_fee(&transaction.message()),
|
||||
total_rent_free_balances + fee_calculator.calculate_fee(transaction.message()),
|
||||
)?;
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ fn command_set_manager(
|
|||
let mut transaction = Transaction::new_with_payer(
|
||||
&[spl_stake_pool::instruction::set_manager(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&config.manager.pubkey(),
|
||||
&new_manager,
|
||||
&new_fee_receiver,
|
||||
|
@ -1021,11 +1021,11 @@ fn command_set_manager(
|
|||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
let mut signers = vec![config.fee_payer.as_ref(), config.manager.as_ref()];
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1037,19 +1037,19 @@ fn command_set_staker(
|
|||
let mut transaction = Transaction::new_with_payer(
|
||||
&[spl_stake_pool::instruction::set_staker(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&config.manager.pubkey(),
|
||||
&new_staker,
|
||||
new_staker,
|
||||
)],
|
||||
Some(&config.fee_payer.pubkey()),
|
||||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
let mut signers = vec![config.fee_payer.as_ref(), config.manager.as_ref()];
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1057,7 +1057,7 @@ fn command_set_fee(config: &Config, stake_pool_address: &Pubkey, new_fee: Fee) -
|
|||
let mut transaction = Transaction::new_with_payer(
|
||||
&[spl_stake_pool::instruction::set_fee(
|
||||
&spl_stake_pool::id(),
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&config.manager.pubkey(),
|
||||
new_fee,
|
||||
)],
|
||||
|
@ -1065,11 +1065,11 @@ fn command_set_fee(config: &Config, stake_pool_address: &Pubkey, new_fee: Fee) -
|
|||
);
|
||||
|
||||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(&transaction.message()))?;
|
||||
check_fee_payer_balance(config, fee_calculator.calculate_fee(transaction.message()))?;
|
||||
let mut signers = vec![config.fee_payer.as_ref(), config.manager.as_ref()];
|
||||
unique_signers!(signers);
|
||||
transaction.sign(&signers, recent_blockhash);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1089,7 +1089,7 @@ fn main() {
|
|||
.global(true)
|
||||
.help("Configuration file to use");
|
||||
if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
|
||||
arg.default_value(&config_file)
|
||||
arg.default_value(config_file)
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
|
|
|
@ -19,16 +19,16 @@ num-traits = "0.2"
|
|||
num_enum = "0.5.1"
|
||||
serde = "1.0.121"
|
||||
serde_derive = "1.0.103"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { version = "3.1", path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
thiserror = "1.0"
|
||||
bincode = "1.3.1"
|
||||
|
||||
[dev-dependencies]
|
||||
proptest = "0.10"
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-vote-program = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
solana-vote-program = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -580,7 +580,7 @@ pub fn remove_validator_from_pool_with_vote(
|
|||
let (stake_account_address, _) =
|
||||
find_stake_program_address(program_id, vote_account_address, stake_pool_address);
|
||||
let (transient_stake_account, _) =
|
||||
find_transient_stake_program_address(program_id, &vote_account_address, stake_pool_address);
|
||||
find_transient_stake_program_address(program_id, vote_account_address, stake_pool_address);
|
||||
remove_validator_from_pool(
|
||||
program_id,
|
||||
stake_pool_address,
|
||||
|
@ -632,12 +632,12 @@ pub fn decrease_validator_stake_with_vote(
|
|||
let pool_withdraw_authority =
|
||||
find_withdraw_authority_program_address(program_id, stake_pool_address).0;
|
||||
let (validator_stake_address, _) =
|
||||
find_stake_program_address(program_id, &vote_account_address, stake_pool_address);
|
||||
find_stake_program_address(program_id, vote_account_address, stake_pool_address);
|
||||
let (transient_stake_address, _) =
|
||||
find_transient_stake_program_address(program_id, &vote_account_address, stake_pool_address);
|
||||
find_transient_stake_program_address(program_id, vote_account_address, stake_pool_address);
|
||||
decrease_validator_stake(
|
||||
program_id,
|
||||
&stake_pool_address,
|
||||
stake_pool_address,
|
||||
&stake_pool.staker,
|
||||
&pool_withdraw_authority,
|
||||
&stake_pool.validator_list,
|
||||
|
@ -753,7 +753,7 @@ pub fn update_stake_pool(
|
|||
&withdraw_authority,
|
||||
&stake_pool.validator_list,
|
||||
&stake_pool.reserve_stake,
|
||||
&accounts_chunk,
|
||||
accounts_chunk,
|
||||
start_index,
|
||||
no_merge,
|
||||
));
|
||||
|
|
|
@ -53,7 +53,7 @@ fn check_validator_stake_address(
|
|||
) -> Result<(), ProgramError> {
|
||||
// Check stake account address validity
|
||||
let (validator_stake_address, _) =
|
||||
crate::find_stake_program_address(&program_id, &vote_address, &stake_pool_address);
|
||||
crate::find_stake_program_address(program_id, vote_address, stake_pool_address);
|
||||
if validator_stake_address != *stake_account_address {
|
||||
msg!(
|
||||
"Incorrect stake account address for vote {}, expected {}, received {}",
|
||||
|
@ -75,11 +75,8 @@ fn check_transient_stake_address(
|
|||
vote_address: &Pubkey,
|
||||
) -> Result<u8, ProgramError> {
|
||||
// Check stake account address validity
|
||||
let (transient_stake_address, bump_seed) = crate::find_transient_stake_program_address(
|
||||
&program_id,
|
||||
&vote_address,
|
||||
&stake_pool_address,
|
||||
);
|
||||
let (transient_stake_address, bump_seed) =
|
||||
crate::find_transient_stake_program_address(program_id, vote_address, stake_pool_address);
|
||||
if transient_stake_address != *stake_account_address {
|
||||
Err(StakePoolError::InvalidStakeAccountAddress.into())
|
||||
} else {
|
||||
|
@ -147,12 +144,12 @@ fn create_transient_stake_account<'a>(
|
|||
transient_stake_account_info.clone(),
|
||||
system_program_info.clone(),
|
||||
],
|
||||
&[&transient_stake_account_signer_seeds],
|
||||
&[transient_stake_account_signer_seeds],
|
||||
)?;
|
||||
invoke_signed(
|
||||
&system_instruction::assign(transient_stake_account_info.key, &stake_program::id()),
|
||||
&[transient_stake_account_info, system_program_info],
|
||||
&[&transient_stake_account_signer_seeds],
|
||||
&[transient_stake_account_signer_seeds],
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -648,11 +645,8 @@ impl Processor {
|
|||
check_system_program(system_program_info.key)?;
|
||||
check_stake_program(stake_program_info.key)?;
|
||||
|
||||
let (stake_address, bump_seed) = crate::find_stake_program_address(
|
||||
&program_id,
|
||||
&validator_info.key,
|
||||
&stake_pool_info.key,
|
||||
);
|
||||
let (stake_address, bump_seed) =
|
||||
crate::find_stake_program_address(program_id, validator_info.key, stake_pool_info.key);
|
||||
if stake_address != *stake_account_info.key {
|
||||
return Err(StakePoolError::InvalidStakeAccountAddress.into());
|
||||
}
|
||||
|
@ -670,19 +664,19 @@ impl Processor {
|
|||
// Create new stake account
|
||||
invoke_signed(
|
||||
&system_instruction::create_account(
|
||||
&funder_info.key,
|
||||
&stake_account_info.key,
|
||||
funder_info.key,
|
||||
stake_account_info.key,
|
||||
required_lamports,
|
||||
std::mem::size_of::<stake_program::StakeState>() as u64,
|
||||
&stake_program::id(),
|
||||
),
|
||||
&[funder_info.clone(), stake_account_info.clone()],
|
||||
&[&stake_account_signer_seeds],
|
||||
&[stake_account_signer_seeds],
|
||||
)?;
|
||||
|
||||
invoke(
|
||||
&stake_program::initialize(
|
||||
&stake_account_info.key,
|
||||
stake_account_info.key,
|
||||
&stake_program::Authorized {
|
||||
staker: *staker_info.key,
|
||||
withdrawer: *staker_info.key,
|
||||
|
@ -698,9 +692,9 @@ impl Processor {
|
|||
|
||||
invoke(
|
||||
&stake_program::delegate_stake(
|
||||
&stake_account_info.key,
|
||||
&staker_info.key,
|
||||
&validator_info.key,
|
||||
stake_account_info.key,
|
||||
staker_info.key,
|
||||
validator_info.key,
|
||||
),
|
||||
&[
|
||||
stake_account_info.clone(),
|
||||
|
@ -1037,7 +1031,7 @@ impl Processor {
|
|||
|
||||
create_transient_stake_account(
|
||||
transient_stake_account_info.clone(),
|
||||
&transient_stake_account_signer_seeds,
|
||||
transient_stake_account_signer_seeds,
|
||||
system_program_info.clone(),
|
||||
)?;
|
||||
|
||||
|
@ -1131,7 +1125,7 @@ impl Processor {
|
|||
program_id,
|
||||
stake_pool_info.key,
|
||||
transient_stake_account_info.key,
|
||||
&vote_account_address,
|
||||
vote_account_address,
|
||||
)?;
|
||||
let transient_stake_account_signer_seeds: &[&[_]] = &[
|
||||
TRANSIENT_STAKE_SEED,
|
||||
|
@ -1140,7 +1134,7 @@ impl Processor {
|
|||
&[transient_stake_bump_seed],
|
||||
];
|
||||
|
||||
let maybe_validator_list_entry = validator_list.find_mut(&vote_account_address);
|
||||
let maybe_validator_list_entry = validator_list.find_mut(vote_account_address);
|
||||
if maybe_validator_list_entry.is_none() {
|
||||
msg!(
|
||||
"Vote account {} not found in stake pool",
|
||||
|
@ -1184,7 +1178,7 @@ impl Processor {
|
|||
|
||||
create_transient_stake_account(
|
||||
transient_stake_account_info.clone(),
|
||||
&transient_stake_account_signer_seeds,
|
||||
transient_stake_account_signer_seeds,
|
||||
system_program_info.clone(),
|
||||
)?;
|
||||
|
||||
|
@ -1290,7 +1284,7 @@ impl Processor {
|
|||
if !stake_pool.is_valid() {
|
||||
return Err(StakePoolError::InvalidState.into());
|
||||
}
|
||||
stake_pool.check_validator_list(&validator_list_info)?;
|
||||
stake_pool.check_validator_list(validator_list_info)?;
|
||||
stake_pool.check_authority_withdraw(
|
||||
withdraw_authority_info.key,
|
||||
program_id,
|
||||
|
@ -1848,7 +1842,7 @@ impl Processor {
|
|||
.find(|&&x| x.stake_lamports() != 0)
|
||||
{
|
||||
let (validator_stake_address, _) = crate::find_stake_program_address(
|
||||
&program_id,
|
||||
program_id,
|
||||
&withdrawable_entry.vote_account_address,
|
||||
stake_pool_info.key,
|
||||
);
|
||||
|
@ -1863,7 +1857,7 @@ impl Processor {
|
|||
let meta = stake_state.meta().ok_or(StakePoolError::WrongStakeState)?;
|
||||
stake_split_from
|
||||
.lamports()
|
||||
.checked_sub(minimum_reserve_lamports(&meta))
|
||||
.checked_sub(minimum_reserve_lamports(meta))
|
||||
.ok_or(StakePoolError::StakeLamportsNotEqualToMinimum)?;
|
||||
None
|
||||
} else {
|
||||
|
|
|
@ -349,7 +349,7 @@ async fn fail_with_small_lamport_amount() {
|
|||
.unwrap();
|
||||
|
||||
match error {
|
||||
TransactionError::InstructionError(_, InstructionError::InvalidError) => {}
|
||||
TransactionError::InstructionError(_, InstructionError::AccountNotRentExempt) => {}
|
||||
_ => panic!("Wrong error occurs while try to decrease small stake"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ async fn fail_with_small_lamport_amount() {
|
|||
.unwrap();
|
||||
|
||||
match error {
|
||||
TransactionError::InstructionError(_, InstructionError::InvalidError) => {}
|
||||
TransactionError::InstructionError(_, InstructionError::AccountNotRentExempt) => {}
|
||||
_ => panic!("Wrong error"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@ borsh = "0.8"
|
|||
curve25519-dalek = {package = "curve25519-dalek-ng", git = "https://github.com/garious/curve25519-dalek", rev = "fcef1fa11b3d3e89a1abf8986386ba9ae375392c", default-features = false, features = ["borsh"]}
|
||||
elgamal_ristretto = { git = "https://github.com/garious/elgamal", rev = "892dbe115104bcb8cc26d79f9676c836ff6c018e", default-features = false }
|
||||
futures = "0.3"
|
||||
solana-banks-client = "1.6.11"
|
||||
solana-cli-config = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-banks-client = "1.7.3"
|
||||
solana-cli-config = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
spl-themis-ristretto = { version = "0.1.0", path = "../program_ristretto", features = ["no-entrypoint"] }
|
||||
tarpc = { version = "0.22.0", features = ["full"] }
|
||||
tokio = "0.3"
|
||||
|
@ -25,11 +25,11 @@ url = "2.1"
|
|||
|
||||
[dev-dependencies]
|
||||
separator = "0.4.1"
|
||||
solana-banks-server = "1.6.11"
|
||||
solana-bpf-loader-program = "1.6.11"
|
||||
solana-core = "1.6.11"
|
||||
solana-banks-server = "1.7.3"
|
||||
solana-bpf-loader-program = "1.7.3"
|
||||
solana-core = "1.7.3"
|
||||
solana_rbpf = "0.1"
|
||||
solana-runtime = "1.6.11"
|
||||
solana-runtime = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -20,7 +20,7 @@ getrandom = { version = "0.1.15", features = ["dummy"] }
|
|||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
rand = "0.8.0"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
subtle = "=2.2.3"
|
||||
thiserror = "1.0"
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ version = "0.1.0"
|
|||
|
||||
[dependencies]
|
||||
clap = "2.33.3"
|
||||
solana-clap-utils = "1.6.6"
|
||||
solana-cli-config = "1.6.6"
|
||||
solana-client = "1.6.6"
|
||||
solana-logger = "1.6.6"
|
||||
solana-sdk = "1.6.6"
|
||||
solana-program = "1.6.6"
|
||||
solana-clap-utils = "1.7.3"
|
||||
solana-cli-config = "1.7.3"
|
||||
solana-client = "1.7.3"
|
||||
solana-logger = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
solana-program = "1.7.3"
|
||||
spl-token-lending = { path="../program", features = [ "no-entrypoint" ] }
|
||||
spl-token = { path="../../token/program", features = [ "no-entrypoint" ] }
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ fn main() {
|
|||
.global(true)
|
||||
.help("Configuration file to use");
|
||||
if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
|
||||
arg.default_value(&config_file)
|
||||
arg.default_value(config_file)
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
|
@ -459,13 +459,13 @@ fn command_create_lending_market(
|
|||
let (recent_blockhash, fee_calculator) = config.rpc_client.get_recent_blockhash()?;
|
||||
check_fee_payer_balance(
|
||||
config,
|
||||
lending_market_balance + fee_calculator.calculate_fee(&transaction.message()),
|
||||
lending_market_balance + fee_calculator.calculate_fee(transaction.message()),
|
||||
)?;
|
||||
transaction.sign(
|
||||
&vec![config.fee_payer.as_ref(), &lending_market_keypair],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction)?;
|
||||
send_transaction(config, transaction)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -644,9 +644,9 @@ fn command_add_reserve(
|
|||
check_fee_payer_balance(
|
||||
config,
|
||||
total_balance
|
||||
+ fee_calculator.calculate_fee(&transaction_1.message())
|
||||
+ fee_calculator.calculate_fee(&transaction_2.message())
|
||||
+ fee_calculator.calculate_fee(&transaction_3.message()),
|
||||
+ fee_calculator.calculate_fee(transaction_1.message())
|
||||
+ fee_calculator.calculate_fee(transaction_2.message())
|
||||
+ fee_calculator.calculate_fee(transaction_3.message()),
|
||||
)?;
|
||||
transaction_1.sign(
|
||||
&vec![
|
||||
|
@ -675,9 +675,9 @@ fn command_add_reserve(
|
|||
],
|
||||
recent_blockhash,
|
||||
);
|
||||
send_transaction(&config, transaction_1)?;
|
||||
send_transaction(&config, transaction_2)?;
|
||||
send_transaction(&config, transaction_3)?;
|
||||
send_transaction(config, transaction_1)?;
|
||||
send_transaction(config, transaction_2)?;
|
||||
send_transaction(config, transaction_3)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ arrayref = "0.3.6"
|
|||
bytemuck = "1.5.1"
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-token = { path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
thiserror = "1.0"
|
||||
uint = "0.8"
|
||||
|
@ -26,8 +26,8 @@ assert_matches = "1.5.0"
|
|||
base64 = "0.13"
|
||||
log = "0.4.14"
|
||||
proptest = "1.0"
|
||||
solana-program-test = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-program-test = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
serde = "1.0"
|
||||
serde_yaml = "0.8"
|
||||
|
||||
|
|
|
@ -1484,8 +1484,8 @@ fn process_liquidate_obligation(
|
|||
} = withdraw_reserve.calculate_liquidation(
|
||||
liquidity_amount,
|
||||
&obligation,
|
||||
&liquidity,
|
||||
&collateral,
|
||||
liquidity,
|
||||
collateral,
|
||||
)?;
|
||||
|
||||
if repay_amount == 0 {
|
||||
|
|
|
@ -32,6 +32,7 @@ async fn test_success() {
|
|||
|
||||
let receiver_program_account = Keypair::new();
|
||||
let receiver_program_id = receiver_program_account.pubkey();
|
||||
test.prefer_bpf(false);
|
||||
test.add_program(
|
||||
"flash_loan_receiver",
|
||||
receiver_program_id.clone(),
|
||||
|
@ -151,6 +152,7 @@ async fn test_failure() {
|
|||
|
||||
let flash_loan_receiver_program_keypair = Keypair::new();
|
||||
let flash_loan_receiver_program_id = flash_loan_receiver_program_keypair.pubkey();
|
||||
test.prefer_bpf(false);
|
||||
test.add_program(
|
||||
"flash_loan_receiver",
|
||||
flash_loan_receiver_program_id.clone(),
|
||||
|
|
|
@ -17,7 +17,7 @@ arrayref = "0.3.6"
|
|||
enum_dispatch = "0.3.4"
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-math = { version = "0.1", path = "../../libraries/math", features = [ "no-entrypoint" ] }
|
||||
spl-token = { version = "3.1", path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
thiserror = "1.0"
|
||||
|
@ -25,7 +25,7 @@ arbitrary = { version = "0.4", features = ["derive"], optional = true }
|
|||
roots = { version = "0.0.6", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-sdk = "1.6.11"
|
||||
solana-sdk = "1.7.3"
|
||||
proptest = "1.0"
|
||||
sim = { path = "./sim" }
|
||||
roots = "0.0.6"
|
||||
|
|
|
@ -11,7 +11,7 @@ publish = false
|
|||
[dependencies]
|
||||
honggfuzz = { version = "0.5.52" }
|
||||
arbitrary = { version = "0.4", features = ["derive"] }
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
spl-math = { version = "0.1", path = "../../../libraries/math", features = [ "no-entrypoint" ] }
|
||||
spl-token = { version = "3.1", path = "../../../token/program", features = [ "no-entrypoint" ] }
|
||||
spl-token-swap = { path = "..", features = ["fuzz", "no-entrypoint"] }
|
||||
|
|
|
@ -246,7 +246,7 @@ fn run_fuzz(fuzz_data: FuzzData) {
|
|||
// fees and a potential crash when withdrawing just 1 pool token.
|
||||
let mut fee_account = token_swap.pool_fee_account.clone();
|
||||
for mut pool_account in pool_accounts.values_mut() {
|
||||
let pool_token_amount = get_token_balance(&pool_account);
|
||||
let pool_token_amount = get_token_balance(pool_account);
|
||||
if pool_token_amount > 0 {
|
||||
transfer(&mut pool_account, &mut fee_account, pool_token_amount);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ impl program_stubs::SyscallStubs for TestSyscallStubs {
|
|||
let mut new_account_info = account_info.clone();
|
||||
for seeds in signers_seeds.iter() {
|
||||
let signer =
|
||||
Pubkey::create_program_address(&seeds, &spl_token_swap::id()).unwrap();
|
||||
Pubkey::create_program_address(seeds, &spl_token_swap::id()).unwrap();
|
||||
if *account_info.key == signer {
|
||||
new_account_info.is_signer = true;
|
||||
}
|
||||
|
|
|
@ -359,7 +359,7 @@ impl NativeTokenSwap {
|
|||
) -> ProgramResult {
|
||||
let mut user_transfer_account = NativeAccountData::new(0, system_program::id());
|
||||
user_transfer_account.is_signer = true;
|
||||
let pool_token_amount = native_token::get_token_balance(&pool_account);
|
||||
let pool_token_amount = native_token::get_token_balance(pool_account);
|
||||
// special logic to avoid withdrawing down to 1 pool token, which
|
||||
// eventually causes an error on withdrawing all
|
||||
if pool_token_amount.saturating_sub(instruction.pool_token_amount) == 1 {
|
||||
|
@ -489,7 +489,7 @@ impl NativeTokenSwap {
|
|||
) -> ProgramResult {
|
||||
let mut user_transfer_account = NativeAccountData::new(0, system_program::id());
|
||||
user_transfer_account.is_signer = true;
|
||||
let pool_token_amount = native_token::get_token_balance(&pool_account);
|
||||
let pool_token_amount = native_token::get_token_balance(pool_account);
|
||||
// special logic to avoid withdrawing down to 1 pool token, which
|
||||
// eventually causes an error on withdrawing all
|
||||
if pool_token_amount.saturating_sub(instruction.maximum_pool_token_amount) == 1 {
|
||||
|
@ -552,7 +552,7 @@ impl NativeTokenSwap {
|
|||
mut token_a_account: &mut NativeAccountData,
|
||||
mut token_b_account: &mut NativeAccountData,
|
||||
) -> ProgramResult {
|
||||
let pool_token_amount = native_token::get_token_balance(&pool_account);
|
||||
let pool_token_amount = native_token::get_token_balance(pool_account);
|
||||
if pool_token_amount > 0 {
|
||||
let instruction = WithdrawAllTokenTypes {
|
||||
pool_token_amount,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
cc ccac4396e983bbc29b354a5b048bf9da13013fed999bd331049d2fd1f674dc55
|
|
@ -48,12 +48,12 @@ pub struct StableCurve {
|
|||
/// d = (leverage * sum_x + d_product * n_coins) * initial_d / ((leverage - 1) * initial_d + (n_coins + 1) * d_product)
|
||||
fn calculate_step(initial_d: &U256, leverage: u64, sum_x: u128, d_product: &U256) -> Option<U256> {
|
||||
let leverage_mul = U256::from(leverage).checked_mul(sum_x.into())?;
|
||||
let d_p_mul = checked_u8_mul(&d_product, N_COINS)?;
|
||||
let d_p_mul = checked_u8_mul(d_product, N_COINS)?;
|
||||
|
||||
let l_val = leverage_mul.checked_add(d_p_mul)?.checked_mul(*initial_d)?;
|
||||
|
||||
let leverage_sub = initial_d.checked_mul((leverage.checked_sub(1)?).into())?;
|
||||
let n_coins_sum = checked_u8_mul(&d_product, N_COINS.checked_add(1)?)?;
|
||||
let n_coins_sum = checked_u8_mul(d_product, N_COINS.checked_add(1)?)?;
|
||||
|
||||
let r_val = leverage_sub.checked_add(n_coins_sum)?;
|
||||
|
||||
|
@ -422,8 +422,10 @@ mod tests {
|
|||
let diff =
|
||||
(sim_result as i128 - result.destination_amount_swapped as i128).abs();
|
||||
|
||||
let tolerance = std::cmp::max(1, sim_result as i128 / 1_000_000_000);
|
||||
|
||||
assert!(
|
||||
diff <= 1,
|
||||
diff <= tolerance,
|
||||
"result={}, sim_result={}, amp={}, source_amount={}, swap_source_amount={}, swap_destination_amount={}, diff={}",
|
||||
result.destination_amount_swapped,
|
||||
sim_result,
|
||||
|
|
|
@ -380,10 +380,10 @@ impl Processor {
|
|||
}
|
||||
|
||||
let source_account =
|
||||
Self::unpack_token_account(swap_source_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_source_info, token_swap.token_program_id())?;
|
||||
let dest_account =
|
||||
Self::unpack_token_account(swap_destination_info, &token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_destination_info, token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, token_swap.token_program_id())?;
|
||||
|
||||
let trade_direction = if *swap_source_info.key == *token_swap.token_a_account() {
|
||||
TradeDirection::AtoB
|
||||
|
@ -529,9 +529,9 @@ impl Processor {
|
|||
None,
|
||||
)?;
|
||||
|
||||
let token_a = Self::unpack_token_account(token_a_info, &token_swap.token_program_id())?;
|
||||
let token_b = Self::unpack_token_account(token_b_info, &token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, &token_swap.token_program_id())?;
|
||||
let token_a = Self::unpack_token_account(token_a_info, token_swap.token_program_id())?;
|
||||
let token_b = Self::unpack_token_account(token_b_info, token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, token_swap.token_program_id())?;
|
||||
let current_pool_mint_supply = to_u128(pool_mint.supply)?;
|
||||
let (pool_token_amount, pool_mint_supply) = if current_pool_mint_supply > 0 {
|
||||
(to_u128(pool_token_amount)?, current_pool_mint_supply)
|
||||
|
@ -743,11 +743,11 @@ impl Processor {
|
|||
|
||||
let token_swap = SwapVersion::unpack(&swap_info.data.borrow())?;
|
||||
let source_account =
|
||||
Self::unpack_token_account(source_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(source_info, token_swap.token_program_id())?;
|
||||
let swap_token_a =
|
||||
Self::unpack_token_account(swap_token_a_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_token_a_info, token_swap.token_program_id())?;
|
||||
let swap_token_b =
|
||||
Self::unpack_token_account(swap_token_b_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_token_b_info, token_swap.token_program_id())?;
|
||||
|
||||
let trade_direction = if source_account.mint == swap_token_a.mint {
|
||||
TradeDirection::AtoB
|
||||
|
@ -776,7 +776,7 @@ impl Processor {
|
|||
None,
|
||||
)?;
|
||||
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, &token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, token_swap.token_program_id())?;
|
||||
let pool_mint_supply = to_u128(pool_mint.supply)?;
|
||||
let pool_token_amount = if pool_mint_supply > 0 {
|
||||
token_swap
|
||||
|
@ -860,11 +860,11 @@ impl Processor {
|
|||
|
||||
let token_swap = SwapVersion::unpack(&swap_info.data.borrow())?;
|
||||
let destination_account =
|
||||
Self::unpack_token_account(destination_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(destination_info, token_swap.token_program_id())?;
|
||||
let swap_token_a =
|
||||
Self::unpack_token_account(swap_token_a_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_token_a_info, token_swap.token_program_id())?;
|
||||
let swap_token_b =
|
||||
Self::unpack_token_account(swap_token_b_info, &token_swap.token_program_id())?;
|
||||
Self::unpack_token_account(swap_token_b_info, token_swap.token_program_id())?;
|
||||
|
||||
let trade_direction = if destination_account.mint == swap_token_a.mint {
|
||||
TradeDirection::AtoB
|
||||
|
@ -892,7 +892,7 @@ impl Processor {
|
|||
Some(pool_fee_account_info),
|
||||
)?;
|
||||
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, &token_swap.token_program_id())?;
|
||||
let pool_mint = Self::unpack_mint(pool_mint_info, token_swap.token_program_id())?;
|
||||
let pool_mint_supply = to_u128(pool_mint.supply)?;
|
||||
let swap_token_a_amount = to_u128(swap_token_a.amount)?;
|
||||
let swap_token_b_amount = to_u128(swap_token_b.amount)?;
|
||||
|
@ -1200,7 +1200,7 @@ mod tests {
|
|||
let mut new_account_info = account_info.clone();
|
||||
for seeds in signers_seeds.iter() {
|
||||
let signer =
|
||||
Pubkey::create_program_address(&seeds, &SWAP_PROGRAM_ID).unwrap();
|
||||
Pubkey::create_program_address(seeds, &SWAP_PROGRAM_ID).unwrap();
|
||||
if *account_info.key == signer {
|
||||
new_account_info.is_signer = true;
|
||||
}
|
||||
|
@ -1270,7 +1270,7 @@ mod tests {
|
|||
&pool_mint_key,
|
||||
&mut pool_mint_account,
|
||||
&authority_key,
|
||||
&user_key,
|
||||
user_key,
|
||||
0,
|
||||
);
|
||||
let (pool_fee_key, pool_fee_account) = mint_token(
|
||||
|
@ -1278,26 +1278,26 @@ mod tests {
|
|||
&pool_mint_key,
|
||||
&mut pool_mint_account,
|
||||
&authority_key,
|
||||
&user_key,
|
||||
user_key,
|
||||
0,
|
||||
);
|
||||
let (token_a_mint_key, mut token_a_mint_account) =
|
||||
create_mint(&spl_token::id(), &user_key, None);
|
||||
create_mint(&spl_token::id(), user_key, None);
|
||||
let (token_a_key, token_a_account) = mint_token(
|
||||
&spl_token::id(),
|
||||
&token_a_mint_key,
|
||||
&mut token_a_mint_account,
|
||||
&user_key,
|
||||
user_key,
|
||||
&authority_key,
|
||||
token_a_amount,
|
||||
);
|
||||
let (token_b_mint_key, mut token_b_mint_account) =
|
||||
create_mint(&spl_token::id(), &user_key, None);
|
||||
create_mint(&spl_token::id(), user_key, None);
|
||||
let (token_b_key, token_b_account) = mint_token(
|
||||
&spl_token::id(),
|
||||
&token_b_mint_key,
|
||||
&mut token_b_mint_account,
|
||||
&user_key,
|
||||
user_key,
|
||||
&authority_key,
|
||||
token_b_amount,
|
||||
);
|
||||
|
@ -1368,16 +1368,16 @@ mod tests {
|
|||
&spl_token::id(),
|
||||
&self.token_a_mint_key,
|
||||
&mut self.token_a_mint_account,
|
||||
&mint_owner,
|
||||
&account_owner,
|
||||
mint_owner,
|
||||
account_owner,
|
||||
a_amount,
|
||||
);
|
||||
let (token_b_key, token_b_account) = mint_token(
|
||||
&spl_token::id(),
|
||||
&self.token_b_mint_key,
|
||||
&mut self.token_b_mint_account,
|
||||
&mint_owner,
|
||||
&account_owner,
|
||||
mint_owner,
|
||||
account_owner,
|
||||
b_amount,
|
||||
);
|
||||
let (pool_key, pool_account) = mint_token(
|
||||
|
@ -1385,7 +1385,7 @@ mod tests {
|
|||
&self.pool_mint_key,
|
||||
&mut self.pool_mint_account,
|
||||
&self.authority_key,
|
||||
&account_owner,
|
||||
account_owner,
|
||||
pool_amount,
|
||||
);
|
||||
(
|
||||
|
@ -1436,9 +1436,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&user_source_key,
|
||||
user_source_key,
|
||||
&user_transfer_key,
|
||||
&user_key,
|
||||
user_key,
|
||||
&[],
|
||||
amount_in,
|
||||
)
|
||||
|
@ -1462,10 +1462,10 @@ mod tests {
|
|||
&self.swap_key,
|
||||
&self.authority_key,
|
||||
&user_transfer_key,
|
||||
&user_source_key,
|
||||
&swap_source_key,
|
||||
&swap_destination_key,
|
||||
&user_destination_key,
|
||||
user_source_key,
|
||||
swap_source_key,
|
||||
swap_destination_key,
|
||||
user_destination_key,
|
||||
&self.pool_mint_key,
|
||||
&self.pool_fee_key,
|
||||
None,
|
||||
|
@ -1513,9 +1513,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&depositor_token_a_key,
|
||||
depositor_token_a_key,
|
||||
&user_transfer_authority,
|
||||
&depositor_key,
|
||||
depositor_key,
|
||||
&[],
|
||||
maximum_token_a_amount,
|
||||
)
|
||||
|
@ -1531,9 +1531,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&depositor_token_b_key,
|
||||
depositor_token_b_key,
|
||||
&user_transfer_authority,
|
||||
&depositor_key,
|
||||
depositor_key,
|
||||
&[],
|
||||
maximum_token_b_amount,
|
||||
)
|
||||
|
@ -1553,12 +1553,12 @@ mod tests {
|
|||
&self.swap_key,
|
||||
&self.authority_key,
|
||||
&user_transfer_authority,
|
||||
&depositor_token_a_key,
|
||||
&depositor_token_b_key,
|
||||
depositor_token_a_key,
|
||||
depositor_token_b_key,
|
||||
&self.token_a_key,
|
||||
&self.token_b_key,
|
||||
&self.pool_mint_key,
|
||||
&depositor_pool_key,
|
||||
depositor_pool_key,
|
||||
DepositAllTokenTypes {
|
||||
pool_token_amount,
|
||||
maximum_token_a_amount,
|
||||
|
@ -1600,9 +1600,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&pool_key,
|
||||
pool_key,
|
||||
&user_transfer_authority_key,
|
||||
&user_key,
|
||||
user_key,
|
||||
&[],
|
||||
pool_token_amount,
|
||||
)
|
||||
|
@ -1625,11 +1625,11 @@ mod tests {
|
|||
&user_transfer_authority_key,
|
||||
&self.pool_mint_key,
|
||||
&self.pool_fee_key,
|
||||
&pool_key,
|
||||
pool_key,
|
||||
&self.token_a_key,
|
||||
&self.token_b_key,
|
||||
&token_a_key,
|
||||
&token_b_key,
|
||||
token_a_key,
|
||||
token_b_key,
|
||||
WithdrawAllTokenTypes {
|
||||
pool_token_amount,
|
||||
minimum_token_a_amount,
|
||||
|
@ -1668,9 +1668,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&deposit_account_key,
|
||||
deposit_account_key,
|
||||
&user_transfer_authority_key,
|
||||
&depositor_key,
|
||||
depositor_key,
|
||||
&[],
|
||||
source_token_amount,
|
||||
)
|
||||
|
@ -1690,11 +1690,11 @@ mod tests {
|
|||
&self.swap_key,
|
||||
&self.authority_key,
|
||||
&user_transfer_authority_key,
|
||||
&deposit_account_key,
|
||||
deposit_account_key,
|
||||
&self.token_a_key,
|
||||
&self.token_b_key,
|
||||
&self.pool_mint_key,
|
||||
&deposit_pool_key,
|
||||
deposit_pool_key,
|
||||
DepositSingleTokenTypeExactAmountIn {
|
||||
source_token_amount,
|
||||
minimum_pool_token_amount,
|
||||
|
@ -1731,9 +1731,9 @@ mod tests {
|
|||
do_process_instruction(
|
||||
approve(
|
||||
&spl_token::id(),
|
||||
&pool_key,
|
||||
pool_key,
|
||||
&user_transfer_authority_key,
|
||||
&user_key,
|
||||
user_key,
|
||||
&[],
|
||||
maximum_pool_token_amount,
|
||||
)
|
||||
|
@ -1755,10 +1755,10 @@ mod tests {
|
|||
&user_transfer_authority_key,
|
||||
&self.pool_mint_key,
|
||||
&self.pool_fee_key,
|
||||
&pool_key,
|
||||
pool_key,
|
||||
&self.token_a_key,
|
||||
&self.token_b_key,
|
||||
&destination_key,
|
||||
destination_key,
|
||||
WithdrawSingleTokenTypeExactAmountOut {
|
||||
destination_token_amount,
|
||||
maximum_pool_token_amount,
|
||||
|
@ -1861,13 +1861,13 @@ mod tests {
|
|||
let mut account_account = Account::new(
|
||||
account_minimum_balance(),
|
||||
spl_token::state::Account::get_packed_len(),
|
||||
&program_id,
|
||||
program_id,
|
||||
);
|
||||
let mut mint_authority_account = Account::default();
|
||||
let mut rent_sysvar_account = create_account_for_test(&Rent::free());
|
||||
|
||||
do_process_instruction(
|
||||
initialize_account(&program_id, &account_key, &mint_key, account_owner_key).unwrap(),
|
||||
initialize_account(program_id, &account_key, mint_key, account_owner_key).unwrap(),
|
||||
vec![
|
||||
&mut account_account,
|
||||
&mut mint_account,
|
||||
|
@ -1880,10 +1880,10 @@ mod tests {
|
|||
if amount > 0 {
|
||||
do_process_instruction(
|
||||
mint_to(
|
||||
&program_id,
|
||||
&mint_key,
|
||||
program_id,
|
||||
mint_key,
|
||||
&account_key,
|
||||
&mint_authority_key,
|
||||
mint_authority_key,
|
||||
&[],
|
||||
amount,
|
||||
)
|
||||
|
@ -1909,12 +1909,12 @@ mod tests {
|
|||
let mut mint_account = Account::new(
|
||||
mint_minimum_balance(),
|
||||
spl_token::state::Mint::get_packed_len(),
|
||||
&program_id,
|
||||
program_id,
|
||||
);
|
||||
let mut rent_sysvar_account = create_account_for_test(&Rent::free());
|
||||
|
||||
do_process_instruction(
|
||||
initialize_mint(&program_id, &mint_key, authority_key, freeze_authority, 2).unwrap(),
|
||||
initialize_mint(program_id, &mint_key, authority_key, freeze_authority, 2).unwrap(),
|
||||
vec![&mut mint_account, &mut rent_sysvar_account],
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -2788,7 +2788,7 @@ mod tests {
|
|||
);
|
||||
}
|
||||
let swap_state = SwapVersion::unpack(&accounts.swap_account.data).unwrap();
|
||||
assert_eq!(swap_state.is_initialized(), true);
|
||||
assert!(swap_state.is_initialized());
|
||||
assert_eq!(swap_state.nonce(), accounts.nonce);
|
||||
assert_eq!(
|
||||
swap_state.swap_curve().curve_type,
|
||||
|
|
|
@ -304,7 +304,7 @@ mod tests {
|
|||
SwapVersion::pack(swap_info, &mut packed).unwrap();
|
||||
let unpacked = SwapVersion::unpack(&packed).unwrap();
|
||||
|
||||
assert_eq!(unpacked.is_initialized(), true);
|
||||
assert!(unpacked.is_initialized());
|
||||
assert_eq!(unpacked.nonce(), TEST_NONCE);
|
||||
assert_eq!(*unpacked.token_program_id(), TEST_TOKEN_PROGRAM_ID);
|
||||
assert_eq!(*unpacked.token_a_account(), TEST_TOKEN_A);
|
||||
|
|
|
@ -12,14 +12,14 @@ version = "2.0.12"
|
|||
clap = "2.33.3"
|
||||
console = "0.14.0"
|
||||
serde_json = "1.0.62"
|
||||
solana-account-decoder = "=1.6.11"
|
||||
solana-clap-utils = "=1.6.11"
|
||||
solana-cli-config = "=1.6.11"
|
||||
solana-cli-output = "=1.6.11"
|
||||
solana-client = "=1.6.11"
|
||||
solana-logger = "=1.6.11"
|
||||
solana-remote-wallet = "=1.6.11"
|
||||
solana-sdk = "=1.6.11"
|
||||
solana-account-decoder = "=1.7.3"
|
||||
solana-clap-utils = "=1.7.3"
|
||||
solana-cli-config = "=1.7.3"
|
||||
solana-cli-output = "=1.7.3"
|
||||
solana-client = "=1.7.3"
|
||||
solana-logger = "=1.7.3"
|
||||
solana-remote-wallet = "=1.7.3"
|
||||
solana-sdk = "=1.7.3"
|
||||
spl-token = { version = "3.1", path="../program", features = [ "no-entrypoint" ] }
|
||||
spl-associated-token-account = { version = "1.0", path="../../associated-token-account/program", features = [ "no-entrypoint" ] }
|
||||
spl-memo = { version = "3.0.1", path="../../memo/program", features = ["no-entrypoint"] }
|
||||
|
|
|
@ -82,7 +82,7 @@ impl<'a> Config<'a> {
|
|||
if authority_name != "owner" {
|
||||
if let Some(keypair_path) = arg_matches.value_of(authority_name) {
|
||||
return signer_from_path(
|
||||
&arg_matches,
|
||||
arg_matches,
|
||||
keypair_path,
|
||||
authority_name,
|
||||
wallet_manager,
|
||||
|
@ -123,7 +123,7 @@ impl<'a> Config<'a> {
|
|||
) -> Result<Box<dyn Signer>, Box<dyn std::error::Error>> {
|
||||
// for backwards compatibility, check owner before cli config default
|
||||
if let Some(owner_path) = matches.value_of("owner") {
|
||||
return signer_from_path(&matches, owner_path, "owner", wallet_manager);
|
||||
return signer_from_path(matches, owner_path, "owner", wallet_manager);
|
||||
}
|
||||
|
||||
let path = &self.default_keypair_path;
|
||||
|
|
|
@ -503,7 +503,7 @@ fn resolve_mint_info(
|
|||
if !config.sign_only {
|
||||
let source_account = config
|
||||
.rpc_client
|
||||
.get_token_account(&token_account)?
|
||||
.get_token_account(token_account)?
|
||||
.ok_or_else(|| format!("Could not find token account {}", token_account))?;
|
||||
let source_mint = Pubkey::from_str(&source_account.mint)?;
|
||||
if let Some(mint) = mint_address {
|
||||
|
@ -1175,7 +1175,7 @@ fn command_account_info(config: &Config, address: Pubkey) -> CommandResult {
|
|||
}
|
||||
println_name_value(
|
||||
"Close authority:",
|
||||
&account.close_authority.as_ref().unwrap_or(&String::new()),
|
||||
account.close_authority.as_ref().unwrap_or(&String::new()),
|
||||
);
|
||||
if !is_associated {
|
||||
println!();
|
||||
|
@ -1185,7 +1185,7 @@ fn command_account_info(config: &Config, address: Pubkey) -> CommandResult {
|
|||
}
|
||||
|
||||
fn get_multisig(config: &Config, address: &Pubkey) -> Result<Multisig, Error> {
|
||||
let account = config.rpc_client.get_account(&address)?;
|
||||
let account = config.rpc_client.get_account(address)?;
|
||||
Multisig::unpack(&account.data).map_err(|e| e.into())
|
||||
}
|
||||
|
||||
|
@ -1376,7 +1376,7 @@ fn main() {
|
|||
.global(true)
|
||||
.help("Configuration file to use");
|
||||
if let Some(ref config_file) = *solana_cli_config::CONFIG_FILE {
|
||||
arg.default_value(&config_file)
|
||||
arg.default_value(config_file)
|
||||
} else {
|
||||
arg
|
||||
}
|
||||
|
@ -1435,7 +1435,7 @@ fn main() {
|
|||
.validator(is_mint_decimals)
|
||||
.value_name("DECIMALS")
|
||||
.takes_value(true)
|
||||
.default_value(&default_decimals)
|
||||
.default_value(default_decimals)
|
||||
.help("Number of base 10 digits to the right of the decimal place"),
|
||||
)
|
||||
.arg(
|
||||
|
@ -2125,7 +2125,7 @@ fn main() {
|
|||
);
|
||||
|
||||
let (signer, fee_payer) = signer_from_path(
|
||||
&matches,
|
||||
matches,
|
||||
matches
|
||||
.value_of("fee_payer")
|
||||
.unwrap_or(&cli_config.keypair_path),
|
||||
|
@ -2144,14 +2144,14 @@ fn main() {
|
|||
|
||||
let verbose = matches.is_present("verbose");
|
||||
|
||||
let nonce_account = pubkey_of_signer(&matches, NONCE_ARG.name, &mut wallet_manager)
|
||||
let nonce_account = pubkey_of_signer(matches, NONCE_ARG.name, &mut wallet_manager)
|
||||
.unwrap_or_else(|e| {
|
||||
eprintln!("error: {}", e);
|
||||
exit(1);
|
||||
});
|
||||
let nonce_authority = if nonce_account.is_some() {
|
||||
let (signer, nonce_authority) = signer_from_path(
|
||||
&matches,
|
||||
matches,
|
||||
matches
|
||||
.value_of(NONCE_AUTHORITY_ARG.name)
|
||||
.unwrap_or(&cli_config.keypair_path),
|
||||
|
@ -2176,7 +2176,7 @@ fn main() {
|
|||
let blockhash_query = BlockhashQuery::new_from_matches(matches);
|
||||
let sign_only = matches.is_present(SIGN_ONLY_ARG.name);
|
||||
|
||||
let multisig_signers = signers_of(&matches, MULTISIG_SIGNER_ARG.name, &mut wallet_manager)
|
||||
let multisig_signers = signers_of(matches, MULTISIG_SIGNER_ARG.name, &mut wallet_manager)
|
||||
.unwrap_or_else(|e| {
|
||||
eprintln!("error: {}", e);
|
||||
exit(1);
|
||||
|
@ -2242,9 +2242,9 @@ fn main() {
|
|||
command_create_account(&config, token, owner, account)
|
||||
}
|
||||
("create-multisig", Some(arg_matches)) => {
|
||||
let minimum_signers = value_of::<u8>(&arg_matches, "minimum_signers").unwrap();
|
||||
let minimum_signers = value_of::<u8>(arg_matches, "minimum_signers").unwrap();
|
||||
let multisig_members =
|
||||
pubkeys_of_multiple_signers(&arg_matches, "multisig_member", &mut wallet_manager)
|
||||
pubkeys_of_multiple_signers(arg_matches, "multisig_member", &mut wallet_manager)
|
||||
.unwrap_or_else(|e| {
|
||||
eprintln!("error: {}", e);
|
||||
exit(1);
|
||||
|
@ -2310,7 +2310,7 @@ fn main() {
|
|||
config.signer_or_default(arg_matches, "owner", &mut wallet_manager);
|
||||
bulk_signers.push(owner_signer);
|
||||
|
||||
let mint_decimals = value_of::<u8>(&arg_matches, MINT_DECIMALS_ARG.name);
|
||||
let mint_decimals = value_of::<u8>(arg_matches, MINT_DECIMALS_ARG.name);
|
||||
let fund_recipient = matches.is_present("fund_recipient");
|
||||
let allow_unfunded_recipient = matches.is_present("allow_empty_recipient")
|
||||
|| matches.is_present("allow_unfunded_recipient");
|
||||
|
@ -2342,7 +2342,7 @@ fn main() {
|
|||
let amount = value_t_or_exit!(arg_matches, "amount", f64);
|
||||
let mint_address =
|
||||
pubkey_of_signer(arg_matches, MINT_ADDRESS_ARG.name, &mut wallet_manager).unwrap();
|
||||
let mint_decimals = value_of::<u8>(&arg_matches, MINT_DECIMALS_ARG.name);
|
||||
let mint_decimals = value_of::<u8>(arg_matches, MINT_DECIMALS_ARG.name);
|
||||
command_burn(&config, source, owner, amount, mint_address, mint_decimals)
|
||||
}
|
||||
("mint", Some(arg_matches)) => {
|
||||
|
@ -2359,7 +2359,7 @@ fn main() {
|
|||
"recipient",
|
||||
&mut wallet_manager,
|
||||
);
|
||||
let mint_decimals = value_of::<u8>(&arg_matches, MINT_DECIMALS_ARG.name);
|
||||
let mint_decimals = value_of::<u8>(arg_matches, MINT_DECIMALS_ARG.name);
|
||||
command_mint(
|
||||
&config,
|
||||
token,
|
||||
|
@ -2432,7 +2432,7 @@ fn main() {
|
|||
.unwrap();
|
||||
let mint_address =
|
||||
pubkey_of_signer(arg_matches, MINT_ADDRESS_ARG.name, &mut wallet_manager).unwrap();
|
||||
let mint_decimals = value_of::<u8>(&arg_matches, MINT_DECIMALS_ARG.name);
|
||||
let mint_decimals = value_of::<u8>(arg_matches, MINT_DECIMALS_ARG.name);
|
||||
command_approve(
|
||||
&config,
|
||||
account,
|
||||
|
|
|
@ -10,10 +10,6 @@ flow-typed/
|
|||
[options]
|
||||
|
||||
emoji=true
|
||||
esproposal.class_instance_fields=enable
|
||||
esproposal.class_static_fields=enable
|
||||
esproposal.decorators=ignore
|
||||
esproposal.export_star_as=enable
|
||||
module.system.node.resolve_dirname=./src
|
||||
module.use_strict=true
|
||||
experimental.const_params=true
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
// Configure Node.js tests
|
||||
module.exports = {
|
||||
require: ['@babel/register', 'esm'],
|
||||
require: ['@babel/register'],
|
||||
};
|
||||
|
|
|
@ -41,9 +41,9 @@ function assert(condition, message) {
|
|||
}
|
||||
}
|
||||
|
||||
async function didThrow(obj, func, args): Promise<boolean> {
|
||||
async function didThrow(func): Promise<boolean> {
|
||||
try {
|
||||
await func.apply(testToken, args);
|
||||
await func();
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
|
@ -226,9 +226,9 @@ export async function createAssociatedAccount(): Promise<void> {
|
|||
|
||||
// creating again should cause TX error for the associated token account
|
||||
assert(
|
||||
await didThrow(testToken, testToken.createAssociatedTokenAccount, [
|
||||
owner.publicKey,
|
||||
]),
|
||||
await didThrow(async () => {
|
||||
await testToken.createAssociatedTokenAccount(owner.publicKey);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -244,13 +244,15 @@ export async function mintTo(): Promise<void> {
|
|||
|
||||
export async function mintToChecked(): Promise<void> {
|
||||
assert(
|
||||
await didThrow(testToken, testToken.mintToChecked, [
|
||||
await didThrow(async () => {
|
||||
await testToken.mintToChecked(
|
||||
testAccount,
|
||||
testMintAuthority,
|
||||
[],
|
||||
1000,
|
||||
1,
|
||||
]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
await testToken.mintToChecked(testAccount, testMintAuthority, [], 1000, 2);
|
||||
|
@ -283,14 +285,16 @@ export async function transferChecked(): Promise<void> {
|
|||
const dest = await testToken.createAccount(destOwner.publicKey);
|
||||
|
||||
assert(
|
||||
await didThrow(testToken, testToken.transferChecked, [
|
||||
await didThrow(async () => {
|
||||
await testToken.transferChecked(
|
||||
testAccount,
|
||||
dest,
|
||||
testAccountOwner,
|
||||
[],
|
||||
100,
|
||||
testTokenDecimals - 1,
|
||||
]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
await testToken.transferChecked(
|
||||
|
@ -387,13 +391,9 @@ export async function failOnApproveOverspend(): Promise<void> {
|
|||
assert(account1Info.delegatedAmount.toNumber() == 0);
|
||||
|
||||
assert(
|
||||
await didThrow(testToken, testToken.transfer, [
|
||||
account1,
|
||||
account2,
|
||||
delegate,
|
||||
[],
|
||||
1,
|
||||
]),
|
||||
await didThrow(async () => {
|
||||
await testToken.transfer(account1, account2, delegate, [], 1);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -407,13 +407,15 @@ export async function setAuthority(): Promise<void> {
|
|||
[],
|
||||
);
|
||||
assert(
|
||||
await didThrow(testToken, testToken.setAuthority, [
|
||||
await didThrow(async () => {
|
||||
await testToken.setAuthority(
|
||||
testAccount,
|
||||
newOwner.publicKey,
|
||||
'AccountOwner',
|
||||
testAccountOwner,
|
||||
[],
|
||||
]),
|
||||
);
|
||||
}),
|
||||
);
|
||||
await testToken.setAuthority(
|
||||
testAccount,
|
||||
|
@ -439,13 +441,9 @@ export async function burnChecked(): Promise<void> {
|
|||
const amount = accountInfo.amount.toNumber();
|
||||
|
||||
assert(
|
||||
await didThrow(testToken, testToken.burnChecked, [
|
||||
testAccount,
|
||||
testAccountOwner,
|
||||
[],
|
||||
1,
|
||||
1,
|
||||
]),
|
||||
await didThrow(async () => {
|
||||
await testToken.burnChecked(testAccount, testAccountOwner, [], 1, 1);
|
||||
}),
|
||||
);
|
||||
|
||||
await testToken.burnChecked(testAccount, testAccountOwner, [], 1, 2);
|
||||
|
@ -464,13 +462,9 @@ export async function freezeThawAccount(): Promise<void> {
|
|||
const dest = await testToken.createAccount(destOwner.publicKey);
|
||||
|
||||
assert(
|
||||
await didThrow(testToken, testToken.transfer, [
|
||||
testAccount,
|
||||
dest,
|
||||
testAccountOwner,
|
||||
[],
|
||||
100,
|
||||
]),
|
||||
await didThrow(async () => {
|
||||
await testToken.transfer(testAccount, dest, testAccountOwner, [], 100);
|
||||
}),
|
||||
);
|
||||
|
||||
await testToken.thawAccount(testAccount, testMintAuthority, []);
|
||||
|
@ -503,12 +497,9 @@ export async function closeAccount(): Promise<void> {
|
|||
|
||||
// Check that accounts with non-zero token balance cannot be closed
|
||||
assert(
|
||||
await didThrow(testToken, testToken.closeAccount, [
|
||||
testAccount,
|
||||
dest,
|
||||
closeAuthority,
|
||||
[],
|
||||
]),
|
||||
await didThrow(async () => {
|
||||
await testToken.closeAccount(testAccount, dest, closeAuthority, []);
|
||||
}),
|
||||
);
|
||||
|
||||
const connection = await getConnection();
|
||||
|
|
|
@ -10,9 +10,9 @@ edition = "2018"
|
|||
[dev-dependencies]
|
||||
rand = { version = "0.7.0"}
|
||||
spl-token = { path = "../program", features = [ "no-entrypoint" ] }
|
||||
solana-runtime = "1.6.11"
|
||||
solana-sdk = "1.6.11"
|
||||
solana-bpf-loader-program = "1.6.11"
|
||||
solana-runtime = "1.7.3"
|
||||
solana-sdk = "1.7.3"
|
||||
solana-bpf-loader-program = "1.7.3"
|
||||
solana_rbpf = "0.2"
|
||||
|
||||
[workspace]
|
||||
|
|
|
@ -16,11 +16,11 @@ arrayref = "0.3.6"
|
|||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
num_enum = "0.5.1"
|
||||
solana-program = "1.6.11"
|
||||
solana-program = "1.7.3"
|
||||
thiserror = "1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
solana-sdk = "1.6.11"
|
||||
solana-sdk = "1.7.3"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "lib"]
|
||||
|
|
|
@ -1927,9 +1927,9 @@ mod tests {
|
|||
// transfer
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1000,
|
||||
)
|
||||
|
@ -1953,10 +1953,10 @@ mod tests {
|
|||
// transfer checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1000,
|
||||
2,
|
||||
|
@ -1983,9 +1983,9 @@ mod tests {
|
|||
let mut owner_no_sign_info = owner_info.clone();
|
||||
let mut instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&owner_no_sign_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
owner_no_sign_info.key,
|
||||
&[],
|
||||
1000,
|
||||
)
|
||||
|
@ -2008,10 +2008,10 @@ mod tests {
|
|||
// missing signer checked
|
||||
let mut instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner_no_sign_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner_no_sign_info.key,
|
||||
&[],
|
||||
1000,
|
||||
2,
|
||||
|
@ -2035,9 +2035,9 @@ mod tests {
|
|||
// missing owner
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&owner2_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
owner2_info.key,
|
||||
&[],
|
||||
1000,
|
||||
)
|
||||
|
@ -2058,10 +2058,10 @@ mod tests {
|
|||
// missing owner checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner2_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner2_info.key,
|
||||
&[],
|
||||
1000,
|
||||
2,
|
||||
|
@ -2084,9 +2084,9 @@ mod tests {
|
|||
// insufficient funds
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1001,
|
||||
)
|
||||
|
@ -2107,10 +2107,10 @@ mod tests {
|
|||
// insufficient funds checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1001,
|
||||
2,
|
||||
|
@ -2133,10 +2133,10 @@ mod tests {
|
|||
// incorrect decimals
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1,
|
||||
10, // <-- incorrect decimals
|
||||
|
@ -2159,10 +2159,10 @@ mod tests {
|
|||
// incorrect mint
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account3_info.key, // <-- incorrect mint
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
account3_info.key, // <-- incorrect mint
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1,
|
||||
2,
|
||||
|
@ -2185,9 +2185,9 @@ mod tests {
|
|||
// approve delegate
|
||||
let instruction = approve(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&delegate_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
delegate_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
100,
|
||||
)
|
||||
|
@ -2206,9 +2206,9 @@ mod tests {
|
|||
// delegate transfer
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&delegate_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
delegate_info.key,
|
||||
&[],
|
||||
100,
|
||||
)
|
||||
|
@ -2233,10 +2233,10 @@ mod tests {
|
|||
// delegate transfer checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&delegate_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
delegate_info.key,
|
||||
&[],
|
||||
100,
|
||||
2,
|
||||
|
@ -2263,9 +2263,9 @@ mod tests {
|
|||
// delegate insufficient funds
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&delegate_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
delegate_info.key,
|
||||
&[],
|
||||
101,
|
||||
)
|
||||
|
@ -2286,10 +2286,10 @@ mod tests {
|
|||
// delegate insufficient funds checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&delegate_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
delegate_info.key,
|
||||
&[],
|
||||
101,
|
||||
2,
|
||||
|
@ -2312,9 +2312,9 @@ mod tests {
|
|||
// owner transfer with delegate assigned
|
||||
let instruction = transfer(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1000,
|
||||
)
|
||||
|
@ -2338,10 +2338,10 @@ mod tests {
|
|||
// owner transfer with delegate assigned checked
|
||||
let instruction = transfer_checked(
|
||||
&program_id,
|
||||
&account_info.key,
|
||||
&mint_info.key,
|
||||
&account_info.key,
|
||||
&owner_info.key,
|
||||
account_info.key,
|
||||
mint_info.key,
|
||||
account_info.key,
|
||||
owner_info.key,
|
||||
&[],
|
||||
1000,
|
||||
2,
|
||||
|
|
|
@ -11,6 +11,8 @@ fi
|
|||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
sed -i'' -e "s#solana_version=v.*#solana_version=v${solana_ver}#" ./ci/solana-version.sh
|
||||
|
||||
declare tomls=()
|
||||
while IFS='' read -r line; do tomls+=("$line"); done < <(find . -name Cargo.toml)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ edition = "2018"
|
|||
# Used to ensure that SPL programs are buildable by external clients
|
||||
|
||||
[dependencies]
|
||||
solana-sdk = "1.6.11"
|
||||
solana-sdk = "1.7.3"
|
||||
spl-memo = { path = "../../memo/program", features = [ "no-entrypoint" ] }
|
||||
spl-token = { path = "../../token/program", features = [ "no-entrypoint" ] }
|
||||
spl-token-swap = { path = "../../token-swap/program", features = [ "no-entrypoint" ] }
|
||||
|
|
Loading…
Reference in New Issue