From 845dad389f349387d8eafabe00162437f8a06951 Mon Sep 17 00:00:00 2001 From: grumbach Date: Thu, 5 Dec 2024 13:31:47 +0900 Subject: [PATCH] feat: improve parents naming --- ant-protocol/src/storage/transaction.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ant-protocol/src/storage/transaction.rs b/ant-protocol/src/storage/transaction.rs index 4732ef1f2d..0045f9e746 100644 --- a/ant-protocol/src/storage/transaction.rs +++ b/ant-protocol/src/storage/transaction.rs @@ -19,7 +19,7 @@ pub type TransactionContent = [u8; 32]; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Hash, Ord, PartialOrd)] pub struct Transaction { pub owner: PublicKey, - pub parent: Vec, + pub parents: Vec, pub content: TransactionContent, pub outputs: Vec<(PublicKey, TransactionContent)>, /// signs the above 4 fields with the owners key @@ -29,14 +29,14 @@ pub struct Transaction { impl Transaction { pub fn new( owner: PublicKey, - parent: Vec, + parents: Vec, content: TransactionContent, outputs: Vec<(PublicKey, TransactionContent)>, signature: Signature, ) -> Self { Self { owner, - parent, + parents, content, outputs, signature, @@ -53,7 +53,7 @@ impl Transaction { bytes.extend_from_slice("parent".as_bytes()); bytes.extend_from_slice( &self - .parent + .parents .iter() .map(|p| p.to_bytes()) .collect::>()