We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Got Unregistered interface types.Evidence in response of rest-api blocks/latest when latest block contains DuplicateVoteEvidence in our chain.
Unregistered interface types.Evidence
blocks/latest
v0.36.0-rc1
{ "error": "Unregistered interface types.Evidence" }
Maybe we should add RegisterEvidences(cdc) in codec/codec.go:54
RegisterEvidences(cdc)
func init() { cdc := New() RegisterCrypto(cdc) Cdc = cdc.Seal() }
Got same error in following tests, and the test can pass if we add RegisterEvidences(cdc) in init()
init()
type Codec = amino.Codec var My *Codec func New() *Codec { return amino.NewCodec() } func RegisterCrypto(cdc *Codec) { cryptoAmino.RegisterAmino(cdc) } var Cdc *Codec func init() { cdc := New() RegisterCrypto(cdc) //RegisterEvidences(cdc) Cdc = cdc.Seal() } func TestEvidenceList(t *testing.T) { ev := randomDuplicatedVoteEvidence() evl := EvidenceList([]Evidence{ev}) assert.NotNil(t, evl.Hash()) assert.True(t, evl.Has(ev)) assert.False(t, evl.Has(&DuplicateVoteEvidence{})) x := Cdc.MustMarshalJSON(evl) fmt.Println(string(x)) }
The text was updated successfully, but these errors were encountered:
Yes, good catch @whunmr. We should add a proxy call in codec.go which calls Tendermint's evidence.RegisterEvidences.
codec.go
evidence.RegisterEvidences
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Summary of Bug
Got
Unregistered interface types.Evidence
in response of rest-apiblocks/latest
when latest block contains DuplicateVoteEvidence in our chain.
Version
v0.36.0-rc1
Steps to Reproduce
tests
Maybe we should add
RegisterEvidences(cdc)
in codec/codec.go:54Got same error in following tests, and the test can pass if we add
RegisterEvidences(cdc)
ininit()
For Admin Use
The text was updated successfully, but these errors were encountered: