good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
a
Erigon
Commits
3c58aa10
Commit
3c58aa10
authored
3 years ago
by
alex.sharov
Browse files
Options
Downloads
Patches
Plain Diff
fix merge conflict
parent
17abe11c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/rpcdaemon/commands/eth_api_test.go
+20
-10
20 additions, 10 deletions
cmd/rpcdaemon/commands/eth_api_test.go
with
20 additions
and
10 deletions
cmd/rpcdaemon/commands/eth_api_test.go
+
20
−
10
View file @
3c58aa10
...
@@ -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"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment