Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikbratashchuk committed Nov 1, 2024
1 parent 2dbff67 commit 86e0a94
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
16 changes: 8 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,14 @@ func New(
}
app.contractConfig = contractConfig

go func() {
time.Sleep(10 * time.Second)
// Deploy contracts
err := app.DeployContracts()
if err != nil {
app.Logger().Error("failed to deploy contracts", "err", err)
}
}()
//go func() {
time.Sleep(10 * time.Second)
// Deploy contracts
err := app.DeployContracts()
if err != nil {
app.Logger().Error("failed to deploy contracts", "err", err)
}
//}()

return app.App.InitChainer(ctx, req)
}))
Expand Down
15 changes: 11 additions & 4 deletions app/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,13 @@ func (app *App) deployBetToken(
}

// Wait for deployment to complete
_, err = bind.WaitMined(context.Background(), client, tx)
receipt, err := bind.WaitMined(context.Background(), client, tx)
if err != nil {
return common.Address{}, err
}

app.Logger().Info("Deployed BetToken contract", "receipt", receipt)

return address, nil
}

Expand Down Expand Up @@ -385,13 +387,16 @@ func (app *App) deployPredictionMarket(
}

app.Logger().Info("Setting oracle address for prediction market contract", "oracle", oracleAddress.String())
app.Logger().Info("Setting oracle address for prediction market contract", "tx", tx)

// Wait for oracle setup to complete
_, err = bind.WaitMined(context.Background(), client, tx)
receipt, err := bind.WaitMined(context.Background(), client, tx)
if err != nil {
return common.Address{}, nil, err
}

app.Logger().Info("Set oracle address for prediction market contract", "receipt", receipt)

// Create auth for deployment
auth, err = createEthereumAuth(client, config.DeployerPrivateKey)
if err != nil {
Expand All @@ -403,13 +408,15 @@ func (app *App) deployPredictionMarket(
return common.Address{}, nil, err
}

app.Logger().Info("Creating market", "description", "WILL_BERNIE_SANDERS_WIN_THE_2024_US_PRESIDENTIAL_ELECTION?YES/USD", "tx", tx)

// Wait for market creation to complete
_, err = bind.WaitMined(context.Background(), client, tx)
receipt, err = bind.WaitMined(context.Background(), client, tx)
if err != nil {
return common.Address{}, nil, err
}

app.Logger().Info("Created market", "description", "WILL_BERNIE_SANDERS_WIN_THE_2024_US_PRESIDENTIAL_ELECTION?YES/USD")
app.Logger().Info("Created market", "description", "WILL_BERNIE_SANDERS_WIN_THE_2024_US_PRESIDENTIAL_ELECTION?YES/USD", "receipt", receipt, "logs", receipt.Logs)

return address, instance, nil
}
Expand Down
Loading

0 comments on commit 86e0a94

Please sign in to comment.