Skip to content

Commit

Permalink
fix: error messages in withdrawal screen and wallet unlocking (#54)
Browse files Browse the repository at this point in the history
* fix: withdrawal screen messages

* wallet unlock for withdrawal screen

* fix

* restructure identity files

* renames withdrawals

* fix
  • Loading branch information
pauldelucia authored Nov 17, 2024
1 parent b0dcedd commit 22271c1
Show file tree
Hide file tree
Showing 15 changed files with 199 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::ui::network_chooser_screen::NetworkChooserScreen;
use crate::ui::tool_screens::proof_log_screen::ProofLogScreen;
use crate::ui::tool_screens::transition_visualizer_screen::TransitionVisualizerScreen;
use crate::ui::wallet::wallets_screen::WalletsBalancesScreen;
use crate::ui::withdraws_status_screen::WithdrawsStatusScreen;
use crate::ui::withdrawal_statuses_screen::WithdrawsStatusScreen;
use crate::ui::{MessageType, RootScreenType, Screen, ScreenLike, ScreenType};
use dash_sdk::dpp::dashcore::Network;
use derive_more::From;
Expand Down
4 changes: 2 additions & 2 deletions src/backend_task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::backend_task::contract::ContractTask;
use crate::backend_task::core::{CoreItem, CoreTask};
use crate::backend_task::document::DocumentTask;
use crate::backend_task::identity::IdentityTask;
use crate::backend_task::withdrawals::{WithdrawStatusPartialData, WithdrawalsTask};
use crate::backend_task::withdrawal_statuses::{WithdrawStatusPartialData, WithdrawalsTask};
use crate::context::AppContext;
use crate::model::qualified_identity::QualifiedIdentity;
use dash_sdk::dpp::voting::votes::Vote;
Expand All @@ -18,7 +18,7 @@ pub mod contract;
pub mod core;
mod document;
pub mod identity;
pub mod withdrawals;
pub mod withdrawal_statuses;

#[derive(Debug, Clone, PartialEq)]
pub(crate) enum BackendTask {
Expand Down
File renamed without changes.
14 changes: 0 additions & 14 deletions src/ui/identities/add_new_identity_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ use crate::backend_task::identity::{
};
use crate::backend_task::{BackendTask, BackendTaskSuccessResult};
use crate::context::AppContext;
use crate::model::qualified_identity::QualifiedIdentity;
use crate::model::wallet::Wallet;
use crate::ui::components::top_panel::add_top_panel;
use crate::ui::components::wallet_unlock::ScreenWithWalletUnlock;
use crate::ui::{MessageType, ScreenLike};
use arboard::Clipboard;
use dash_sdk::dashcore_rpc::dashcore::address::Error;
use dash_sdk::dashcore_rpc::dashcore::transaction::special_transaction::TransactionPayload;
use dash_sdk::dashcore_rpc::dashcore::Address;
use dash_sdk::dashcore_rpc::RpcApi;
use dash_sdk::dpp::balances::credits::Duffs;
use dash_sdk::dpp::dashcore::{OutPoint, PrivateKey, Transaction, TxOut};
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
Expand All @@ -30,22 +27,11 @@ use eframe::egui::Context;
use egui::ahash::HashSet;
use egui::{Color32, ColorImage, ComboBox, ScrollArea, Ui};
use image::Luma;
use itertools::Itertools;
use qrcode::QrCode;
use serde::Deserialize;
use std::cmp::PartialEq;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, RwLock};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::{fmt, thread};
use zeroize::Zeroize;

#[derive(Debug, Clone, Deserialize)]
struct KeyInfo {
address: String,
#[serde(rename = "private_key")]
private_key: String,
}

#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum FundingMethod {
Expand Down
7 changes: 4 additions & 3 deletions src/ui/identities/identities_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ use crate::model::qualified_identity::PrivateKeyTarget::{
};
use crate::model::qualified_identity::{IdentityType, QualifiedIdentity};
use crate::model::wallet::WalletSeedHash;
use crate::ui::add_key_screen::AddKeyScreen;
use crate::ui::components::left_panel::add_left_panel;
use crate::ui::components::top_panel::add_top_panel;
use crate::ui::key_info_screen::KeyInfoScreen;
use crate::ui::identities::keys::add_key_screen::AddKeyScreen;
use crate::ui::identities::keys::key_info_screen::KeyInfoScreen;
use crate::ui::transfers::TransferScreen;
use crate::ui::withdrawals::WithdrawalScreen;
use crate::ui::{RootScreenType, Screen, ScreenLike, ScreenType};
use dash_sdk::dpp::identity::accessors::IdentityGettersV0;
use dash_sdk::dpp::identity::identity_public_key::accessors::v0::IdentityPublicKeyGettersV0;
Expand All @@ -32,6 +31,8 @@ use std::collections::HashMap;
use std::sync::atomic::Ordering;
use std::sync::{Arc, Mutex};

use super::withdraw_from_identity_screen::WithdrawalScreen;

pub struct IdentitiesScreen {
pub identities: Arc<Mutex<IndexMap<Identifier, QualifiedIdentity>>>,
pub app_context: Arc<AppContext>,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions src/ui/identities/keys/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod add_key_screen;
pub mod key_info_screen;
pub mod keys_screen;
2 changes: 2 additions & 0 deletions src/ui/identities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub mod add_existing_identity_screen;
pub mod add_new_identity_screen;
pub mod identities_screen;
pub mod keys;
pub mod register_dpns_name_screen;
pub mod withdraw_from_identity_screen;
8 changes: 2 additions & 6 deletions src/ui/identities/register_dpns_name_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,11 @@ impl ScreenLike for RegisterDpnsNameScreen {
return;
}

let mut step = 1;

// Select the identity to register the name for
ui.heading("1. Select Identity");
ui.add_space(5.0);
self.render_identity_id_selection(ui);

step += 1;

ui.add_space(10.0);
ui.separator();
ui.add_space(10.0);
Expand All @@ -278,7 +274,7 @@ impl ScreenLike for RegisterDpnsNameScreen {
}

// Input for the name
ui.heading(format!("{}. Enter the Name to Register:", step));
ui.heading("2. Enter the Name to Register:");
ui.add_space(5.0);
ui.horizontal(|ui| {
ui.label("Name (without \".dash\"):");
Expand All @@ -296,7 +292,7 @@ impl ScreenLike for RegisterDpnsNameScreen {
);
ui.colored_label(
egui::Color32::DARK_RED,
"Cost ≈ 0.2 Dash",
"Cost ≈ 0.2006 Dash",
);
} else {
ui.colored_label(
Expand Down
Loading

0 comments on commit 22271c1

Please sign in to comment.