Skip to content

Commit

Permalink
Update dev-deps and fix/upgrade code usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
ckshitij committed Apr 15, 2024
1 parent 3288b7f commit 83532c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
5 changes: 3 additions & 2 deletions near-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ near-transactions = {path = "../near-transactions", version = "0.1.0-alpha"}
tokio = { version = "1", features = ["full"] }
serde_json = "1.0.85"
num-bigint = "0.4"
serde = "1.0.197"

[dev-dependencies]
tokio = { version = "1", features = ["full", "test-util"] }
env_logger = "0.10.0"
reqwest = { version = "0.11.12", features = ["json"], default-features = false }
env_logger = "0.11.3"
reqwest = { version = "0.12.3", features = ["json"], default-features = false }

10 changes: 4 additions & 6 deletions near-accounts/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use near_transactions::TransactionBuilder;
use num_bigint::BigInt;
use serde_json::Value;
use std::sync::Arc;
use serde::{Deserialize, Serialize};

/// Represents a NEAR account, encapsulating account ID, signer, and provider for blockchain interaction.
pub struct Account {
Expand All @@ -23,7 +24,7 @@ pub struct Account {
}

/// Represents the balance details of a NEAR account.
#[derive(Debug, PartialEq, Clone, Default)]
#[derive(Debug, PartialEq, Clone, Default, Serialize, Deserialize)]
pub struct AccountBalance {
pub total: String,
pub state_staked: String,
Expand Down Expand Up @@ -177,7 +178,7 @@ impl Account {
if let Some(m_names) = method_names {
function_call_access_key(allowance, cid, m_names)
} else {
return Err("No method_names argument provided for function call access keys. You should atleast provie an empty vector.".into());
return Err("No method_names argument provided for function call access keys. You should at-least provide an empty vector.".into());
}
}
None => full_access_key(),
Expand Down Expand Up @@ -408,10 +409,7 @@ pub async fn view_state(
contract_id: AccountId,
prefix: Option<String>,
) -> Result<near_primitives::views::ViewStateResult, Box<dyn std::error::Error>> {
let prefix_op = match prefix {
Some(pf) => pf,
None => String::from(""),
};
let prefix_op = prefix.unwrap_or("".to_string());
let query_request = QueryRequest::ViewState {
account_id: contract_id,
prefix: near_primitives::types::StoreKey::from(prefix_op.into_bytes()),
Expand Down
5 changes: 4 additions & 1 deletion near-api-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ near-crypto = "0.20.1"
near-primitives = "0.20.1"
tokio = { version = "1", features = ["full"] }
serde_json = "1.0.85"
env_logger = "0.10.0"

[dev-dependencies]
tokio = { version = "1", features = ["full", "test-util"] }
env_logger = "0.11.3"
4 changes: 2 additions & 2 deletions near-providers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ near-chain-configs = "0.20.0"

[dev-dependencies]
tokio = { version = "1", features = ["full", "test-util"] }
env_logger = "0.10.0"
reqwest = { version = "0.11.12", features = ["json"], default-features = false }
env_logger = "0.11.3"
reqwest = { version = "0.12.3", features = ["json"], default-features = false }

0 comments on commit 83532c8

Please sign in to comment.