Set the App Before Initializing The App Over the Connection... #41
|
@ -40,13 +40,17 @@ func (appchain *ApplicationChain) NewInstance() tapir.Application {
|
||||||
func (appchain *ApplicationChain) Init(connection tapir.Connection) {
|
func (appchain *ApplicationChain) Init(connection tapir.Connection) {
|
||||||
appchain.TranscriptApp.Init(connection)
|
appchain.TranscriptApp.Init(connection)
|
||||||
for i, app := range appchain.apps {
|
for i, app := range appchain.apps {
|
||||||
|
// propagate the transcript to the app
|
||||||
app.PropagateTranscript(appchain.transcript)
|
app.PropagateTranscript(appchain.transcript)
|
||||||
|
// apply the app to the connection
|
||||||
|
connection.SetApp(app)
|
||||||
|
// initialize the application given the connection
|
||||||
app.Init(connection)
|
app.Init(connection)
|
||||||
|
// if we hit our guard then carry on, otherwise close...
|
||||||
if !connection.HasCapability(appchain.capabilities[i]) {
|
if !connection.HasCapability(appchain.capabilities[i]) {
|
||||||
connection.Close()
|
connection.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
connection.SetApp(app)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue