-
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
- Loading branch information
1 parent
9e42b70
commit e6c52e1
Showing
6 changed files
with
54 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,2 @@ | ||
go.mod | ||
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,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" | ||
Check failure on line 4 in tests/erigon-ext-test/main.go GitHub Actions / tests-windows (windows-2022)
|
||
// 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 |