Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Nov 24, 2020
1 parent 0a8ae09 commit de9dd58
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions integration/utils/contLoadGenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ func (lg *ContLoadGenerator) Init() error {
return err
}
}
lg.SetupFavContract()
err := lg.SetupFavContract()
if err != nil {
lg.log.Error().Err(err).Msgf("failed to setup fav contract")
return err
}

return nil
}

Expand All @@ -143,10 +148,6 @@ func (lg *ContLoadGenerator) SetupFavContract() error {

lg.log.Trace().Msgf("creating fav contract deployment script")
deployScript := DeployingMyFavContractScript()
if err != nil {
lg.log.Error().Err(err).Msgf("error creating fav contract deployment script")
return err
}

lg.log.Trace().Msgf("creating fav contract deployment transaction")
deploymentTx := flowsdk.NewTransaction().
Expand All @@ -157,7 +158,7 @@ func (lg *ContLoadGenerator) SetupFavContract() error {
AddAuthorizer(*acc.address)

lg.log.Trace().Msgf("signing transaction")
acc.signTx(deploymentTx, 0)
err = acc.signTx(deploymentTx, 0)
if err != nil {
lg.log.Error().Err(err).Msgf("error signing transaction")
return err
Expand Down Expand Up @@ -394,7 +395,7 @@ func (lg *ContLoadGenerator) sendAddKeyTx(workerID int) {
AddAuthorizer(*acc.address)

lg.log.Trace().Msgf("signing transaction")
acc.signTx(addKeysTx, 0)
err = acc.signTx(addKeysTx, 0)
if err != nil {
lg.log.Error().Err(err).Msgf("error signing transaction")
return
Expand Down Expand Up @@ -438,7 +439,7 @@ func (lg *ContLoadGenerator) sendTokenTransferTx(workerID int) {
AddAuthorizer(*acc.address)

lg.log.Trace().Msgf("signing transaction")
acc.signTx(transferTx, 0)
err = acc.signTx(transferTx, 0)
if err != nil {
lg.log.Error().Err(err).Msgf("error signing transaction")
return
Expand Down Expand Up @@ -480,7 +481,7 @@ func (lg *ContLoadGenerator) sendFavContractTx(workerID int) {
AddAuthorizer(*acc.address)

lg.log.Trace().Msgf("signing transaction")
acc.signTx(tx, 0)
err = acc.signTx(tx, 0)
if err != nil {
lg.log.Error().Err(err).Msgf("error signing transaction")
return
Expand Down

0 comments on commit de9dd58

Please sign in to comment.