Compare commits

..

1 Commits

Author SHA1 Message Date
4b000f9616 Conditionally link against geth's libsecp256k1 2024-03-14 20:33:53 +08:00
13 changed files with 13 additions and 45 deletions

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/consensys/gnark-crypto v0.12.1
github.com/crate-crypto/go-kzg-4844 v0.7.0
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/c-kzg-4844 v0.4.0
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4
github.com/google/gofuzz v1.2.0
github.com/holiman/uint256 v1.2.4
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267

4
go.sum
View File

@ -18,8 +18,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY=
github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 h1:B2mpK+MNqgPqk2/KNi1LbqwtZDy5F7iy0mynQiBr8VA=
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4/go.mod h1:y4GA2JbAUama1S4QwYjC2hefgGLU8Ul0GMtL/ADMF1c=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=

View File

@ -1,31 +0,0 @@
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package rlp
import (
"encoding/hex"
"fmt"
"strings"
)
func unhex(str string) []byte {
b, err := hex.DecodeString(strings.ReplaceAll(str, " ", ""))
if err != nil {
panic(fmt.Sprintf("invalid hex string: %q", str))
}
return b
}

View File

@ -27,7 +27,7 @@ import (
"golang.org/x/tools/go/packages"
)
const pathOfPackageRLP = "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
const pathOfPackageRLP = "github.com/ethereum/go-ethereum/rlp"
func main() {
var (

View File

@ -1,6 +1,6 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -2,7 +2,7 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
type Test struct {
RawValue rlp.RawValue

View File

@ -1,6 +1,6 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,7 +1,7 @@
package test
import "github.com/ethereum/go-ethereum/rlp"
import "github.com/holiman/uint256"
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -1,6 +1,6 @@
package test
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
import "github.com/ethereum/go-ethereum/rlp"
import "io"
func (obj *Test) EncodeRLP(_w io.Writer) error {

View File

@ -64,7 +64,7 @@ func prefixedRlpHash(prefix byte, x interface{}) (h core.Hash) {
// This is internal, do not use.
type TrieHasher interface {
Reset()
Update([]byte, []byte) error
Update([]byte, []byte)
Hash() core.Hash
}

View File

@ -136,10 +136,9 @@ func (d *hashToHumanReadable) Reset() {
d.data = make([]byte, 0)
}
func (d *hashToHumanReadable) Update(i []byte, i2 []byte) error {
func (d *hashToHumanReadable) Update(i []byte, i2 []byte) {
l := fmt.Sprintf("%x %x\n", i, i2)
d.data = append(d.data, []byte(l)...)
return nil
}
func (d *hashToHumanReadable) Hash() core.Hash {