clean-up a old comment "// legacy behavior is to never return error and always return tx hash"

the same changes in apiv2
pull/3179/head
songgeng87 5 years ago committed by Leo Chen
parent 8c2bd6db56
commit f84d51a47e
  1. 1
      internal/hmyapi/apiv1/util.go
  2. 3
      internal/hmyapi/apiv2/util.go

@ -36,7 +36,6 @@ func SubmitTransaction(
ctx context.Context, b Backend, tx *types.Transaction, ctx context.Context, b Backend, tx *types.Transaction,
) (common.Hash, error) { ) (common.Hash, error) {
if err := b.SendTx(ctx, tx); err != nil { if err := b.SendTx(ctx, tx); err != nil {
// legacy behavior is to never return error and always return tx hash
utils.Logger().Warn().Err(err).Msg("Could not submit transaction") utils.Logger().Warn().Err(err).Msg("Could not submit transaction")
return tx.Hash(), err return tx.Hash(), err
} }

@ -36,9 +36,8 @@ func SubmitTransaction(
ctx context.Context, b Backend, tx *types.Transaction, ctx context.Context, b Backend, tx *types.Transaction,
) (common.Hash, error) { ) (common.Hash, error) {
if err := b.SendTx(ctx, tx); err != nil { if err := b.SendTx(ctx, tx); err != nil {
// legacy behavior is to never return error and always return tx hash
utils.Logger().Warn().Err(err).Msg("Could not submit transaction") utils.Logger().Warn().Err(err).Msg("Could not submit transaction")
return tx.Hash(), nil return tx.Hash(), err
} }
if tx.To() == nil { if tx.To() == nil {
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Epoch()) signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Epoch())

Loading…
Cancel
Save