diff --git a/flusher/flusher/bandtss_db.py b/flusher/flusher/bandtss_db.py index e9e9e5c2d..5407f0f05 100644 --- a/flusher/flusher/bandtss_db.py +++ b/flusher/flusher/bandtss_db.py @@ -25,9 +25,7 @@ def process_bind_param(self, value, dialect): "bandtss_group_transitions", metadata, Column("proposal_id", sa.Integer, sa.ForeignKey("proposals.id"), primary_key=True), - Column( - "tss_signing_id", sa.Integer, sa.ForeignKey("tss_signings.id"), nullable=True - ), + Column("tss_signing_id", sa.Integer, sa.ForeignKey("tss_signings.id"), nullable=True), Column( "current_tss_group_id", sa.Integer, @@ -60,8 +58,8 @@ def process_bind_param(self, value, dialect): ), ) -bandtss_current_groups = sa.Table( - "bandtss_current_groups", +bandtss_historical_current_groups = sa.Table( + "bandtss_historical_current_groups", metadata, Column( "proposal_id", @@ -88,9 +86,7 @@ def process_bind_param(self, value, dialect): bandtss_members = sa.Table( "bandtss_members", metadata, - Column( - "tss_group_id", sa.Integer, sa.ForeignKey("tss_groups.id"), primary_key=True - ), + Column("tss_group_id", sa.Integer, sa.ForeignKey("tss_groups.id"), primary_key=True), Column("account_id", sa.Integer, sa.ForeignKey("accounts.id"), primary_key=True), Column("is_active", sa.Boolean), Column("since", CustomDateTime, nullable=True), diff --git a/flusher/flusher/handler.py b/flusher/flusher/handler.py index c1cdee7b2..cc9498f34 100644 --- a/flusher/flusher/handler.py +++ b/flusher/flusher/handler.py @@ -59,7 +59,7 @@ ) from .restake_db import restake_vaults, restake_locks, restake_historical_stakes from .bandtss_db import ( - bandtss_current_groups, + bandtss_historical_current_groups, bandtss_members, bandtss_signings, bandtss_group_transitions, @@ -932,7 +932,7 @@ def handle_new_bandtss_current_group(self, msg): if proposal_id is not None: msg["proposal_id"] = proposal_id - self.conn.execute(bandtss_current_groups.insert(), msg) + self.conn.execute(bandtss_historical_current_groups.insert(), msg) def handle_set_bandtss_member(self, msg): msg["account_id"] = self.get_account_id(msg["address"]) diff --git a/grogu/signaller/signaller_test.go b/grogu/signaller/signaller_test.go index 8615ba0a6..c9bf46efd 100644 --- a/grogu/signaller/signaller_test.go +++ b/grogu/signaller/signaller_test.go @@ -188,9 +188,14 @@ func (s *SignallerTestSuite) TestGetAllSignalIDs() { // Update internal variables s.TestUpdateInternalVariables() + expectedSignalIDs := []string{"signal1", "signal2"} + signalIDs = s.Signaller.getAllSignalIDs() s.Require().NotEmpty(signalIDs) - s.Require().Equal("signal1", signalIDs[0]) + + // sort signalIDs to compare + sort.Strings(signalIDs) + s.Require().Equal(expectedSignalIDs, signalIDs) } func (s *SignallerTestSuite) TestGetNonPendingSignalIDs() { diff --git a/hooks/emitter/bandtss.go b/hooks/emitter/bandtss.go index d6e935686..e4dc8f765 100644 --- a/hooks/emitter/bandtss.go +++ b/hooks/emitter/bandtss.go @@ -113,8 +113,8 @@ func (h *Hook) handleBandtssMsgActivate(ctx sdk.Context, msg *types.MsgActivate) h.handleBandtssUpdateMember(ctx, acc, msg.GroupID) } -// handleBandtssEventInactiveStatuses implements emitter handler for inactive status event. -func (h *Hook) handleBandtssEventInactiveStatuses(ctx sdk.Context, evMap common.EvMap) { +// handleBandtssEventInactiveStatus implements emitter handler for inactive status event. +func (h *Hook) handleBandtssEventInactiveStatus(ctx sdk.Context, evMap common.EvMap) { addresses := evMap[types.EventTypeInactiveStatus+"."+types.AttributeKeyAddress] groupIDs := evMap[types.EventTypeInactiveStatus+"."+types.AttributeKeyGroupID] if len(addresses) != len(groupIDs) { diff --git a/hooks/emitter/handler.go b/hooks/emitter/handler.go index edfe8cedc..574b094cc 100644 --- a/hooks/emitter/handler.go +++ b/hooks/emitter/handler.go @@ -224,7 +224,7 @@ func (h *Hook) handleBeginBlockEndBlockEvent( evMap := parseEvents([]abci.Event{event}) switch event.Type { case bandtsstypes.EventTypeInactiveStatus: - h.handleBandtssEventInactiveStatuses(ctx, evMap) + h.handleBandtssEventInactiveStatus(ctx, evMap) case bandtsstypes.EventTypeGroupTransition: h.handleBandtssEventGroupTransition(ctx, eventIdx, eventQuerier) case bandtsstypes.EventTypeGroupTransitionSuccess: