This commit is contained in:
DieMyst 2021-01-25 15:33:40 +03:00
parent 802e294ba1
commit c9196bc11d

View File

@ -6,9 +6,9 @@ use core::convert::TryFrom;
use fluence_identity::public_key::PublicKey; use fluence_identity::public_key::PublicKey;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
use parking_lot::Mutex; use parking_lot::Mutex;
use sqlite; use fce_sqlite_connector;
use sqlite::Connection; use fce_sqlite_connector::Connection;
use sqlite::Value; use fce_sqlite_connector::Value;
use std::str::FromStr; use std::str::FromStr;
use std::time::Duration; use std::time::Duration;
use trust_graph::{Auth, PublicKeyHashable, Revoke, Storage, TrustGraph, TrustNode, Weight}; use trust_graph::{Auth, PublicKeyHashable, Revoke, Storage, TrustGraph, TrustNode, Weight};
@ -18,7 +18,7 @@ static INSTANCE: OnceCell<Mutex<TrustGraph>> = OnceCell::new();
pub fn get_data() -> &'static Mutex<TrustGraph> { pub fn get_data() -> &'static Mutex<TrustGraph> {
INSTANCE.get_or_init(|| { INSTANCE.get_or_init(|| {
let db_path = "/tmp/users.sqlite"; let db_path = "/tmp/users.sqlite";
let connection = sqlite::open(db_path).unwrap(); let connection = fce_sqlite_connector::open(db_path).unwrap();
let init_sql = "CREATE TABLE IF NOT EXISTS trustnodes( let init_sql = "CREATE TABLE IF NOT EXISTS trustnodes(
public_key TEXT PRIMARY KEY, public_key TEXT PRIMARY KEY,