mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-12 14:09:25 +00:00
Finish documenting monero-serai
This commit is contained in:
@@ -60,7 +60,7 @@ test!(
|
||||
let mut data = vec![b'a'; MAX_ARBITRARY_DATA_SIZE + 1];
|
||||
|
||||
// Make sure we get an error if we try to add it to the TX
|
||||
assert_eq!(builder.add_data(data.clone()), Err(SendError::TooMuchData));
|
||||
assert_eq!(builder.add_data(data.clone()), Err(SendError::TooMuchArbitraryData));
|
||||
|
||||
// Reduce data size and retry. The data will now be 255 bytes long (including the added
|
||||
// marker), exactly
|
||||
|
||||
@@ -63,7 +63,7 @@ impl SignableTransactionBuilder {
|
||||
#[allow(unused)]
|
||||
pub fn add_data(&mut self, data: Vec<u8>) -> Result<&mut Self, SendError> {
|
||||
if data.len() > MAX_ARBITRARY_DATA_SIZE {
|
||||
Err(SendError::TooMuchData)?;
|
||||
Err(SendError::TooMuchArbitraryData)?;
|
||||
}
|
||||
self.data.push(data);
|
||||
Ok(self)
|
||||
|
||||
@@ -8,7 +8,7 @@ use monero_wallet::{
|
||||
transaction::Transaction,
|
||||
rpc::Rpc,
|
||||
address::{Network, SubaddressIndex, MoneroAddress},
|
||||
extra::{MAX_TX_EXTRA_NONCE_SIZE, Extra, PaymentId},
|
||||
extra::{MAX_ARBITRARY_DATA_SIZE, Extra, PaymentId},
|
||||
Scanner,
|
||||
};
|
||||
|
||||
@@ -347,8 +347,7 @@ test!(
|
||||
|
||||
// Make 2 data that is the full 255 bytes
|
||||
for _ in 0 .. 2 {
|
||||
// Subtract 1 since we prefix data with 127
|
||||
let data = vec![b'a'; MAX_TX_EXTRA_NONCE_SIZE - 1];
|
||||
let data = vec![b'a'; MAX_ARBITRARY_DATA_SIZE];
|
||||
builder.add_data(data).unwrap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user