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

return error info if shard does not match #3169

Merged
merged 5 commits into from
Jun 20, 2020
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
3 changes: 1 addition & 2 deletions internal/hmyapi/apiv1/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ func SubmitTransaction(
ctx context.Context, b Backend, tx *types.Transaction,
) (common.Hash, error) {
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")
return tx.Hash(), nil
return tx.Hash(), err
}
if tx.To() == nil {
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Epoch())
Expand Down
3 changes: 1 addition & 2 deletions internal/hmyapi/apiv2/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ func SubmitTransaction(
ctx context.Context, b Backend, tx *types.Transaction,
) (common.Hash, error) {
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")
return tx.Hash(), nil
return tx.Hash(), err
}
if tx.To() == nil {
signer := types.MakeSigner(b.ChainConfig(), b.CurrentBlock().Epoch())
Expand Down
2 changes: 1 addition & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (node *Node) AddPendingTransaction(newTx *types.Transaction) error {
}
return err
}
return nil
return errors.New("shard do not match")
}

// AddPendingReceipts adds one receipt message to pending list.
Expand Down