Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Apr 9, 2024
1 parent e58094a commit 2a0a638
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions baseapp/oe/optimistic_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// FinalizeBlockFunc is the function that is called by the OE to finalize the
// block. It is the same as the one in the ABCI app.
type FinalizeBlockFunc func(context.Context, *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
type FinalizeBlockFunc func(context.Context, *abci.FinalizeBlockRequest) (*abci.FinalizeBlockResponse, error)

// OptimisticExecution is a struct that contains the OE context. It is used to
// run the FinalizeBlock function in a goroutine, and to abort it if needed.
Expand All @@ -25,8 +25,8 @@ type OptimisticExecution struct {

mtx sync.Mutex
stopCh chan struct{}
request *abci.RequestFinalizeBlock
response *abci.ResponseFinalizeBlock
request *abci.FinalizeBlockRequest
response *abci.FinalizeBlockResponse
err error
cancelFunc func() // cancel function for the context
initialized bool // A boolean value indicating whether the struct has been initialized
Expand Down Expand Up @@ -82,12 +82,12 @@ func (oe *OptimisticExecution) Initialized() bool {
}

// Execute initializes the OE and starts it in a goroutine.
func (oe *OptimisticExecution) Execute(req *abci.RequestProcessProposal) {
func (oe *OptimisticExecution) Execute(req *abci.ProcessProposalRequest) {
oe.mtx.Lock()
defer oe.mtx.Unlock()

oe.stopCh = make(chan struct{})
oe.request = &abci.RequestFinalizeBlock{
oe.request = &abci.FinalizeBlockRequest{
Txs: req.Txs,
DecidedLastCommit: req.ProposedLastCommit,
Misbehavior: req.Misbehavior,
Expand Down Expand Up @@ -154,7 +154,7 @@ func (oe *OptimisticExecution) Abort() {
}

// WaitResult waits for the OE to finish and returns the result.
func (oe *OptimisticExecution) WaitResult() (*abci.ResponseFinalizeBlock, error) {
func (oe *OptimisticExecution) WaitResult() (*abci.FinalizeBlockResponse, error) {
<-oe.stopCh
return oe.response, oe.err
}

0 comments on commit 2a0a638

Please sign in to comment.