Rename DummyTxOutData::new_with_amount to new#29
Conversation
|
@bc1cindy needs a rebase |
77ea704 to
aa56999
Compare
rebased! @arminsabouri |
arminsabouri
left a comment
There was a problem hiding this comment.
Just a suggestion to clean up some boilerplate. Lmk if it makes sense.
| DummyTxOutData::new(100, 0), | ||
| DummyTxOutData::new(100, 1), | ||
| DummyTxOutData::new(100, 2), | ||
| DummyTxOutData::new(200, 3), | ||
| DummyTxOutData::new(200, 4), | ||
| DummyTxOutData::new(200, 5), | ||
| DummyTxOutData::new(300, 6), | ||
| DummyTxOutData::new(300, 7), | ||
| DummyTxOutData::new(300, 8), |
There was a problem hiding this comment.
I see new is mostly being used as a element of a vec. Would it make more sense to refactor DummyTxData::new_with_outputs to take a vec of amounts. That way we dont have to explictly pass in vout -- it can be calculated by new_with_outputs using enumurate()
e.g
DummyTxData::new_with_outputs(vec![ 100, 100, 100, 200, 200, ..., 300])There was a problem hiding this comment.
makes sense, I'll do it
There was a problem hiding this comment.
cleaning time
I kept new_with_outputs intact because same_address.rs needs to pass explicit scripts via new_with_script, but added DummyTxData::new_with_amounts
aa56999 to
07d666f
Compare
arminsabouri
left a comment
There was a problem hiding this comment.
Great clean up. Seems a bit inconsistent. Someplaces still using new() when I think they can use new_with_amounts?
| DummyTxOutData::new_with_amount(250, 0), | ||
| DummyTxOutData::new_with_amount(40, 1), | ||
| ], | ||
| vec![DummyTxOutData::new(250, 0), DummyTxOutData::new(40, 1)], |
There was a problem hiding this comment.
Anything preventing us from using new_with_amounts here?
There was a problem hiding this comment.
new_with_amounts creates funding txs with no inputs, so I created new_with_spent for spending txs.
also added comments to be clear
07d666f to
2792eb9
Compare
rename
DummyTxOutData::new_with_amounttonewfor the most common constructor and align withDummyTxData