Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

payment updates #55

Merged
merged 22 commits into from
Jun 2, 2021
Merged

payment updates #55

merged 22 commits into from
Jun 2, 2021

Conversation

acharb
Copy link
Contributor

@acharb acharb commented May 28, 2021

updating the payment channel with new payment + confirming that payment

Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some thoughts inline. I think we should combine our branches.

sdk/state/state.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
require.NoError(t, err)
}

// TODO - how does Initiator submit "latest", is it store in the Channel?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I think we'll store in channel, or rather the tx can regenerate the tx and add the signatures.

Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple comments. I still need to look at the payment functions.

Comment on lines 41 to 42
Balance int64
Asset Asset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use an Amount type here, it captures both the asset and amount value in the struct. That'll make it easier for us to add support for multiple balances.

Copy link
Contributor Author

@acharb acharb Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9add63d

proposal to name the struct Balance instead of Amount? channel.amount.Amount feels weird, and a "balance" for each asset makes sense

sdk/state/state.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple more thoughts.

sdk/state/update.go Outdated Show resolved Hide resolved
sdk/state/update.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more:

sdk/state/update.go Outdated Show resolved Hide resolved
@acharb acharb marked this pull request as ready for review June 2, 2021 00:20
@acharb
Copy link
Contributor Author

acharb commented Jun 2, 2021

thanks for the reviews and comments @leighmcculloch . I addressed the above points, lmk what you think

@acharb acharb changed the title payment updates (wip) payment updates Jun 2, 2021
Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should merge this along with #52 and then address inconsistencies because things probably need changing in both. I can take addressing those things in a new PR and you can review.

sdk/go.mod Show resolved Hide resolved
sdk/state/state.go Outdated Show resolved Hide resolved
sdk/state/state.go Show resolved Hide resolved
sdk/state/update.go Show resolved Hide resolved
amountFromResponder = p.Amount
}
newBalance := c.balance.Amount + amountFromInitiator - amountFromResponder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should validate the iteration number in the payment is what we expect too.

Where does the iteration number get incremented?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now it's living on the Payment, so iterated by the person sending the payment. I created a ticket to maybe do differently here
#61

sdk/txbuild/close.go Show resolved Hide resolved
sdk/state/update.go Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants