Skip to content

Commit a191b63

Browse files
authored
chore!: updates near-* dependencies to 0.29 release (#455)
1 parent 93085b1 commit a191b63

File tree

5 files changed

+114
-59
lines changed

5 files changed

+114
-59
lines changed

Cargo.lock

Lines changed: 61 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ bytesize = "1.1.0"
7575
prettytable = "0.10.0"
7676
textwrap = "0.16.1"
7777

78-
near-crypto = "0.28"
79-
near-primitives = "0.28"
80-
near-jsonrpc-client = "0.15"
81-
near-jsonrpc-primitives = "0.28"
82-
near-socialdb-client = "0.9"
78+
near-crypto = "0.29"
79+
near-primitives = "0.29"
80+
near-jsonrpc-client = "0.16"
81+
near-jsonrpc-primitives = "0.29"
82+
near-socialdb-client = "0.10"
8383

8484
near-ledger = { version = "0.8.0", optional = true }
8585

src/commands/transaction/reconstruct_transaction/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ fn action_transformation(
240240
Action::Delegate(_) => {
241241
panic!("Internal error: Delegate action should have been handled before calling action_transformation.");
242242
}
243+
Action::DeployGlobalContract(_) => {
244+
unimplemented!("The DeployGlobalContract action is not implemented yet. The issue is tracked at https://github.com/near/near-cli-rs/issues/458");
245+
}
246+
Action::UseGlobalContract(_) => {
247+
unimplemented!("The UseGlobalContract action is not implemented yet. The issue is tracked at https://github.com/near/near-cli-rs/issues/458");
248+
}
243249
}
244250
}
245251

src/common.rs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::str::FromStr;
77
use color_eyre::eyre::{ContextCompat, WrapErr};
88
use color_eyre::owo_colors::OwoColorize;
99
use futures::{StreamExt, TryStreamExt};
10+
use near_primitives::action::{GlobalContractDeployMode, GlobalContractIdentifier};
1011
use prettytable::Table;
1112
use rust_decimal::prelude::FromPrimitive;
1213
use tracing_indicatif::span_ext::IndicatifSpanExt;
@@ -657,7 +658,10 @@ pub fn print_unsigned_transaction(transaction: &crate::commands::PrepopulatedTra
657658
eprintln!(
658659
"{:>5} {:<70}",
659660
"--",
660-
format!("deploy contract {:?}", code_hash)
661+
format!(
662+
"deploy code <{:?}> to a account <{}>",
663+
code_hash, transaction.receiver_id
664+
)
661665
)
662666
}
663667
near_primitives::transaction::Action::FunctionCall(function_call_action) => {
@@ -764,6 +768,32 @@ pub fn print_unsigned_transaction(transaction: &crate::commands::PrepopulatedTra
764768
};
765769
print_unsigned_transaction(&prepopulated_transaction);
766770
}
771+
near_primitives::transaction::Action::DeployGlobalContract(deploy) => {
772+
let code_hash = CryptoHash::hash_bytes(&deploy.code);
773+
let identifier = match deploy.deploy_mode {
774+
GlobalContractDeployMode::CodeHash => {
775+
format!("deploy code <{:?}> as a global hash", code_hash)
776+
}
777+
GlobalContractDeployMode::AccountId => {
778+
format!(
779+
"deploy code <{:?}> to a global account <{}>",
780+
code_hash, transaction.receiver_id
781+
)
782+
}
783+
};
784+
eprintln!("{:>5} {:<70}", "--", identifier)
785+
}
786+
near_primitives::transaction::Action::UseGlobalContract(contract_identifier) => {
787+
let identifier = match contract_identifier.contract_identifier {
788+
GlobalContractIdentifier::CodeHash(hash) => {
789+
format!("use global <{}> code to deploy from", hash)
790+
}
791+
GlobalContractIdentifier::AccountId(ref account_id) => {
792+
format!("use global <{}> code to deploy from", account_id)
793+
}
794+
};
795+
eprintln!("{:>5} {:<70}", "--", identifier)
796+
}
767797
}
768798
}
769799
}
@@ -850,6 +880,16 @@ fn print_value_successful_transaction(
850880
delegate_action.sender_id,
851881
);
852882
}
883+
near_primitives::views::ActionView::DeployGlobalContract { code: _ }
884+
| near_primitives::views::ActionView::DeployGlobalContractByAccountId { code: _ } => {
885+
eprintln!("Global contract has been successfully deployed.",);
886+
}
887+
near_primitives::views::ActionView::UseGlobalContractByAccountId { account_id } => {
888+
eprintln!("Contract has been successfully deployed with the code from the global account <{}>.", account_id);
889+
}
890+
near_primitives::views::ActionView::UseGlobalContract { code_hash } => {
891+
eprintln!("Contract has been successfully deployed with the code from the global hash <{}>.", code_hash);
892+
}
853893
}
854894
}
855895
}

0 commit comments

Comments
 (0)