mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-07 06:44:11 +00:00
Allow duplicate outputs
This commit is contained in:
parent
f95664474f
commit
fa6938fb83
@ -1518,11 +1518,6 @@ fn test_bad_send() {
|
|||||||
vec![(&ext_taddr, AMOUNT1 + 10, None)]);
|
vec![(&ext_taddr, AMOUNT1 + 10, None)]);
|
||||||
assert!(raw_tx.err().unwrap().contains("Insufficient verified funds"));
|
assert!(raw_tx.err().unwrap().contains("Insufficient verified funds"));
|
||||||
|
|
||||||
// Duplicated addresses are fine
|
|
||||||
let raw_tx = wallet.send_to_address(branch_id, &ss, &so,
|
|
||||||
vec![(&ext_taddr, AMOUNT1 + 10, None),
|
|
||||||
(&ext_taddr, AMOUNT1 + 10, None)]);
|
|
||||||
assert!(raw_tx.is_ok());
|
|
||||||
|
|
||||||
// No addresses
|
// No addresses
|
||||||
let raw_tx = wallet.send_to_address(branch_id, &ss, &so, vec![]);
|
let raw_tx = wallet.send_to_address(branch_id, &ss, &so, vec![]);
|
||||||
@ -1530,6 +1525,26 @@ fn test_bad_send() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_duplicate_outputs() {
|
||||||
|
// Test all the ways in which a send should fail
|
||||||
|
const AMOUNT1: u64 = 50000;
|
||||||
|
let _fee: u64 = DEFAULT_FEE.try_into().unwrap();
|
||||||
|
|
||||||
|
let (wallet, _txid1, _block_hash) = get_test_wallet(AMOUNT1);
|
||||||
|
|
||||||
|
let branch_id = u32::from_str_radix("2bb40e60", 16).unwrap();
|
||||||
|
let (ss, so) = get_sapling_params().unwrap();
|
||||||
|
let ext_taddr = wallet.address_from_sk(&SecretKey::from_slice(&[1u8; 32]).unwrap());
|
||||||
|
|
||||||
|
// Duplicated addresses with memos are fine too
|
||||||
|
let raw_tx = wallet.send_to_address(branch_id, &ss, &so,
|
||||||
|
vec![(&ext_taddr, 100, Some("First memo".to_string())),
|
||||||
|
(&ext_taddr, 0, Some("Second memo".to_string())),
|
||||||
|
(&ext_taddr, 0, Some("Third memo".to_string()))]);
|
||||||
|
assert!(raw_tx.is_ok());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[should_panic]
|
#[should_panic]
|
||||||
fn test_bad_params() {
|
fn test_bad_params() {
|
||||||
|
Loading…
Reference in New Issue
Block a user