good morning!!!!

Skip to content
Snippets Groups Projects
Commit 3c58aa10 authored by alex.sharov's avatar alex.sharov
Browse files

fix merge conflict

parent 17abe11c
No related branches found
No related tags found
No related merge requests found
...@@ -3,11 +3,12 @@ package commands ...@@ -3,11 +3,12 @@ package commands
import ( import (
"context" "context"
"fmt" "fmt"
"testing"
"github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core"
"github.com/ledgerwatch/erigon/internal/ethapi" "github.com/ledgerwatch/erigon/internal/ethapi"
"github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/rpc"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"testing"
"github.com/ledgerwatch/erigon-lib/kv/kvcache" "github.com/ledgerwatch/erigon-lib/kv/kvcache"
"github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest" "github.com/ledgerwatch/erigon/cmd/rpcdaemon/rpcdaemontest"
...@@ -39,7 +40,8 @@ func TestGetTransactionReceiptUnprotected(t *testing.T) { ...@@ -39,7 +40,8 @@ func TestGetTransactionReceiptUnprotected(t *testing.T) {
func TestGetStorageAt_ByBlockNumber_WithRequireCanonicalDefault(t *testing.T) { func TestGetStorageAt_ByBlockNumber_WithRequireCanonicalDefault(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
db := rpcdaemontest.CreateTestKV(t) db := rpcdaemontest.CreateTestKV(t)
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithNumber(0)) result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithNumber(0))
...@@ -54,7 +56,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault(t *testing.T) { ...@@ -54,7 +56,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
m, _, _ := rpcdaemontest.CreateTestSentry(t) m, _, _ := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithHash(m.Genesis.Hash(), false)) result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithHash(m.Genesis.Hash(), false))
...@@ -69,7 +72,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue(t *testing.T) { ...@@ -69,7 +72,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue(t *testing.T) {
assert := assert.New(t) assert := assert.New(t)
m, _, _ := rpcdaemontest.CreateTestSentry(t) m, _, _ := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithHash(m.Genesis.Hash(), true)) result, err := api.GetStorageAt(context.Background(), addr, "0x0", rpc.BlockNumberOrHashWithHash(m.Genesis.Hash(), true))
...@@ -83,7 +87,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue(t *testing.T) { ...@@ -83,7 +87,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue(t *testing.T) {
func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_BlockNotFoundError(t *testing.T) { func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_BlockNotFoundError(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t) m, _, _ := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
offChain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 1, func(i int, block *core.BlockGen) { offChain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 1, func(i int, block *core.BlockGen) {
...@@ -105,7 +110,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_BlockNotFoundError ...@@ -105,7 +110,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_BlockNotFoundError
func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_BlockNotFoundError(t *testing.T) { func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_BlockNotFoundError(t *testing.T) {
m, _, _ := rpcdaemontest.CreateTestSentry(t) m, _, _ := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
offChain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 1, func(i int, block *core.BlockGen) { offChain, err := core.GenerateChain(m.ChainConfig, m.Genesis, m.Engine, m.DB, 1, func(i int, block *core.BlockGen) {
...@@ -128,7 +134,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock( ...@@ -128,7 +134,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(
assert := assert.New(t) assert := assert.New(t)
m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t) m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
orphanedBlock := orphanedChain[0].Blocks[0] orphanedBlock := orphanedChain[0].Blocks[0]
...@@ -144,7 +151,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock( ...@@ -144,7 +151,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(
func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t *testing.T) { func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t *testing.T) {
m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t) m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") addr := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
orphanedBlock := orphanedChain[0].Blocks[0] orphanedBlock := orphanedChain[0].Blocks[0]
...@@ -161,7 +169,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t * ...@@ -161,7 +169,8 @@ func TestGetStorageAt_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t *
func TestCall_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(t *testing.T) { func TestCall_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(t *testing.T) {
m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t) m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
from := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") from := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
to := common.HexToAddress("0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e") to := common.HexToAddress("0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e")
...@@ -185,7 +194,8 @@ func TestCall_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(t *testi ...@@ -185,7 +194,8 @@ func TestCall_ByBlockHash_WithRequireCanonicalDefault_NonCanonicalBlock(t *testi
func TestCall_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t *testing.T) { func TestCall_ByBlockHash_WithRequireCanonicalTrue_NonCanonicalBlock(t *testing.T) {
m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t) m, _, orphanedChain := rpcdaemontest.CreateTestSentry(t)
db := m.DB db := m.DB
api := NewEthAPI(NewBaseApi(nil), db, nil, nil, nil, 5000000) stateCache := kvcache.New(kvcache.DefaultCoherentConfig)
api := NewEthAPI(NewBaseApi(nil, stateCache), db, nil, nil, nil, 5000000)
from := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7") from := common.HexToAddress("0x71562b71999873db5b286df957af199ec94617f7")
to := common.HexToAddress("0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e") to := common.HexToAddress("0x0d3ab14bbad3d99f4203bd7a11acb94882050e7e")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment