mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
0c91bfbf3e
* clean * save * pubsub * pubsub * pubsub * pubsub * pubsub * pubsub * save * tx pub-sub * tx pub-sub * clean * clean * save * save * save * save * save * Squashed 'interfaces/' content from commit c469f3ae0 git-subtree-dir: interfaces git-subtree-split: c469f3ae073b60c8821b61fed2910191080ef835 * save * save * save * save * Squashed 'interfaces/' changes from c469f3ae0..958dfc669 958dfc669 save git-subtree-dir: interfaces git-subtree-split: 958dfc669f8daeefe686a13aa852fb95f1537886 * save * save * up some deps * up some deps * clean * test * test * test * test * test * test * test * test * test * test * test * test
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package commands
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/common"
|
|
)
|
|
|
|
func TestGetTransactionReceipt(t *testing.T) {
|
|
db, err := createTestKV()
|
|
if err != nil {
|
|
t.Fatalf("create test db: %v", err)
|
|
}
|
|
defer db.Close()
|
|
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000)
|
|
// Call GetTransactionReceipt for transaction which is not in the database
|
|
if _, err := api.GetTransactionReceipt(context.Background(), common.Hash{}); err != nil {
|
|
t.Errorf("calling GetTransactionReceipt with empty hash: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestGetTransactionReceiptUnprotected(t *testing.T) {
|
|
db, err := createTestKV()
|
|
if err != nil {
|
|
t.Fatalf("create test db: %v", err)
|
|
}
|
|
defer db.Close()
|
|
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000)
|
|
// Call GetTransactionReceipt for un-protected transaction
|
|
if _, err := api.GetTransactionReceipt(context.Background(), common.HexToHash("0x3f3cb8a0e13ed2481f97f53f7095b9cbc78b6ffb779f2d3e565146371a8830ea")); err != nil {
|
|
t.Errorf("calling GetTransactionReceipt for unprotected tx: %v", err)
|
|
}
|
|
}
|