|
@@ -1,7 +1,7 @@
|
|
//! Storage layer trait
|
|
//! Storage layer trait
|
|
use crate::{
|
|
use crate::{
|
|
- amount::AmountCents, payment::PaymentTo, transaction::Type, AccountId, Amount, Asset,
|
|
|
|
- PaymentFrom, PaymentId, Transaction, TxId,
|
|
|
|
|
|
+ amount::AmountCents, payment::PaymentTo, transaction::Type, AccountId, Amount, Asset, BaseTx,
|
|
|
|
+ PaymentFrom, PaymentId, RevId, Revision, Transaction, TxId,
|
|
};
|
|
};
|
|
//use chrono::{DateTime, Utc};
|
|
//use chrono::{DateTime, Utc};
|
|
use serde::Serialize;
|
|
use serde::Serialize;
|
|
@@ -15,7 +15,7 @@ pub use self::sqlite::SQLite;
|
|
|
|
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize)]
|
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize)]
|
|
/// Storage Payment Status
|
|
/// Storage Payment Status
|
|
-pub enum Status {
|
|
|
|
|
|
+pub enum ReceivedPaymentStatus {
|
|
/// The payment is available to be spent
|
|
/// The payment is available to be spent
|
|
Spendable,
|
|
Spendable,
|
|
/// The payment is not spentable and will not be part of the balance
|
|
/// The payment is not spentable and will not be part of the balance
|
|
@@ -26,26 +26,43 @@ pub enum Status {
|
|
Spent,
|
|
Spent,
|
|
}
|
|
}
|
|
|
|
|
|
-impl From<Status> for u32 {
|
|
|
|
- fn from(val: Status) -> Self {
|
|
|
|
|
|
+/// Serializes an object to bytes using the default serialization method
|
|
|
|
+pub fn to_bytes<T>(val: &T) -> Result<Vec<u8>, Error>
|
|
|
|
+where
|
|
|
|
+ T: serde::Serialize + borsh::BorshSerialize,
|
|
|
|
+{
|
|
|
|
+ borsh::to_vec(val).map_err(|e| Error::Encoding(e.to_string()))
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/// Deserializes an object from bytes using the default deserialization method
|
|
|
|
+pub fn from_bytes<T>(val: &[u8]) -> Result<T, Error>
|
|
|
|
+where
|
|
|
|
+ T: serde::de::DeserializeOwned + borsh::BorshDeserialize,
|
|
|
|
+{
|
|
|
|
+ borsh::BorshDeserialize::deserialize(&mut val.as_ref())
|
|
|
|
+ .map_err(|e| Error::Encoding(e.to_string()))
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+impl From<ReceivedPaymentStatus> for u32 {
|
|
|
|
+ fn from(val: ReceivedPaymentStatus) -> Self {
|
|
match val {
|
|
match val {
|
|
- Status::Spendable => 0,
|
|
|
|
- Status::Locked => 20,
|
|
|
|
- Status::Spent => 30,
|
|
|
|
- Status::Failed => 40,
|
|
|
|
|
|
+ ReceivedPaymentStatus::Spendable => 0,
|
|
|
|
+ ReceivedPaymentStatus::Locked => 20,
|
|
|
|
+ ReceivedPaymentStatus::Spent => 30,
|
|
|
|
+ ReceivedPaymentStatus::Failed => 40,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-impl TryFrom<u32> for Status {
|
|
|
|
|
|
+impl TryFrom<u32> for ReceivedPaymentStatus {
|
|
type Error = Error;
|
|
type Error = Error;
|
|
|
|
|
|
fn try_from(value: u32) -> Result<Self, Self::Error> {
|
|
fn try_from(value: u32) -> Result<Self, Self::Error> {
|
|
match value {
|
|
match value {
|
|
- 0 => Ok(Status::Spendable),
|
|
|
|
- 20 => Ok(Status::Locked),
|
|
|
|
- 30 => Ok(Status::Spent),
|
|
|
|
- 40 => Ok(Status::Failed),
|
|
|
|
|
|
+ 0 => Ok(ReceivedPaymentStatus::Spendable),
|
|
|
|
+ 20 => Ok(ReceivedPaymentStatus::Locked),
|
|
|
|
+ 30 => Ok(ReceivedPaymentStatus::Spent),
|
|
|
|
+ 40 => Ok(ReceivedPaymentStatus::Failed),
|
|
_ => Err(Error::Storage(format!("Invalid status: {}", value))),
|
|
_ => Err(Error::Storage(format!("Invalid status: {}", value))),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -108,20 +125,12 @@ pub trait Batch<'a> {
|
|
/// The batch is commited into the storage layer and it is consumed.
|
|
/// The batch is commited into the storage layer and it is consumed.
|
|
async fn commit(self) -> Result<(), Error>;
|
|
async fn commit(self) -> Result<(), Error>;
|
|
|
|
|
|
- /// Returns a transaction from the batch's point of view, giving the ability to lock the
|
|
|
|
- /// resource to update it. The lock should be released when the transaction is dropped or
|
|
|
|
- /// committed.
|
|
|
|
- async fn get_and_lock_transaction(
|
|
|
|
- &mut self,
|
|
|
|
- transaction_id: &TxId,
|
|
|
|
- ) -> Result<Transaction, Error>;
|
|
|
|
-
|
|
|
|
/// Flag the given payments as spent by the given transaction.
|
|
/// Flag the given payments as spent by the given transaction.
|
|
async fn spend_payments(
|
|
async fn spend_payments(
|
|
&mut self,
|
|
&mut self,
|
|
transaction_id: &TxId,
|
|
transaction_id: &TxId,
|
|
spends: Vec<PaymentId>,
|
|
spends: Vec<PaymentId>,
|
|
- status: Status,
|
|
|
|
|
|
+ status: ReceivedPaymentStatus,
|
|
) -> Result<(), Error>;
|
|
) -> Result<(), Error>;
|
|
|
|
|
|
/// Create a new list of payments
|
|
/// Create a new list of payments
|
|
@@ -129,7 +138,7 @@ pub trait Batch<'a> {
|
|
&mut self,
|
|
&mut self,
|
|
transaction_id: &TxId,
|
|
transaction_id: &TxId,
|
|
recipients: &[PaymentTo],
|
|
recipients: &[PaymentTo],
|
|
- status: Status,
|
|
|
|
|
|
+ status: ReceivedPaymentStatus,
|
|
) -> Result<(), Error>;
|
|
) -> Result<(), Error>;
|
|
|
|
|
|
/// Updates all payments related to a transaction
|
|
/// Updates all payments related to a transaction
|
|
@@ -142,21 +151,43 @@ pub trait Batch<'a> {
|
|
async fn update_transaction_payments(
|
|
async fn update_transaction_payments(
|
|
&mut self,
|
|
&mut self,
|
|
transaction_id: &TxId,
|
|
transaction_id: &TxId,
|
|
- create_status: Status,
|
|
|
|
- spend_status: Status,
|
|
|
|
|
|
+ create_status: ReceivedPaymentStatus,
|
|
|
|
+ spend_status: ReceivedPaymentStatus,
|
|
) -> Result<(usize, usize), Error>;
|
|
) -> Result<(usize, usize), Error>;
|
|
|
|
|
|
/// Returns the stats of a payment from the point of view of the on-going transaction
|
|
/// Returns the stats of a payment from the point of view of the on-going transaction
|
|
- async fn get_payment_status(&mut self, transaction_id: &TxId) -> Result<Option<Status>, Error>;
|
|
|
|
|
|
+ async fn get_payment_status(
|
|
|
|
+ &mut self,
|
|
|
|
+ transaction_id: &TxId,
|
|
|
|
+ ) -> Result<Option<ReceivedPaymentStatus>, Error>;
|
|
|
|
|
|
/// Stores a transaction
|
|
/// Stores a transaction
|
|
- async fn store_transaction(&mut self, transaction: &Transaction) -> Result<(), Error>;
|
|
|
|
|
|
+ async fn store_base_transaction(
|
|
|
|
+ &mut self,
|
|
|
|
+ transaction_id: &TxId,
|
|
|
|
+ transaction: &BaseTx,
|
|
|
|
+ ) -> Result<(), Error>;
|
|
|
|
+
|
|
|
|
+ /// Persists a revision
|
|
|
|
+ async fn store_revision(
|
|
|
|
+ &mut self,
|
|
|
|
+ revision_id: &RevId,
|
|
|
|
+ revision: &Revision,
|
|
|
|
+ ) -> Result<(), Error>;
|
|
|
|
+
|
|
|
|
+ /// Updates the revision of a transaction. Both the revision and the transaction must exist.
|
|
|
|
+ async fn update_transaction_revision(
|
|
|
|
+ &mut self,
|
|
|
|
+ transaction_id: &TxId,
|
|
|
|
+ revision_id: &RevId,
|
|
|
|
+ previous_rev_id: Option<&RevId>,
|
|
|
|
+ ) -> Result<(), Error>;
|
|
|
|
|
|
/// Sets the tags for a given transaction. Any tag not included in this
|
|
/// Sets the tags for a given transaction. Any tag not included in this
|
|
/// vector should be removed
|
|
/// vector should be removed
|
|
async fn tag_transaction(
|
|
async fn tag_transaction(
|
|
&mut self,
|
|
&mut self,
|
|
- transaction: &Transaction,
|
|
|
|
|
|
+ transaction_id: &TxId,
|
|
tags: &[String],
|
|
tags: &[String],
|
|
) -> Result<(), Error>;
|
|
) -> Result<(), Error>;
|
|
|
|
|
|
@@ -224,7 +255,7 @@ pub trait Storage {
|
|
) -> Result<Vec<(TxId, String, DateTime<Utc>)>, Error>;
|
|
) -> Result<Vec<(TxId, String, DateTime<Utc>)>, Error>;
|
|
*/
|
|
*/
|
|
|
|
|
|
- /// Returns a transaction object by id
|
|
|
|
|
|
+ /// Returns a revision with a transaction object by id
|
|
async fn get_transaction(&self, transaction_id: &TxId) -> Result<Transaction, Error>;
|
|
async fn get_transaction(&self, transaction_id: &TxId) -> Result<Transaction, Error>;
|
|
|
|
|
|
/// Returns a list of a transactions for a given account (and optionally
|
|
/// Returns a list of a transactions for a given account (and optionally
|
|
@@ -241,7 +272,7 @@ pub trait Storage {
|
|
#[cfg(test)]
|
|
#[cfg(test)]
|
|
pub mod test {
|
|
pub mod test {
|
|
use super::*;
|
|
use super::*;
|
|
- use crate::{config::Config, status::StatusManager};
|
|
|
|
|
|
+ use crate::{config::Config, status::StatusManager, Transaction};
|
|
use rand::Rng;
|
|
use rand::Rng;
|
|
|
|
|
|
#[macro_export]
|
|
#[macro_export]
|
|
@@ -323,14 +354,44 @@ pub mod test {
|
|
)
|
|
)
|
|
.expect("valid tx");
|
|
.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
- storing.store_transaction(&deposit).await.expect("store tx");
|
|
|
|
|
|
+ storing
|
|
|
|
+ .store_base_transaction(&deposit.id, &deposit.transaction)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store tx");
|
|
|
|
+ storing
|
|
|
|
+ .store_revision(&deposit.revision_id, &deposit.revision)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store revision");
|
|
|
|
+ storing
|
|
|
|
+ .update_transaction_revision(
|
|
|
|
+ &deposit.id,
|
|
|
|
+ &deposit.revision_id,
|
|
|
|
+ deposit.revision.previous.as_ref(),
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .expect("update tx");
|
|
storing.rollback().await.expect("rollback");
|
|
storing.rollback().await.expect("rollback");
|
|
- assert!(storage.get_transaction(deposit.id()).await.is_err());
|
|
|
|
|
|
+ assert!(storage.get_transaction(&deposit.id).await.is_err());
|
|
|
|
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
- storing.store_transaction(&deposit).await.expect("store tx");
|
|
|
|
|
|
+ storing
|
|
|
|
+ .store_base_transaction(&deposit.id, &deposit.transaction)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store tx");
|
|
|
|
+ storing
|
|
|
|
+ .store_revision(&deposit.revision_id, &deposit.revision)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store revision");
|
|
|
|
+ storing
|
|
|
|
+ .update_transaction_revision(
|
|
|
|
+ &deposit.id,
|
|
|
|
+ &deposit.revision_id,
|
|
|
|
+ deposit.revision.previous.as_ref(),
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .expect("update tx");
|
|
storing.commit().await.expect("commit");
|
|
storing.commit().await.expect("commit");
|
|
- assert!(storage.get_transaction(deposit.id()).await.is_ok());
|
|
|
|
|
|
+ assert!(storage.get_transaction(&deposit.id).await.is_ok());
|
|
}
|
|
}
|
|
|
|
|
|
pub async fn transaction_not_available_until_commit<T>(storage: T)
|
|
pub async fn transaction_not_available_until_commit<T>(storage: T)
|
|
@@ -348,15 +409,45 @@ pub mod test {
|
|
)
|
|
)
|
|
.expect("valid tx");
|
|
.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
- storing.store_transaction(&deposit).await.expect("store tx");
|
|
|
|
- assert!(storage.get_transaction(deposit.id()).await.is_err());
|
|
|
|
|
|
+ storing
|
|
|
|
+ .store_base_transaction(&deposit.id, &deposit.transaction)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store tx");
|
|
|
|
+ storing
|
|
|
|
+ .store_revision(&deposit.revision_id, &deposit.revision)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store revision");
|
|
|
|
+ storing
|
|
|
|
+ .update_transaction_revision(
|
|
|
|
+ &deposit.id,
|
|
|
|
+ &deposit.revision_id,
|
|
|
|
+ deposit.revision.previous.as_ref(),
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .expect("update tx");
|
|
|
|
+ assert!(storage.get_transaction(&deposit.id).await.is_err());
|
|
storing.rollback().await.expect("rollback");
|
|
storing.rollback().await.expect("rollback");
|
|
- assert!(storage.get_transaction(deposit.id()).await.is_err());
|
|
|
|
|
|
+ assert!(storage.get_transaction(&deposit.id).await.is_err());
|
|
|
|
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
let mut storing = storage.begin().await.expect("valid tx");
|
|
- storing.store_transaction(&deposit).await.expect("store tx");
|
|
|
|
|
|
+ storing
|
|
|
|
+ .store_base_transaction(&deposit.id, &deposit.transaction)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store base tx");
|
|
|
|
+ storing
|
|
|
|
+ .store_revision(&deposit.revision_id, &deposit.revision)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store revision");
|
|
|
|
+ storing
|
|
|
|
+ .update_transaction_revision(
|
|
|
|
+ &deposit.id,
|
|
|
|
+ &deposit.revision_id,
|
|
|
|
+ deposit.revision.previous.as_ref(),
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .expect("update tx");
|
|
storing.commit().await.expect("commit");
|
|
storing.commit().await.expect("commit");
|
|
- assert!(storage.get_transaction(deposit.id()).await.is_ok());
|
|
|
|
|
|
+ assert!(storage.get_transaction(&deposit.id).await.is_ok());
|
|
}
|
|
}
|
|
|
|
|
|
pub async fn does_not_update_spent_payments<T>(storage: T)
|
|
pub async fn does_not_update_spent_payments<T>(storage: T)
|
|
@@ -381,14 +472,18 @@ pub mod test {
|
|
let recipients = vec![recipient];
|
|
let recipients = vec![recipient];
|
|
|
|
|
|
writer
|
|
writer
|
|
- .create_payments(&transaction_id, &recipients, Status::Locked)
|
|
|
|
|
|
+ .create_payments(&transaction_id, &recipients, ReceivedPaymentStatus::Locked)
|
|
.await
|
|
.await
|
|
.expect("valid payment");
|
|
.expect("valid payment");
|
|
|
|
|
|
// Alter state
|
|
// Alter state
|
|
assert_eq!(
|
|
assert_eq!(
|
|
writer
|
|
writer
|
|
- .update_transaction_payments(&transaction_id, Status::Locked, Status::Locked)
|
|
|
|
|
|
+ .update_transaction_payments(
|
|
|
|
+ &transaction_id,
|
|
|
|
+ ReceivedPaymentStatus::Locked,
|
|
|
|
+ ReceivedPaymentStatus::Locked
|
|
|
|
+ )
|
|
.await
|
|
.await
|
|
.expect("valid"),
|
|
.expect("valid"),
|
|
(1, 0)
|
|
(1, 0)
|
|
@@ -397,13 +492,20 @@ pub mod test {
|
|
// Transactions is settled and their spent payments are forever spent
|
|
// Transactions is settled and their spent payments are forever spent
|
|
assert_eq!(
|
|
assert_eq!(
|
|
writer
|
|
writer
|
|
- .update_transaction_payments(&transaction_id, Status::Spent, Status::Spent)
|
|
|
|
|
|
+ .update_transaction_payments(
|
|
|
|
+ &transaction_id,
|
|
|
|
+ ReceivedPaymentStatus::Spent,
|
|
|
|
+ ReceivedPaymentStatus::Spent
|
|
|
|
+ )
|
|
.await
|
|
.await
|
|
.expect("valid"),
|
|
.expect("valid"),
|
|
(1, 0)
|
|
(1, 0)
|
|
);
|
|
);
|
|
|
|
|
|
- for status in [Status::Failed, Status::Spendable] {
|
|
|
|
|
|
+ for status in [
|
|
|
|
+ ReceivedPaymentStatus::Failed,
|
|
|
|
+ ReceivedPaymentStatus::Spendable,
|
|
|
|
+ ] {
|
|
assert_eq!(
|
|
assert_eq!(
|
|
writer
|
|
writer
|
|
.update_transaction_payments(&transaction_id, status, status)
|
|
.update_transaction_payments(&transaction_id, status, status)
|
|
@@ -428,7 +530,13 @@ pub mod test {
|
|
.from_human(&format!("{}", rng.gen_range(-1000.0..1000.0)))
|
|
.from_human(&format!("{}", rng.gen_range(-1000.0..1000.0)))
|
|
.expect("valid amount");
|
|
.expect("valid amount");
|
|
|
|
|
|
- for (i, status) in [Status::Locked, Status::Spendable].into_iter().enumerate() {
|
|
|
|
|
|
+ for (i, status) in [
|
|
|
|
+ ReceivedPaymentStatus::Locked,
|
|
|
|
+ ReceivedPaymentStatus::Spendable,
|
|
|
|
+ ]
|
|
|
|
+ .into_iter()
|
|
|
|
+ .enumerate()
|
|
|
|
+ {
|
|
let transaction_id: TxId = vec![i as u8; 32].try_into().expect("valid tx id");
|
|
let transaction_id: TxId = vec![i as u8; 32].try_into().expect("valid tx id");
|
|
|
|
|
|
writer
|
|
writer
|
|
@@ -443,7 +551,9 @@ pub mod test {
|
|
.await
|
|
.await
|
|
.expect("valid payment");
|
|
.expect("valid payment");
|
|
|
|
|
|
- for (spend_new_status, create_new_status) in [(Status::Spent, Status::Spent)] {
|
|
|
|
|
|
+ for (spend_new_status, create_new_status) in
|
|
|
|
+ [(ReceivedPaymentStatus::Spent, ReceivedPaymentStatus::Spent)]
|
|
|
|
+ {
|
|
assert_eq!(
|
|
assert_eq!(
|
|
writer
|
|
writer
|
|
.update_transaction_payments(
|
|
.update_transaction_payments(
|
|
@@ -471,7 +581,10 @@ pub mod test {
|
|
.from_human(&format!("{}", rng.gen_range(-1000.0..1000.0)))
|
|
.from_human(&format!("{}", rng.gen_range(-1000.0..1000.0)))
|
|
.expect("valid amount");
|
|
.expect("valid amount");
|
|
|
|
|
|
- for (i, status) in [Status::Failed, Status::Spent].into_iter().enumerate() {
|
|
|
|
|
|
+ for (i, status) in [ReceivedPaymentStatus::Failed, ReceivedPaymentStatus::Spent]
|
|
|
|
+ .into_iter()
|
|
|
|
+ .enumerate()
|
|
|
|
+ {
|
|
let transaction_id: TxId = vec![i as u8; 32].try_into().expect("valid tx id");
|
|
let transaction_id: TxId = vec![i as u8; 32].try_into().expect("valid tx id");
|
|
|
|
|
|
writer
|
|
writer
|
|
@@ -487,8 +600,11 @@ pub mod test {
|
|
.expect("valid payment");
|
|
.expect("valid payment");
|
|
|
|
|
|
for (spend_new_status, create_new_status) in [
|
|
for (spend_new_status, create_new_status) in [
|
|
- (Status::Spent, Status::Spent),
|
|
|
|
- (Status::Spendable, Status::Spendable),
|
|
|
|
|
|
+ (ReceivedPaymentStatus::Spent, ReceivedPaymentStatus::Spent),
|
|
|
|
+ (
|
|
|
|
+ ReceivedPaymentStatus::Spendable,
|
|
|
|
+ ReceivedPaymentStatus::Spendable,
|
|
|
|
+ ),
|
|
] {
|
|
] {
|
|
assert_eq!(
|
|
assert_eq!(
|
|
writer
|
|
writer
|
|
@@ -533,7 +649,11 @@ pub mod test {
|
|
.collect::<Vec<_>>();
|
|
.collect::<Vec<_>>();
|
|
|
|
|
|
writer
|
|
writer
|
|
- .create_payments(&transaction_id, &recipients, Status::Spendable)
|
|
|
|
|
|
+ .create_payments(
|
|
|
|
+ &transaction_id,
|
|
|
|
+ &recipients,
|
|
|
|
+ ReceivedPaymentStatus::Spendable,
|
|
|
|
+ )
|
|
.await
|
|
.await
|
|
.expect("valid payment");
|
|
.expect("valid payment");
|
|
}
|
|
}
|
|
@@ -584,7 +704,22 @@ pub mod test {
|
|
.expect("valid tx");
|
|
.expect("valid tx");
|
|
|
|
|
|
let mut batch = storage.begin().await.expect("valid tx");
|
|
let mut batch = storage.begin().await.expect("valid tx");
|
|
- batch.store_transaction(&deposit).await.expect("is ok");
|
|
|
|
|
|
+ batch
|
|
|
|
+ .store_base_transaction(&deposit.id, &deposit.transaction)
|
|
|
|
+ .await
|
|
|
|
+ .expect("is ok");
|
|
|
|
+ batch
|
|
|
|
+ .store_revision(&deposit.revision_id, &deposit.revision)
|
|
|
|
+ .await
|
|
|
|
+ .expect("store revision");
|
|
|
|
+ batch
|
|
|
|
+ .update_transaction_revision(
|
|
|
|
+ &deposit.id,
|
|
|
|
+ &deposit.revision_id,
|
|
|
|
+ deposit.revision.previous.as_ref(),
|
|
|
|
+ )
|
|
|
|
+ .await
|
|
|
|
+ .expect("update tx");
|
|
batch
|
|
batch
|
|
.relate_account_to_transaction(&deposit.id, &account1, Type::Deposit)
|
|
.relate_account_to_transaction(&deposit.id, &account1, Type::Deposit)
|
|
.await
|
|
.await
|
|
@@ -653,7 +788,7 @@ pub mod test {
|
|
to: account.clone(),
|
|
to: account.clone(),
|
|
amount,
|
|
amount,
|
|
}],
|
|
}],
|
|
- Status::Locked,
|
|
|
|
|
|
+ ReceivedPaymentStatus::Locked,
|
|
)
|
|
)
|
|
.await
|
|
.await
|
|
.expect("valid payment");
|
|
.expect("valid payment");
|