Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies and removed unused deps #292

Merged
merged 2 commits into from Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions workspaces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ Library for automating workflows and testing NEAR smart contracts.
[dependencies]
async-trait = "0.1"
async-process = "1.3"
base64 = "0.13"
base64 = "0.21"
borsh = "0.10"
bs58 = "0.4"
cargo_metadata = { version = "0.15.4", optional = true }
bs58 = "0.5"
cargo_metadata = { version = "0.17", optional = true }
cargo-near = "0.3.1"
chrono = "0.4.19"
fs2 = "0.4"
hex = "0.4.2"
rand = "0.8.4"
reqwest = { version = "0.11", features = ["json"] }
serde = "1.0"
Expand Down
10 changes: 7 additions & 3 deletions workspaces/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use near_primitives::views::{
use crate::error::ErrorKind;
use crate::types::{Balance, CryptoHash, Gas};

use base64::{engine::general_purpose, Engine as _};

pub type Result<T, E = crate::error::Error> = core::result::Result<T, E>;

/// Execution related info as a result of performing a successful transaction
Expand Down Expand Up @@ -200,7 +202,7 @@ impl ExecutionFinalResult {
match self.status {
FinalExecutionStatus::SuccessValue(value) => Ok(ExecutionResult {
total_gas_burnt: self.total_gas_burnt,
value: Value::from_string(base64::encode(value)),
value: Value::from_string(general_purpose::STANDARD.encode(value)),
details: self.details,
}),
FinalExecutionStatus::Failure(tx_error) => Err(ExecutionResult {
Expand Down Expand Up @@ -435,7 +437,7 @@ impl ExecutionOutcome {
pub fn into_result(self) -> Result<ValueOrReceiptId> {
match self.status {
ExecutionStatusView::SuccessValue(value) => Ok(ValueOrReceiptId::Value(
Value::from_string(base64::encode(value)),
Value::from_string(general_purpose::STANDARD.encode(value)),
)),
ExecutionStatusView::SuccessReceiptId(hash) => {
Ok(ValueOrReceiptId::ReceiptId(CryptoHash(hash.0)))
Expand Down Expand Up @@ -496,7 +498,9 @@ impl Value {
/// [`json`]: Value::json
/// [`borsh`]: Value::borsh
pub fn raw_bytes(&self) -> Result<Vec<u8>> {
base64::decode(&self.repr).map_err(|e| ErrorKind::DataConversion.custom(e))
general_purpose::STANDARD
.decode(&self.repr)
.map_err(|e| ErrorKind::DataConversion.custom(e))
}
}

Expand Down
3 changes: 1 addition & 2 deletions workspaces/tests/test-contracts/type-serialize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ edition = "2018"
crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0"
bs58 = "0.4"
bs58 = "0.5"
near-sdk = "4.1"

[profile.release]
Expand Down
Loading