Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update checks
Browse files Browse the repository at this point in the history
gterzian committed Oct 21, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b1c3c81 commit 05b1d25
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions massa-client/src/cmds.rs
Original file line number Diff line number Diff line change
@@ -831,27 +831,19 @@ impl Command {
let path = parameters[1].parse::<PathBuf>()?;
let max_gas = parameters[2].parse::<u64>()?;
let fee = parameters[3].parse::<Amount>()?;

if !json {
match Some(fee) {
Some(total) => {
if let Ok(addresses_info) =
client.public.get_addresses(vec![addr]).await
{
match addresses_info.get(0) {
Some(info) => {
if info.candidate_balance < total {
client_warning!("this operation may be rejected due to insufficient balance");
}
}
None => {
client_warning!(format!("address {} not found", addr));
}
if let Ok(addresses_info) =
client.public.get_addresses(vec![addr]).await
{
match addresses_info.get(0) {
Some(info) => {
if info.candidate_balance < fee {
client_warning!("this operation may be rejected due to insufficient balance");
}
}
}
None => {
client_warning!("the total amount hit the limit overflow, operation will certainly be rejected");
None => {
client_warning!(format!("address {} not found", addr));
}
}
}
};
@@ -893,7 +885,7 @@ impl Command {
let coins = parameters[5].parse::<Amount>()?;
let fee = parameters[6].parse::<Amount>()?;
if !json {
match Some(fee) {
match coins.checked_add(fee) {
Some(total) => {
if let Ok(addresses_info) =
client.public.get_addresses(vec![target_addr]).await

0 comments on commit 05b1d25

Please sign in to comment.