From cdde2080fb3ba386cd0e4b065ec24039eeb9a9f9 Mon Sep 17 00:00:00 2001 From: j-berman Date: Mon, 8 Jan 2024 06:02:43 -0800 Subject: [PATCH] monero: add tx extra test for minergate + pub key --- coins/monero/src/tests/extra.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/coins/monero/src/tests/extra.rs b/coins/monero/src/tests/extra.rs index 2d677d98d..b727fe9de 100644 --- a/coins/monero/src/tests/extra.rs +++ b/coins/monero/src/tests/extra.rs @@ -144,3 +144,15 @@ fn extra_mysterious_minergate_only_wrong_size() { let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); assert!(extra.0.is_empty()); } + +#[test] +fn extra_mysterious_minergate_and_pub_key() { + let mut buf: Vec = vec![222, 1, 42]; + buf.extend(PUB_KEY_BYTES.to_vec()); + let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap(); + assert_eq!( + extra.0, + vec![ExtraField::MysteriousMinergate(vec![42]), ExtraField::PublicKey(pub_key())] + ); + test_write_buf(&extra, &buf); +}