-
Notifications
You must be signed in to change notification settings - Fork 579
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
imp: remove height
from header
and merge header
with misbehaviour
#4049
imp: remove height
from header
and merge header
with misbehaviour
#4049
Conversation
type checkForMisbehaviourExecuteResult struct { | ||
contractResult | ||
FoundMisbehaviour bool `json:"found_misbehaviour"` | ||
} | ||
|
||
type updateStateExecuteResult struct { | ||
contractResult | ||
Heights []exported.Height `json:"heights"` | ||
} |
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.
Added these types for the different results.
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.
same comment from other PR about response vs result naming :)
clientMessage struct { | ||
Header *Header `json:"header,omitempty"` | ||
Misbehaviour *Misbehaviour `json:"misbehaviour,omitempty"` | ||
ClientMessage *ClientMessage `json:"client_message"` |
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.
This is how the payload to the contract call looks after merging Header
and Misbehaviour
.
…header-and-merge-header-with-misbehaviour # Conflicts: # modules/light-clients/08-wasm/types/header_test.go # modules/light-clients/08-wasm/types/misbehaviour.go # modules/light-clients/08-wasm/types/misbehaviour_test.go # modules/light-clients/08-wasm/types/upgrade.go # modules/light-clients/08-wasm/types/wasm.pb.go
…header-and-merge-header-with-misbehaviour
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.
left some comments / minor suggestions! :) nice work on all these!
|
||
for _, tc := range testCases { | ||
suite.Run(tc.name, func() { | ||
clientMessage := tc.clientMessage |
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.
nit: redundant var, but feel free to ignore, its probably fine
if !ok { | ||
panic(fmt.Errorf("expected type %T, got %T", &Header{}, clientMsg)) | ||
panic(fmt.Errorf("expected type %T, got %T", &ClientMessage{}, clientMsg)) |
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.
if we're going to panic here, then we should also panic in CheckForMisbehaviour
and UpdateStateOnMisbehaviour
if clientMsg
is not *ClientMessage
, right?
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.
I think this mostly followed what is done for tendermint. For CheckForMisbehaviour, returning false
would call UpdateState
and result in that panic being hit. I guess panicking could be done here but it wouldn't save us much right?
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.
Agree!
type checkForMisbehaviourExecuteResult struct { | ||
contractResult | ||
FoundMisbehaviour bool `json:"found_misbehaviour"` | ||
} | ||
|
||
type updateStateExecuteResult struct { | ||
contractResult | ||
Heights []exported.Height `json:"heights"` | ||
} |
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.
same comment from other PR about response vs result naming :)
…header-and-merge-header-with-misbehaviour # Conflicts: # modules/light-clients/08-wasm/types/misbehaviour_handle.go # modules/light-clients/08-wasm/types/vm.go # modules/light-clients/08-wasm/types/wasm.pb.go
Description
Work in progress. Still needs new versions of contracts for tests to pass.
closes: #3958
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.