mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Fix Monero's Extra::fee_weight and handling of data limits
This commit is contained in:
@@ -30,10 +30,13 @@ test!(
|
||||
add_multiple_data_less_than_max,
|
||||
(
|
||||
|_, mut builder: Builder, addr| async move {
|
||||
let data = vec![b'\0'; MAX_ARBITRARY_DATA_SIZE - 1];
|
||||
let mut data = vec![];
|
||||
for b in 1 ..= 3 {
|
||||
data.push(vec![b; MAX_ARBITRARY_DATA_SIZE - 1]);
|
||||
}
|
||||
|
||||
// Add tx multiple times
|
||||
for _ in 0 .. 5 {
|
||||
// Add data multiple times
|
||||
for data in &data {
|
||||
let result = builder.add_data(data.clone());
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
@@ -41,10 +44,10 @@ test!(
|
||||
builder.add_payment(addr, 5);
|
||||
(builder.build().unwrap(), data)
|
||||
},
|
||||
|_, tx: Transaction, mut scanner: Scanner, data: Vec<u8>| async move {
|
||||
|_, tx: Transaction, mut scanner: Scanner, data: Vec<Vec<u8>>| async move {
|
||||
let output = scanner.scan_transaction(&tx).not_locked().swap_remove(0);
|
||||
assert_eq!(output.commitment().amount, 5);
|
||||
assert_eq!(output.arbitrary_data(), vec![data; 5]);
|
||||
assert_eq!(output.arbitrary_data(), data);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user