Implemented and added usage of eventbus. Added a lot of UI interaction. Added a lot of DB work.

This commit is contained in:
Revertron
2021-01-30 14:18:37 +01:00
parent 9e6a01847e
commit 562c004b0d
13 changed files with 385 additions and 71 deletions
+4 -2
View File
@@ -1,4 +1,5 @@
use crate::{Keystore, Blockchain};
use crate::{Keystore, Blockchain, Bus};
use crate::event::Event;
use std::collections::HashMap;
use serde::{Serialize, Deserialize, Serializer, Deserializer};
use serde::de::Error;
@@ -9,12 +10,13 @@ pub struct Context {
pub(crate) settings: Settings,
pub(crate) keystore: Keystore,
pub(crate) blockchain: Blockchain,
pub bus: Bus<Event>,
}
impl Context {
/// Creating an essential context to work with
pub fn new(settings: Settings, keystore: Keystore, blockchain: Blockchain) -> Context {
Context { settings, keystore, blockchain }
Context { settings, keystore, blockchain, bus: Bus::new() }
}
/// Load keystore and return Context