@@ -2,14 +2,15 @@ package tendermint
22
33import (
44 "github.com/NethermindEth/juno/consensus/types"
5+ "github.com/NethermindEth/juno/consensus/types/actions"
56 "github.com/NethermindEth/juno/consensus/types/wal"
67)
78
8- func (s * stateMachine [V , H , A ]) ProcessStart (round types.Round ) []types .Action [V , H , A ] {
9+ func (s * stateMachine [V , H , A ]) ProcessStart (round types.Round ) []actions .Action [V , H , A ] {
910 return s .processLoop (s .startRound (round ), nil )
1011}
1112
12- func (s * stateMachine [V , H , A ]) ProcessProposal (p * types.Proposal [V , H , A ]) []types .Action [V , H , A ] {
13+ func (s * stateMachine [V , H , A ]) ProcessProposal (p * types.Proposal [V , H , A ]) []actions .Action [V , H , A ] {
1314 return s .processMessage (p .MessageHeader , func () {
1415 if s .voteCounter .AddProposal (p ) && ! s .replayMode && p .Height == s .state .height {
1516 // Store proposal if its the first time we see it
@@ -20,7 +21,7 @@ func (s *stateMachine[V, H, A]) ProcessProposal(p *types.Proposal[V, H, A]) []ty
2021 })
2122}
2223
23- func (s * stateMachine [V , H , A ]) ProcessPrevote (p * types.Prevote [H , A ]) []types .Action [V , H , A ] {
24+ func (s * stateMachine [V , H , A ]) ProcessPrevote (p * types.Prevote [H , A ]) []actions .Action [V , H , A ] {
2425 return s .processMessage (p .MessageHeader , func () {
2526 if s .voteCounter .AddPrevote (p ) && ! s .replayMode && p .Height == s .state .height {
2627 // Store prevote if its the first time we see it
@@ -31,7 +32,7 @@ func (s *stateMachine[V, H, A]) ProcessPrevote(p *types.Prevote[H, A]) []types.A
3132 })
3233}
3334
34- func (s * stateMachine [V , H , A ]) ProcessPrecommit (p * types.Precommit [H , A ]) []types .Action [V , H , A ] {
35+ func (s * stateMachine [V , H , A ]) ProcessPrecommit (p * types.Precommit [H , A ]) []actions .Action [V , H , A ] {
3536 return s .processMessage (p .MessageHeader , func () {
3637 if s .voteCounter .AddPrecommit (p ) && ! s .replayMode && p .Height == s .state .height {
3738 // Store precommit if its the first time we see it
@@ -42,15 +43,15 @@ func (s *stateMachine[V, H, A]) ProcessPrecommit(p *types.Precommit[H, A]) []typ
4243 })
4344}
4445
45- func (s * stateMachine [V , H , A ]) processMessage (header types.MessageHeader [A ], addMessage func ()) []types .Action [V , H , A ] {
46+ func (s * stateMachine [V , H , A ]) processMessage (header types.MessageHeader [A ], addMessage func ()) []actions .Action [V , H , A ] {
4647 if ! s .preprocessMessage (header , addMessage ) {
4748 return nil
4849 }
4950
5051 return s .processLoop (nil , & header .Round )
5152}
5253
53- func (s * stateMachine [V , H , A ]) ProcessTimeout (tm types.Timeout ) []types .Action [V , H , A ] {
54+ func (s * stateMachine [V , H , A ]) ProcessTimeout (tm types.Timeout ) []actions .Action [V , H , A ] {
5455 if ! s .replayMode && tm .Height == s .state .height {
5556 if err := s .db .SetWALEntry ((* wal .WALTimeout )(& tm )); err != nil {
5657 s .log .Fatalf ("Failed to store timeout trigger in WAL" )
@@ -68,8 +69,8 @@ func (s *stateMachine[V, H, A]) ProcessTimeout(tm types.Timeout) []types.Action[
6869 return nil
6970}
7071
71- func (s * stateMachine [V , H , A ]) processLoop (action types .Action [V , H , A ], recentlyReceivedRound * types.Round ) []types .Action [V , H , A ] {
72- actions , shouldContinue := []types .Action [V , H , A ]{}, true
72+ func (s * stateMachine [V , H , A ]) processLoop (action actions .Action [V , H , A ], recentlyReceivedRound * types.Round ) []actions .Action [V , H , A ] {
73+ actions , shouldContinue := []actions .Action [V , H , A ]{}, true
7374 if action != nil {
7475 actions = append (actions , action )
7576 }
@@ -84,7 +85,7 @@ func (s *stateMachine[V, H, A]) processLoop(action types.Action[V, H, A], recent
8485 return actions
8586}
8687
87- func (s * stateMachine [V , H , A ]) process (recentlyReceivedRound * types.Round ) (action types .Action [V , H , A ], shouldContinue bool ) {
88+ func (s * stateMachine [V , H , A ]) process (recentlyReceivedRound * types.Round ) (action actions .Action [V , H , A ], shouldContinue bool ) {
8889 cachedProposal := s .findProposal (s .state .round )
8990
9091 roundCachedProposal := cachedProposal
0 commit comments