@@ -1,3 +1,5 @@
+use std::sync::Arc;
+
use actix_web::{
error::InternalError, get, middleware::Logger, post, web, App, HttpResponse, HttpServer,
Responder,
@@ -248,7 +250,7 @@ async fn update_status(
}
pub struct Ledger {
- _inner: verax::Ledger<verax::storage::Cache<verax::storage::SQLite>>,
+ _inner: Arc<verax::Ledger<verax::storage::Cache<verax::storage::SQLite>>>,
#[actix_web::main]
@@ -301,7 +301,7 @@ impl SQLite {
"to" VARCHAR(64) NOT NULL,
"status" INT NOT NULL,
"asset" VARCHAR(10) NOT NULL,
- "cents" STRING NOT NULL,
+ "cents" BIGINT NOT NULL,
"is_negative" INT DEFAULT '0',
"spent_by" VARCHAR(64) DEFAULT NULL,
"created_at" DATETIME DEFAULT CURRENT_TIMESTAMP,
@@ -320,8 +320,7 @@ impl SQLite {
CREATE INDEX IF NOT EXISTS "sorted_account_transaction" ON "transaction_accounts" ("account_id", "id" desc);
"#,
)
- .await
- .expect("valid");
+ .await?;
x.commit().await?;
Ok(())