Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename-changetooutput #28

Merged
merged 1 commit into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 []*Fee) 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 []*Fee) 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