mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-02-23 08:09:53 -05:00
Replace chrono with time lib
This commit is contained in:
parent
394adb0a4f
commit
f91d8ab45c
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -4117,7 +4117,6 @@ dependencies = [
|
|||||||
"bitcoin",
|
"bitcoin",
|
||||||
"bitcoin-harness",
|
"bitcoin-harness",
|
||||||
"bmrng",
|
"bmrng",
|
||||||
"chrono",
|
|
||||||
"comfy-table",
|
"comfy-table",
|
||||||
"config",
|
"config",
|
||||||
"conquer-once",
|
"conquer-once",
|
||||||
|
@ -19,7 +19,6 @@ bdk = "0.10"
|
|||||||
big-bytes = "1"
|
big-bytes = "1"
|
||||||
bitcoin = { version = "0.26", features = [ "rand", "use-serde" ] }
|
bitcoin = { version = "0.26", features = [ "rand", "use-serde" ] }
|
||||||
bmrng = "0.5"
|
bmrng = "0.5"
|
||||||
chrono = "0.4"
|
|
||||||
comfy-table = "4.1.1"
|
comfy-table = "4.1.1"
|
||||||
config = { version = "0.11", default-features = false, features = [ "toml" ] }
|
config = { version = "0.11", default-features = false, features = [ "toml" ] }
|
||||||
conquer-once = "0.3"
|
conquer-once = "0.3"
|
||||||
|
@ -3,12 +3,12 @@ use crate::monero::Address;
|
|||||||
use crate::protocol::{Database, State};
|
use crate::protocol::{Database, State};
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use chrono::Utc;
|
|
||||||
use libp2p::{Multiaddr, PeerId};
|
use libp2p::{Multiaddr, PeerId};
|
||||||
use sqlx::sqlite::Sqlite;
|
use sqlx::sqlite::Sqlite;
|
||||||
use sqlx::{Pool, SqlitePool};
|
use sqlx::{Pool, SqlitePool};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use time::OffsetDateTime;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
pub struct SqliteDatabase {
|
pub struct SqliteDatabase {
|
||||||
@ -171,7 +171,7 @@ impl Database for SqliteDatabase {
|
|||||||
|
|
||||||
async fn insert_latest_state(&self, swap_id: Uuid, state: State) -> Result<()> {
|
async fn insert_latest_state(&self, swap_id: Uuid, state: State) -> Result<()> {
|
||||||
let mut conn = self.pool.acquire().await?;
|
let mut conn = self.pool.acquire().await?;
|
||||||
let entered_at = Utc::now();
|
let entered_at = OffsetDateTime::now_utc();
|
||||||
|
|
||||||
let swap_id = swap_id.to_string();
|
let swap_id = swap_id.to_string();
|
||||||
let swap = serde_json::to_string(&Swap::from(state))?;
|
let swap = serde_json::to_string(&Swap::from(state))?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user