Update monero-wallet tests to compile

Some are _consistently_ failing due to the inputs we attempt to spend being too
young. I'm unsure what's up with that. Most seem to pass _consistently_,
implying it's not a random issue yet some configuration/env aspect.
This commit is contained in:
Luke Parker
2024-06-28 16:04:08 -04:00
parent 891362a710
commit 8319d219d7
10 changed files with 191 additions and 218 deletions

View File

@@ -321,11 +321,27 @@ impl SignableTransaction {
}
}
let res = SignableTransaction { rct_type, sender_view_key, inputs, payments, data, fee_rate };
let mut res =
SignableTransaction { rct_type, sender_view_key, inputs, payments, data, fee_rate };
res.validate()?;
// Shuffle the payments
{
let mut rng = res.seeded_rng(b"shuffle_payments");
res.payments.shuffle(&mut rng);
}
Ok(res)
}
pub fn fee_rate(&self) -> FeeRate {
self.fee_rate
}
pub fn fee(&self) -> u64 {
self.weight_and_fee().1
}
pub fn write<W: io::Write>(&self, w: &mut W) -> io::Result<()> {
fn write_input<W: io::Write>(input: &(SpendableOutput, Decoys), w: &mut W) -> io::Result<()> {
input.0.write(w)?;
@@ -424,12 +440,6 @@ impl SignableTransaction {
key_images.push(key_image);
}
// Shuffle the payments
{
let mut rng = self.seeded_rng(b"shuffle_payments");
self.payments.shuffle(&mut rng);
}
SignableTransactionWithKeyImages { intent: self, key_images }
}