Skip to content

Commit

Permalink
chore: preserve older height
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Apr 27, 2024
1 parent de1f462 commit 94f1deb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/state/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (g *Generator) ProcessChain(
defer g.Mutex.Unlock()

state.SetChainProposalsError(chain, err)
state.SetChainProposalsHeight(chain, prevHeight)

Check warning on line 57 in pkg/state/generator.go

View check run for this annotation

Codecov / codecov/patch

pkg/state/generator.go#L57

Added line #L57 was not covered by tests

stateChain, found := oldState.ChainInfos[chain.Name]
if found {
Expand Down Expand Up @@ -132,6 +133,9 @@ func (g *Generator) ProcessProposalAndWallet(

if err != nil {
proposalVote.Error = err
if found {
proposalVote.Height = oldVote.Height

Check warning on line 137 in pkg/state/generator.go

View check run for this annotation

Codecov / codecov/patch

pkg/state/generator.go#L136-L137

Added lines #L136 - L137 were not covered by tests
}
} else {
proposalVote.Vote = vote
proposalVote.Height = voteHeight
Expand Down

0 comments on commit 94f1deb

Please sign in to comment.