-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: test that erigon can be used as a library (#8494)
- Loading branch information
1 parent
3698e7f
commit 35696af
Showing
7 changed files
with
55 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
go.sum |
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,2 @@ | ||
// this is a dummy file needed to exclude this folder from the root folder unit tests suite | ||
// the actual go.mod for the test is generated by test.sh from go.mod.template |
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,9 @@ | ||
module example.com/erigon-ext-test | ||
|
||
go 1.20 | ||
|
||
require github.com/ledgerwatch/erigon $COMMIT_SHA | ||
|
||
replace github.com/ledgerwatch/erigon-lib => github.com/ledgerwatch/erigon/erigon-lib $COMMIT_SHA | ||
|
||
require github.com/ethereum/go-ethereum v1.13.3 |
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,18 @@ | ||
package main | ||
|
||
import ( | ||
geth_params "github.com/ethereum/go-ethereum/params" | ||
// geth_crypto "github.com/ethereum/go-ethereum/crypto" | ||
erigon_lib_common "github.com/ledgerwatch/erigon-lib/common" | ||
erigon_crypto "github.com/ledgerwatch/erigon/crypto" | ||
erigon_params "github.com/ledgerwatch/erigon/params" | ||
) | ||
|
||
func main() { | ||
println("Erigon version: ", erigon_params.Version) | ||
println("geth version: ", geth_params.Version) | ||
println("Erigon lib common eth Wei: ", erigon_lib_common.Wei) | ||
println("Erigon crypto secp256k1 S256 BitSize: ", erigon_crypto.S256().Params().BitSize) | ||
// not working due to duplicate symbols errors | ||
// println("geth crypto secp256k1 S256 BitSize: ", geth_crypto.S256().Params().BitSize) | ||
} |
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,10 @@ | ||
#!/bin/bash | ||
|
||
COMMIT_SHA="$1" | ||
|
||
sed "s/\$COMMIT_SHA/$COMMIT_SHA/" go.mod.template > go.mod | ||
|
||
rm -f go.sum | ||
go mod tidy | ||
|
||
go run main.go |