add serialize/deserialize impls

This commit is contained in:
jonesmarvin8
2026-03-02 11:54:41 -05:00
parent d863b763d1
commit 84abe02573
36 changed files with 207 additions and 163 deletions
+26 -26
View File
@@ -1,6 +1,6 @@
#![cfg(test)]
use nssa_core::account::{Account, AccountId, AccountWithMetadata, Data, Nonce};
use nssa_core::account::{Account, AccountId, AccountWithMetadata, Data};
use token_core::{
MetadataStandard, NewTokenDefinition, NewTokenMetadata, TokenDefinition, TokenHolding,
};
@@ -32,7 +32,7 @@ impl AccountForTests {
total_supply: BalanceForTests::init_supply(),
metadata_id: None,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -49,7 +49,7 @@ impl AccountForTests {
total_supply: BalanceForTests::init_supply(),
metadata_id: None,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::pool_definition_id(),
@@ -65,7 +65,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id_diff(),
balance: BalanceForTests::holding_balance(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -81,7 +81,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::holding_balance(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -97,7 +97,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::holding_balance(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::holding_id(),
@@ -113,7 +113,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::init_supply(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::holding_id(),
@@ -130,7 +130,7 @@ impl AccountForTests {
total_supply: BalanceForTests::init_supply_burned(),
metadata_id: None,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -146,7 +146,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::holding_balance_burned(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::holding_id(),
@@ -170,7 +170,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::mint_success(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::holding_id(),
@@ -186,7 +186,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::holding_balance_mint(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -203,7 +203,7 @@ impl AccountForTests {
total_supply: BalanceForTests::init_supply_mint(),
metadata_id: None,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -219,7 +219,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::mint_overflow(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -236,7 +236,7 @@ impl AccountForTests {
printable_supply: BalanceForTests::printable_copies(),
metadata_id: AccountId::new([0; 32]),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -260,7 +260,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::init_supply(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -277,7 +277,7 @@ impl AccountForTests {
total_supply: BalanceForTests::init_supply(),
metadata_id: None,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::pool_definition_id(),
@@ -293,7 +293,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::init_supply(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -309,7 +309,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::init_supply(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id_2(),
@@ -325,7 +325,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::recipient_post_transfer(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id_2(),
@@ -341,7 +341,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
balance: BalanceForTests::sender_post_transfer(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -357,7 +357,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
print_balance: BalanceForTests::printable_copies(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -373,7 +373,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
print_balance: 1,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -389,7 +389,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
print_balance: BalanceForTests::printable_copies() - 1,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),
@@ -405,7 +405,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
owned: true,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: false,
account_id: IdForTests::holding_id(),
@@ -421,7 +421,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
print_balance: BalanceForTests::printable_copies(),
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id_2(),
@@ -437,7 +437,7 @@ impl AccountForTests {
definition_id: IdForTests::pool_definition_id(),
print_balance: 0,
}),
nonce: Nonce(0),
nonce: 0u128.into(),
},
is_authorized: true,
account_id: IdForTests::holding_id(),