1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
crate::ix!();
//-------------------------------------------[.cpp/bitcoin/src/qt/walletmodeltransaction.h]
/**
| Data model for a walletmodel transaction.
|
*/
pub struct WalletModelTransaction {
recipients: QList<SendCoinsRecipient>,
wtx: TransactionRef,
fee: Amount,
}
//-------------------------------------------[.cpp/bitcoin/src/qt/walletmodeltransaction.cpp]
impl WalletModelTransaction {
pub fn new(recipients: &QList<SendCoinsRecipient>) -> Self {
todo!();
/*
:
recipients(_recipients),
fee(0)
*/
}
pub fn get_recipients(&self) -> QList<SendCoinsRecipient> {
todo!();
/*
return recipients;
*/
}
pub fn get_wtx(&mut self) -> &mut TransactionRef {
todo!();
/*
return wtx;
*/
}
pub fn set_wtx(&mut self, new_tx: &TransactionRef) {
todo!();
/*
wtx = newTx;
*/
}
pub fn get_transaction_size(&mut self) -> u32 {
todo!();
/*
return wtx ? GetVirtualTransactionSize(*wtx) : 0;
*/
}
pub fn get_transaction_fee(&self) -> Amount {
todo!();
/*
return fee;
*/
}
pub fn set_transaction_fee(&mut self, new_fee: &Amount) {
todo!();
/*
fee = newFee;
*/
}
/**
| needed for the subtract-fee-from-amount
| feature
|
*/
pub fn reassign_amounts(&mut self, n_change_pos_ret: i32) {
todo!();
/*
const CTransaction* walletTransaction = wtx.get();
int i = 0;
for (QList<SendCoinsRecipient>::iterator it = recipients.begin(); it != recipients.end(); ++it)
{
SendCoinsRecipient& rcp = (*it);
{
if (i == nChangePosRet)
i++;
rcp.amount = walletTransaction->vout[i].nValue;
i++;
}
}
*/
}
pub fn get_total_transaction_amount(&self) -> Amount {
todo!();
/*
CAmount totalTransactionAmount = 0;
for (const SendCoinsRecipient &rcp : recipients)
{
totalTransactionAmount += rcp.amount;
}
return totalTransactionAmount;
*/
}
}