-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
problem: full block returns transactions in different order
fix: #82
- Loading branch information
Showing
7 changed files
with
135 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: v1 | ||
port: 12448 | ||
|
||
tls: | ||
enabled: false | ||
|
||
cluster: | ||
upstreams: | ||
- id: eth-1 | ||
chain: ethereum | ||
connection: | ||
ethereum: | ||
rpc: | ||
url: "${DSHACKLE_TEST_ETH1_RPC}" | ||
ws: | ||
url: "${DSHACKLE_TEST_ETH1_WS}" | ||
origin: "${DSHACKLE_TEST_ETH1_WSORIGIN}" | ||
|
||
cache: | ||
redis: | ||
enabled: false | ||
|
||
proxy: | ||
port: 18081 | ||
tls: | ||
enabled: false | ||
routes: | ||
- id: eth | ||
blockchain: ethereum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
.../trial/src/test/groovy/io/emeraldpay/dshackle/testing/trial/proxy/GetBlockRealSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.emeraldpay.dshackle.testing.trial.proxy | ||
|
||
import io.emeraldpay.dshackle.testing.trial.Debugger | ||
import io.emeraldpay.dshackle.testing.trial.ProxyClient | ||
import spock.lang.Specification | ||
import spock.lang.Timeout | ||
|
||
class GetBlockRealSpec extends Specification { | ||
|
||
def client = ProxyClient.ethereumReal() | ||
|
||
def setup() { | ||
Debugger.enabled = false | ||
} | ||
|
||
def cleanup() { | ||
Debugger.enabled = true | ||
} | ||
|
||
@Timeout(15) | ||
def "Correct order for transactions on #height"() { | ||
expect: | ||
def results = [ | ||
(client.execute("eth_getBlockByNumber", ["0x" + Integer.toString(height, 16), false]).result["transactions"] as List<String>), | ||
(client.execute("eth_getBlockByNumber", ["0x" + Integer.toString(height, 16), true]).result["transactions"] as List<Map<String, Object>>) | ||
.collect { it.hash } | ||
] | ||
|
||
println(results[0]) | ||
println(results[1]) | ||
|
||
results[0] == results[1] | ||
|
||
where: | ||
height << (10_000_000..10_000_500) | ||
|
||
} | ||
} |