From da9ce45154f72b379413e668fad6f6080456d497 Mon Sep 17 00:00:00 2001 From: akorchyn Date: Thu, 12 Sep 2024 14:43:41 +0300 Subject: [PATCH] chore: updates near-* to 0.26 --- Cargo.lock | 229 +++++++++++-------------------------------- Cargo.toml | 15 ++- src/storage.rs | 2 +- src/types/mod.rs | 1 + src/types/storage.rs | 8 ++ 5 files changed, 75 insertions(+), 180 deletions(-) create mode 100644 src/types/storage.rs diff --git a/Cargo.lock b/Cargo.lock index 172a20b..6555c11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,19 +14,13 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ - "gimli 0.28.1", + "gimli 0.31.0", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -70,9 +64,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f00e1f6e58a40e807377c75c6a7f97bf9044fab57816f2414e6f5f4499d7b8" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "arbitrary" @@ -120,17 +114,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -445,33 +439,6 @@ dependencies = [ "inout", ] -[[package]] -name = "color-eyre" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - [[package]] name = "colored" version = "2.1.0" @@ -900,7 +867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1080,9 +1047,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "goblin" @@ -1635,15 +1602,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -1703,7 +1661,6 @@ dependencies = [ "near-ledger", "near-primitives", "near-sdk", - "near-socialdb-client", "near-token", "near-workspaces", "openssl", @@ -1781,9 +1738,9 @@ dependencies = [ [[package]] name = "near-chain-configs" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaf11eb7af2624547867ee6daad28568e57404ec01a526d0e36b089f6ae3617" +checksum = "0784e55d9dee91ca830c6199d15ad18fc628f930a5d0946bb0949956026dd64f" dependencies = [ "anyhow", "bytesize", @@ -1806,9 +1763,9 @@ dependencies = [ [[package]] name = "near-config-utils" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8f85d03abe7dbb0778a56ba0f03a74ce2c8bbd3151e75256c9fba03d6a0f8b" +checksum = "d96c1682d13e9a8a62ea696395bf17afc4ed4b60535223251168217098c27a50" dependencies = [ "anyhow", "json_comments", @@ -1818,18 +1775,18 @@ dependencies = [ [[package]] name = "near-contract-standards" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930f4d6c4b2933431acc4a7de0771e1d0de2fa30abe100e09c6fa46531683b4a" +checksum = "a3b985c4df43237b6ae533a6451cfa13de1f12f79f7d6254ba376f0ccd017286" dependencies = [ "near-sdk", ] [[package]] name = "near-crypto" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee0fc88667a502f7a0b58765a14e7f31e99c4b95006e8d7fb1259a0d6cbbd82" +checksum = "907fdcefa3a42976cd6a8bf626fe2a87eb0d3b3ff144adc67cf32d53c9494b32" dependencies = [ "blake2", "borsh", @@ -1853,9 +1810,9 @@ dependencies = [ [[package]] name = "near-fmt" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06dca548e1323551b6ff4203725ac0cf1566fa6de8e93b8eba5baceb3fbdc06b" +checksum = "7a36518bfcf2177096d4298d9158ba698ffd6944cb035ecc0938b098337b933c" dependencies = [ "near-primitives-core", ] @@ -1873,9 +1830,9 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66a17771cabf1ecc162c1d6770e5fd2a6b50d74171cb0755306bf06e553ba3d" +checksum = "161fdc8f73fd9e19a97e05acb10e985ba89bd06e88543cdfd0c8dad0dac266c5" dependencies = [ "borsh", "lazy_static", @@ -1892,9 +1849,9 @@ dependencies = [ [[package]] name = "near-jsonrpc-primitives" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5478af3f1ef47ff3d2a5c58c1fab1e334ff0d2074db1744bcf4d5afef8d3470" +checksum = "2b24bfd0fedef42e07daa79e463a7908e9abee4f6de3532e0e1dde45f6951657" dependencies = [ "arbitrary", "near-chain-configs", @@ -1925,9 +1882,9 @@ dependencies = [ [[package]] name = "near-parameters" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fe415e1632a3fd6fe5d221e8ed16f92d0d1cc9a5716e6f9ff25844b242bad1b" +checksum = "e41afea5c5e84763586bafc5f5e1b63d90ef4e5454e18406cab8df120178db8d" dependencies = [ "borsh", "enum-map", @@ -1943,9 +1900,9 @@ dependencies = [ [[package]] name = "near-primitives" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4ec81b11520c89c04ff13b79a73d62bd407a8a6a9002502e557cfbc53c3961" +checksum = "165c2dc0fc20d839cfd7948d930ef5e8a4ed2b095abe83e0076ef5d4a5df58ed" dependencies = [ "arbitrary", "base64 0.21.7", @@ -1986,9 +1943,9 @@ dependencies = [ [[package]] name = "near-primitives-core" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f6e4b981eb5f1a08c85ec4d4de4672da584cdb9aadff26609a7eb59db707dc" +checksum = "51fd53f992168589c52022dd220c84a7f2ede92251631a06a3817e4b22af5836" dependencies = [ "arbitrary", "base64 0.21.7", @@ -2007,9 +1964,9 @@ dependencies = [ [[package]] name = "near-rpc-error-core" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72469e7c06bf99bb7e9d5a66438c008d3b85c8c5d8f36d8c31b35968f6f599d4" +checksum = "df598b0785a3e36d7e4fb73afcdf20536988b13d07cead71dfa777db4783e552" dependencies = [ "quote", "serde", @@ -2018,9 +1975,9 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0bd52b705619ceb5d5ea9171ecf44f00513101c903928474eca957d07f3fdb" +checksum = "647ef261df99ad877c08c97af2f10368c8b8cde0968250d3482a5a249e9f3926" dependencies = [ "near-rpc-error-core", "serde", @@ -2042,9 +1999,9 @@ dependencies = [ [[package]] name = "near-sdk" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3d8d80b1e3f6b1403a18704c5a2fc60176943e32ed9896d238805cd4c65390" +checksum = "4e296b02c85539c16659e171242d6c6bbea87eec7c9ef860d8dfd3fb3168a18a" dependencies = [ "base64 0.22.1", "borsh", @@ -2062,9 +2019,9 @@ dependencies = [ [[package]] name = "near-sdk-macros" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e359ccd96ddcc1dad8402ee80c5f4900b8fa5895b4f0bf84c182066a0aa6ed3f" +checksum = "0adc79466aa556f56a995c0db34a933b32597ab92bbb0e526597118899c8bcaf" dependencies = [ "Inflector", "darling", @@ -2077,40 +2034,23 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "near-socialdb-client" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07dc160fd9b641b07a512c9ce8515cbd616b6e5f171c2080abe5907e7e527e8" -dependencies = [ - "color-eyre", - "near-crypto", - "near-jsonrpc-client", - "near-jsonrpc-primitives", - "near-primitives", - "near-token", - "serde", - "serde_json", - "url", -] - [[package]] name = "near-stdx" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999173ea1e88ca421ff10969273cc1ad42b291af3f5a25827be1ad080e24dd89" +checksum = "6d5c43f6181873287ddaa25edcc2943d0f2d5da9588231516f2ed0549db1fbac" [[package]] name = "near-structs-checker-core" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9486fba198ad9369042fceacd05a6590c2e9f4d03101898e8c27738d0a50e3" +checksum = "7e53379bee876286de4ad31dc7f9fde8db12527c39d401d94f4d42cd021b8fce" [[package]] name = "near-structs-checker-lib" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a89246f95d81d1a80e443b0f367c55e3e8e4177a9ddee5385906d10b57e534" +checksum = "8f984805f225c9b19681a124af7783078459e87ea63dde751b62e7cb404b1d6a" dependencies = [ "near-structs-checker-core", "near-structs-checker-macro", @@ -2118,9 +2058,9 @@ dependencies = [ [[package]] name = "near-structs-checker-macro" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084c673f50291300dc6c2d31b0e075289076fe18c3f0b62dc5202102f2bc463a" +checksum = "66319954983ae164fd0b714ae9d8b09edc26c74d9b3a1f51e564bb14720adb8e" [[package]] name = "near-sys" @@ -2130,9 +2070,9 @@ checksum = "dbf4ca5c805cb78700e10e43484902d8da05f25788db277999d209568aaf4c8e" [[package]] name = "near-time" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b49356eacf06348b96063567f218732f56bc51968035ee38b8e656b4492cb4" +checksum = "f1d37b864f04d9aebbc3b88ac63ba989d94f221de694bcc8af639cc284a89f64" dependencies = [ "once_cell", "serde", @@ -2152,9 +2092,9 @@ dependencies = [ [[package]] name = "near-workspaces" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5640094eac57d5b0c4303c7a64b1e43925ee7e836882ce48a3a8e0deff0a3712" +checksum = "f59e15efadb1d2e4c21d4d1a8d5a8f8a732eb8f16cfb54a1a56628ab5bf5a125" dependencies = [ "async-trait", "base64 0.22.1", @@ -2353,9 +2293,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -2438,12 +2378,6 @@ dependencies = [ "serde", ] -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - [[package]] name = "parking_lot" version = "0.12.3" @@ -2691,9 +2625,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -2814,9 +2748,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -3149,15 +3083,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "shlex" version = "1.3.0" @@ -3494,16 +3419,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", -] - [[package]] name = "time" version = "0.3.36" @@ -3697,28 +3612,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", ] [[package]] @@ -3822,12 +3715,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index f6fbca7..9044d2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,17 +32,16 @@ thiserror = "1" near-ledger = { version = "0.8.1", optional = true } -near-crypto = "0.25.0" -near-primitives = "0.25" -near-jsonrpc-client = "0.12" -near-jsonrpc-primitives = "0.25" -near-contract-standards = "5.4" -near-sdk = "5.4" +near-crypto = "0.26.0" +near-primitives = "0.26" +near-jsonrpc-client = "0.13" +near-jsonrpc-primitives = "0.26" +near-contract-standards = "5.5" +near-sdk = "5.5" near-account-id = "1.0.0" near-gas = { version = "0.3", features = ["serde", "borsh"] } near-token = { version = "0.3", features = ["serde", "borsh"] } -near-socialdb-client = "0.6" near-abi = "0.4.2" zstd = "0.13" @@ -54,7 +53,7 @@ keyring = { version = "3.2", features = [ "vendored", ] } -near-workspaces = { version = "0.13.0", optional = true } +near-workspaces = { version = "0.14.0", optional = true } [features] diff --git a/src/storage.rs b/src/storage.rs index 0ecf3a6..f6a3d88 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,5 +1,4 @@ use near_primitives::types::AccountId; -use near_socialdb_client::StorageBalance; use near_token::NearToken; use serde_json::json; @@ -8,6 +7,7 @@ use crate::{ contract::{Contract, ContractTransactBuilder}, errors::BuilderError, transactions::ConstructTransaction, + types::storage::StorageBalance, }; #[derive(Clone, Debug)] diff --git a/src/types/mod.rs b/src/types/mod.rs index 94a57ed..384de23 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -3,6 +3,7 @@ use reqwest::header::InvalidHeaderValue; pub mod contract; pub mod stake; +pub mod storage; pub mod tokens; pub mod transactions; diff --git a/src/types/storage.rs b/src/types/storage.rs new file mode 100644 index 0000000..ede4c1a --- /dev/null +++ b/src/types/storage.rs @@ -0,0 +1,8 @@ +// Taken from https://github.com/bos-cli-rs/near-socialdb-client-rs/blob/main/src/lib.rs +#[derive(Debug, Clone, serde::Deserialize)] +pub struct StorageBalance { + #[serde(deserialize_with = "parse_u128_string")] + pub available: u128, + #[serde(deserialize_with = "parse_u128_string")] + pub total: u128, +}