-
Notifications
You must be signed in to change notification settings - Fork 68
htlc auditing extension #369
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
Conversation
| if !output.IsHTLC() { | ||
| continue | ||
| } | ||
| // check script details, for example make sure the deadline has not passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AcceptCashView is only used to accept when there is an issue (according to latest topology) and so this code is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, good catch. It is during Lock. We have already stuff there. I will update.
| } | ||
| // check script details, for example make sure the deadline has not passed | ||
| script, err := output.Script() | ||
| assert.NoError(err, "cannot get htlc script from input") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from output
| if !output.IsHTLC() { | ||
| continue | ||
| } | ||
| // check script details, for example make sure the deadline has not passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
script.Validate checks more than just the deadline
| "time" | ||
|
|
||
| "github.com/pkg/errors" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove empty line and run go imports
token/services/interop/htlc/audit.go
Outdated
| script := &Script{} | ||
| err = json.Unmarshal(owner.Identity, script) | ||
| if err != nil { | ||
| return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a description to this error
token/services/interop/htlc/audit.go
Outdated
| script := &Script{} | ||
| err = json.Unmarshal(owner.Identity, script) | ||
| if err != nil { | ||
| return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a description to this error
| // - The recipient must be set | ||
| // - The deadline must be after the passed time reference | ||
| // - HashInfo must be Available | ||
| func (s Script) Validate(timeReference time.Time) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (s *Script)
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
- finalizing integration test checks Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
…izing integration test checks Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
…izing integration test checks Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
…izing integration test checks Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
13384b6 to
9bae016
Compare
This PR introduces the following capabilities:
As a bonus, this PR also improves on the validation of the HTLC script.
Signed-off-by: Angelo De Caro adc@zurich.ibm.com