Fix rlp package
This commit is contained in:
parent
2bd23e1f3c
commit
b748b08558
31
restricted/rlp/decode_test.go
Normal file
31
restricted/rlp/decode_test.go
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// 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
|
||||||
|
}
|
@ -27,7 +27,7 @@ import (
|
|||||||
"golang.org/x/tools/go/packages"
|
"golang.org/x/tools/go/packages"
|
||||||
)
|
)
|
||||||
|
|
||||||
const pathOfPackageRLP = "github.com/ethereum/go-ethereum/rlp"
|
const pathOfPackageRLP = "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var (
|
var (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
2
restricted/rlp/rlpgen/testdata/nil.out.txt
vendored
2
restricted/rlp/rlpgen/testdata/nil.out.txt
vendored
@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
|
|
||||||
type Test struct {
|
type Test struct {
|
||||||
RawValue rlp.RawValue
|
RawValue rlp.RawValue
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
|
||||||
import "github.com/holiman/uint256"
|
import "github.com/holiman/uint256"
|
||||||
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
2
restricted/rlp/rlpgen/testdata/uints.out.txt
vendored
2
restricted/rlp/rlpgen/testdata/uints.out.txt
vendored
@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import "github.com/ethereum/go-ethereum/rlp"
|
import "github.com/openrelayxyz/plugeth-utils/restricted/rlp"
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
func (obj *Test) EncodeRLP(_w io.Writer) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user