Skip to content
New issue

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

FIX: Add back subscribed events for outgoing operations #5865

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/sovereignnode/config/sovereignConfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
# Time to wait in seconds for outgoing operations that need to be bridged from sovereign chain to main chain.
# If no confirmation of bridged data is received after this time, next leader should retry sending data.
TimeToWaitForUnconfirmedOutGoingOperationInSeconds = 30

SubscribedEvents = [
{ Identifier = "deposit", Addresses = ["erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"] }
]

[OutGoingBridge]
GRPCHost = "localhost"
Expand Down
3 changes: 2 additions & 1 deletion config/sovereignConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ type SovereignConfig struct {

// OutgoingSubscribedEvents holds config for outgoing subscribed events
type OutgoingSubscribedEvents struct {
TimeToWaitForUnconfirmedOutGoingOperationInSeconds uint32 `toml:"TimeToWaitForUnconfirmedOutGoingOperationInSeconds"`
TimeToWaitForUnconfirmedOutGoingOperationInSeconds uint32 `toml:"TimeToWaitForUnconfirmedOutGoingOperationInSeconds"`
SubscribedEvents []SubscribedEvent `toml:"SubscribedEvents"`
}

// MainChainNotarization defines necessary data to start main chain notarization on a sovereign shard
Expand Down
2 changes: 1 addition & 1 deletion factory/processing/blockProcessorCreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ func (pcf *processComponentsFactory) createBlockProcessor(
// TODO: Radu Chis: move this in the factory of the sovereign block processor once the refactor is completed

outgoingOpFormatter, errOpFormatter := sovereign.CreateOutgoingOperationsFormatter(
pcf.config.SovereignConfig.NotifierConfig.SubscribedEvents,
pcf.config.SovereignConfig.OutgoingSubscribedEvents.SubscribedEvents,
pcf.coreData.AddressPubKeyConverter(),
pcf.coreData.RoundHandler(),
)
Expand Down
8 changes: 8 additions & 0 deletions testscommon/components/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ func GetGeneralConfig() config.Config {
},
},
},
OutgoingSubscribedEvents: config.OutgoingSubscribedEvents{
SubscribedEvents: []config.SubscribedEvent{
{
Identifier: "bridgeOps",
Addresses: []string{"erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"},
},
},
},
},
}
}
Expand Down
8 changes: 8 additions & 0 deletions testscommon/generalConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,14 @@ func GetGeneralConfig() config.Config {
},
},
},
OutgoingSubscribedEvents: config.OutgoingSubscribedEvents{
SubscribedEvents: []config.SubscribedEvent{
{
Identifier: "bridgeOps",
Addresses: []string{"erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"},
},
},
},
},
}
}
Expand Down