Skip to content

Commit

Permalink
Merge branch 'v2' into enhancement/FeeQuotes
Browse files Browse the repository at this point in the history
  • Loading branch information
jadwahab authored May 27, 2021
2 parents 835f0a1 + 9313a4d commit 14624c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions txchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func (tx *Tx) Change(s *bscript.Script, f *FeeQuote) error {
return nil
}

// ChangeToOutput will calculate fees and add them to an output at the index specified (0 based).
// ChangeToExistingOutput will calculate fees and add them to an output at the index specified (0 based).
// If an invalid index is supplied and error is returned.
func (tx *Tx) ChangeToOutput(index uint, f *FeeQuote) error {
func (tx *Tx) ChangeToExistingOutput(index uint, f []*Fee) error {
if int(index) > len(tx.Outputs)-1 {
return errors.New("index is greater than number of inputs in transaction")
}
Expand Down
2 changes: 1 addition & 1 deletion txchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func TestTx_ChangeToOutput(t *testing.T) {
}
for name, test := range tests {
t.Run(name, func(t *testing.T) {
err := test.tx.ChangeToOutput(test.index, test.fees)
err := test.tx.ChangeToExistingOutput(test.index, test.fees)
if test.err != nil {
assert.Error(t, err)
assert.Equal(t, test.err, err)
Expand Down

0 comments on commit 14624c0

Please sign in to comment.