all: mega format fixes

This commit is contained in:
Péter Szilágyi 2019-04-10 14:05:59 +03:00
parent f0b878d56d
commit d668176dd0
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D
331 changed files with 1471 additions and 1615 deletions

View file

@ -257,7 +257,6 @@ func (arguments Arguments) unpackTuple(v interface{}, marshalledValues []interfa
} }
} }
return nil return nil
} }
// UnpackValues can be used to unpack ABI-encoded hexdata according to the ABI-specification, // UnpackValues can be used to unpack ABI-encoded hexdata according to the ABI-specification,

View file

@ -489,12 +489,15 @@ func (fb *filterBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.
return nil return nil
}) })
} }
func (fb *filterBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription { func (fb *filterBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
return fb.bc.SubscribeChainEvent(ch) return fb.bc.SubscribeChainEvent(ch)
} }
func (fb *filterBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription { func (fb *filterBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
return fb.bc.SubscribeRemovedLogsEvent(ch) return fb.bc.SubscribeRemovedLogsEvent(ch)
} }
func (fb *filterBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription { func (fb *filterBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription {
return fb.bc.SubscribeLogsEvent(ch) return fb.bc.SubscribeLogsEvent(ch)
} }

View file

@ -78,5 +78,4 @@ func TestSimulatedBackend(t *testing.T) {
if isPending { if isPending {
t.Fatal("transaction should not have pending status") t.Fatal("transaction should not have pending status")
} }
} }

View file

@ -47,8 +47,8 @@ func (mc *mockCaller) CallContract(ctx context.Context, call ethereum.CallMsg, b
mc.callContractBlockNumber = blockNumber mc.callContractBlockNumber = blockNumber
return nil, nil return nil, nil
} }
func TestPassingBlockNumber(t *testing.T) {
func TestPassingBlockNumber(t *testing.T) {
mc := &mockCaller{} mc := &mockCaller{}
bc := bind.NewBoundContract(common.HexToAddress("0x0"), abi.ABI{ bc := bind.NewBoundContract(common.HexToAddress("0x0"), abi.ABI{

View file

@ -209,7 +209,6 @@ func bindTypeGo(kind abi.Type) string {
// (Or just the type itself if it is not an array or slice) // (Or just the type itself if it is not an array or slice)
// The length of the matched part is returned, with the translated type. // The length of the matched part is returned, with the translated type.
func bindUnnestedTypeGo(stringKind string) (int, string) { func bindUnnestedTypeGo(stringKind string) (int, string) {
switch { switch {
case strings.HasPrefix(stringKind, "address"): case strings.HasPrefix(stringKind, "address"):
return len("address"), "common.Address" return len("address"), "common.Address"
@ -257,7 +256,6 @@ func bindTypeJava(kind abi.Type) string {
// (Or just the type itself if it is not an array or slice) // (Or just the type itself if it is not an array or slice)
// The length of the matched part is returned, with the translated type. // The length of the matched part is returned, with the translated type.
func bindUnnestedTypeJava(stringKind string) (int, string) { func bindUnnestedTypeJava(stringKind string) (int, string) {
switch { switch {
case strings.HasPrefix(stringKind, "address"): case strings.HasPrefix(stringKind, "address"):
parts := regexp.MustCompile(`address(\[[0-9]*\])?`).FindStringSubmatch(stringKind) parts := regexp.MustCompile(`address(\[[0-9]*\])?`).FindStringSubmatch(stringKind)

View file

@ -22,9 +22,7 @@ import (
"reflect" "reflect"
) )
var ( var errBadBool = errors.New("abi: improperly encoded boolean value")
errBadBool = errors.New("abi: improperly encoded boolean value")
)
// formatSliceString formats the reflection kind with the given slice size // formatSliceString formats the reflection kind with the given slice size
// and returns a formatted string representation. // and returns a formatted string representation.
@ -75,7 +73,6 @@ func typeCheck(t Type, value reflect.Value) error {
} else { } else {
return nil return nil
} }
} }
// typeErr returns a formatted type casting error. // typeErr returns a formatted type casting error.

View file

@ -165,7 +165,6 @@ func TestEventMultiValueWithArrayUnpack(t *testing.T) {
} }
func TestEventTupleUnpack(t *testing.T) { func TestEventTupleUnpack(t *testing.T) {
type EventTransfer struct { type EventTransfer struct {
Value *big.Int Value *big.Int
} }
@ -269,7 +268,8 @@ func TestEventTupleUnpack(t *testing.T) {
&EventPledge{ &EventPledge{
addr, addr,
bigintExpected2, bigintExpected2,
[3]byte{'u', 's', 'd'}}, [3]byte{'u', 's', 'd'},
},
jsonEventPledge, jsonEventPledge,
"", "",
"Can unpack Pledge event into structure", "Can unpack Pledge event into structure",
@ -279,7 +279,8 @@ func TestEventTupleUnpack(t *testing.T) {
&[]interface{}{ &[]interface{}{
&addr, &addr,
&bigintExpected2, &bigintExpected2,
&[3]byte{'u', 's', 'd'}}, &[3]byte{'u', 's', 'd'},
},
jsonEventPledge, jsonEventPledge,
"", "",
"Can unpack Pledge event into slice", "Can unpack Pledge event into slice",
@ -289,7 +290,8 @@ func TestEventTupleUnpack(t *testing.T) {
&[3]interface{}{ &[3]interface{}{
&addr, &addr,
&bigintExpected2, &bigintExpected2,
&[3]byte{'u', 's', 'd'}}, &[3]byte{'u', 's', 'd'},
},
jsonEventPledge, jsonEventPledge,
"", "",
"Can unpack Pledge event into an array", "Can unpack Pledge event into an array",

View file

@ -77,5 +77,4 @@ func packNum(value reflect.Value) []byte {
default: default:
panic("abi: fatal error") panic("abi: fatal error")
} }
} }

View file

@ -530,7 +530,8 @@ func TestPack(t *testing.T) {
FieldA *big.Int `abi:"a"` // Test whether abi tag works for nested tuple FieldA *big.Int `abi:"a"` // Test whether abi tag works for nested tuple
B []*big.Int B []*big.Int
}{big.NewInt(1), []*big.Int{big.NewInt(1), big.NewInt(0)}}, }{big.NewInt(1), []*big.Int{big.NewInt(1), big.NewInt(0)}},
B: []*big.Int{big.NewInt(1), big.NewInt(0)}}, B: []*big.Int{big.NewInt(1), big.NewInt(0)},
},
common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000040" + // a offset common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000040" + // a offset
"00000000000000000000000000000000000000000000000000000000000000e0" + // b offset "00000000000000000000000000000000000000000000000000000000000000e0" + // b offset
"0000000000000000000000000000000000000000000000000000000000000001" + // a.a value "0000000000000000000000000000000000000000000000000000000000000001" + // a.a value

View file

@ -112,7 +112,6 @@ func requireAssignable(dst, src reflect.Value) error {
// requireUnpackKind verifies preconditions for unpacking `args` into `kind` // requireUnpackKind verifies preconditions for unpacking `args` into `kind`
func requireUnpackKind(v reflect.Value, t reflect.Type, k reflect.Kind, func requireUnpackKind(v reflect.Value, t reflect.Type, k reflect.Kind,
args Arguments) error { args Arguments) error {
switch k { switch k {
case reflect.Struct: case reflect.Struct:
case reflect.Slice, reflect.Array: case reflect.Slice, reflect.Array:

View file

@ -57,10 +57,8 @@ type Type struct {
TupleRawNames []string // Raw field name of all tuple fields TupleRawNames []string // Raw field name of all tuple fields
} }
var (
// typeRegex parses the abi sub types // typeRegex parses the abi sub types
typeRegex = regexp.MustCompile("([a-zA-Z]+)(([0-9]+)(x([0-9]+))?)?") var typeRegex = regexp.MustCompile("([a-zA-Z]+)(([0-9]+)(x([0-9]+))?)?")
)
// NewType creates a new reflection type of abi type given in t. // NewType creates a new reflection type of abi type given in t.
func NewType(t string, components []ArgumentMarshaling) (typ Type, err error) { func NewType(t string, components []ArgumentMarshaling) (typ Type, err error) {

View file

@ -95,14 +95,18 @@ func TestTypeRegexp(t *testing.T) {
// {"fixed[2]", nil, Type{}}, // {"fixed[2]", nil, Type{}},
// {"fixed128x128[]", nil, Type{}}, // {"fixed128x128[]", nil, Type{}},
// {"fixed128x128[2]", nil, Type{}}, // {"fixed128x128[2]", nil, Type{}},
{"tuple", []ArgumentMarshaling{{Name: "a", Type: "int64"}}, Type{Kind: reflect.Struct, T: TupleTy, Type: reflect.TypeOf(struct { {"tuple", []ArgumentMarshaling{{Name: "a", Type: "int64"}}, Type{
Kind: reflect.Struct, T: TupleTy, Type: reflect.TypeOf(struct {
A int64 `json:"a"` A int64 `json:"a"`
}{}), stringKind: "(int64)", }{}), stringKind: "(int64)",
TupleElems: []*Type{{Kind: reflect.Int64, T: IntTy, Type: reflect.TypeOf(int64(0)), Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"a"}}}, TupleElems: []*Type{{Kind: reflect.Int64, T: IntTy, Type: reflect.TypeOf(int64(0)), Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"a"},
{"tuple with long name", []ArgumentMarshaling{{Name: "aTypicalParamName", Type: "int64"}}, Type{Kind: reflect.Struct, T: TupleTy, Type: reflect.TypeOf(struct { }},
{"tuple with long name", []ArgumentMarshaling{{Name: "aTypicalParamName", Type: "int64"}}, Type{
Kind: reflect.Struct, T: TupleTy, Type: reflect.TypeOf(struct {
ATypicalParamName int64 `json:"aTypicalParamName"` ATypicalParamName int64 `json:"aTypicalParamName"`
}{}), stringKind: "(int64)", }{}), stringKind: "(int64)",
TupleElems: []*Type{{Kind: reflect.Int64, T: IntTy, Type: reflect.TypeOf(int64(0)), Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"aTypicalParamName"}}}, TupleElems: []*Type{{Kind: reflect.Int64, T: IntTy, Type: reflect.TypeOf(int64(0)), Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"aTypicalParamName"},
}},
} }
for _, tt := range tests { for _, tt := range tests {

View file

@ -112,7 +112,6 @@ func readFixedBytes(t Type, word []byte) (interface{}, error) {
reflect.Copy(array, reflect.ValueOf(word[0:t.Size])) reflect.Copy(array, reflect.ValueOf(word[0:t.Size]))
return array.Interface(), nil return array.Interface(), nil
} }
// iteratively unpack elements // iteratively unpack elements

View file

@ -207,6 +207,7 @@ func (api *ExternalSigner) SignTextWithPassphrase(account accounts.Account, pass
func (api *ExternalSigner) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) { func (api *ExternalSigner) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
return nil, fmt.Errorf("passphrase-operations not supported on external signers") return nil, fmt.Errorf("passphrase-operations not supported on external signers")
} }
func (api *ExternalSigner) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) { func (api *ExternalSigner) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) {
return nil, fmt.Errorf("passphrase-operations not supported on external signers") return nil, fmt.Errorf("passphrase-operations not supported on external signers")
} }

View file

@ -35,9 +35,7 @@ import (
"github.com/pborman/uuid" "github.com/pborman/uuid"
) )
const ( const version = 3
version = 3
)
type Key struct { type Key struct {
Id uuid.UUID // Version 4 "random" for unique id not derived from key data Id uuid.UUID // Version 4 "random" for unique id not derived from key data

View file

@ -137,7 +137,6 @@ func (ks keyStorePassphrase) JoinPath(filename string) string {
// Encryptdata encrypts the data given as 'data' with the password 'auth'. // Encryptdata encrypts the data given as 'data' with the password 'auth'.
func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error) { func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error) {
salt := make([]byte, 32) salt := make([]byte, 32)
if _, err := io.ReadFull(rand.Reader, salt); err != nil { if _, err := io.ReadFull(rand.Reader, salt); err != nil {
panic("reading from crypto/rand failed: " + err.Error()) panic("reading from crypto/rand failed: " + err.Error())

View file

@ -16,9 +16,7 @@
package accounts package accounts
import ( import "testing"
"testing"
)
func TestURLParsing(t *testing.T) { func TestURLParsing(t *testing.T) {
url, err := parseURL("https://ethereum.org") url, err := parseURL("https://ethereum.org")

View file

@ -167,6 +167,7 @@ var MessageType_name = map[int32]string{
112: "MessageType_DebugLinkMemoryWrite", 112: "MessageType_DebugLinkMemoryWrite",
113: "MessageType_DebugLinkFlashErase", 113: "MessageType_DebugLinkFlashErase",
} }
var MessageType_value = map[string]int32{ var MessageType_value = map[string]int32{
"MessageType_Initialize": 0, "MessageType_Initialize": 0,
"MessageType_Ping": 1, "MessageType_Ping": 1,
@ -248,9 +249,11 @@ func (x MessageType) Enum() *MessageType {
*p = x *p = x
return p return p
} }
func (x MessageType) String() string { func (x MessageType) String() string {
return proto.EnumName(MessageType_name, int32(x)) return proto.EnumName(MessageType_name, int32(x))
} }
func (x *MessageType) UnmarshalJSON(data []byte) error { func (x *MessageType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType") value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType")
if err != nil { if err != nil {

View file

@ -146,6 +146,7 @@ var FailureType_name = map[int32]string{
11: "Failure_NotInitialized", 11: "Failure_NotInitialized",
99: "Failure_FirmwareError", 99: "Failure_FirmwareError",
} }
var FailureType_value = map[string]int32{ var FailureType_value = map[string]int32{
"Failure_UnexpectedMessage": 1, "Failure_UnexpectedMessage": 1,
"Failure_ButtonExpected": 2, "Failure_ButtonExpected": 2,
@ -166,9 +167,11 @@ func (x FailureType) Enum() *FailureType {
*p = x *p = x
return p return p
} }
func (x FailureType) String() string { func (x FailureType) String() string {
return proto.EnumName(FailureType_name, int32(x)) return proto.EnumName(FailureType_name, int32(x))
} }
func (x *FailureType) UnmarshalJSON(data []byte) error { func (x *FailureType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(FailureType_value, data, "FailureType") value, err := proto.UnmarshalJSONEnum(FailureType_value, data, "FailureType")
if err != nil { if err != nil {
@ -201,6 +204,7 @@ var OutputScriptType_name = map[int32]string{
4: "PAYTOWITNESS", 4: "PAYTOWITNESS",
5: "PAYTOP2SHWITNESS", 5: "PAYTOP2SHWITNESS",
} }
var OutputScriptType_value = map[string]int32{ var OutputScriptType_value = map[string]int32{
"PAYTOADDRESS": 0, "PAYTOADDRESS": 0,
"PAYTOSCRIPTHASH": 1, "PAYTOSCRIPTHASH": 1,
@ -215,9 +219,11 @@ func (x OutputScriptType) Enum() *OutputScriptType {
*p = x *p = x
return p return p
} }
func (x OutputScriptType) String() string { func (x OutputScriptType) String() string {
return proto.EnumName(OutputScriptType_name, int32(x)) return proto.EnumName(OutputScriptType_name, int32(x))
} }
func (x *OutputScriptType) UnmarshalJSON(data []byte) error { func (x *OutputScriptType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(OutputScriptType_value, data, "OutputScriptType") value, err := proto.UnmarshalJSONEnum(OutputScriptType_value, data, "OutputScriptType")
if err != nil { if err != nil {
@ -248,6 +254,7 @@ var InputScriptType_name = map[int32]string{
3: "SPENDWITNESS", 3: "SPENDWITNESS",
4: "SPENDP2SHWITNESS", 4: "SPENDP2SHWITNESS",
} }
var InputScriptType_value = map[string]int32{ var InputScriptType_value = map[string]int32{
"SPENDADDRESS": 0, "SPENDADDRESS": 0,
"SPENDMULTISIG": 1, "SPENDMULTISIG": 1,
@ -261,9 +268,11 @@ func (x InputScriptType) Enum() *InputScriptType {
*p = x *p = x
return p return p
} }
func (x InputScriptType) String() string { func (x InputScriptType) String() string {
return proto.EnumName(InputScriptType_name, int32(x)) return proto.EnumName(InputScriptType_name, int32(x))
} }
func (x *InputScriptType) UnmarshalJSON(data []byte) error { func (x *InputScriptType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(InputScriptType_value, data, "InputScriptType") value, err := proto.UnmarshalJSONEnum(InputScriptType_value, data, "InputScriptType")
if err != nil { if err != nil {
@ -294,6 +303,7 @@ var RequestType_name = map[int32]string{
3: "TXFINISHED", 3: "TXFINISHED",
4: "TXEXTRADATA", 4: "TXEXTRADATA",
} }
var RequestType_value = map[string]int32{ var RequestType_value = map[string]int32{
"TXINPUT": 0, "TXINPUT": 0,
"TXOUTPUT": 1, "TXOUTPUT": 1,
@ -307,9 +317,11 @@ func (x RequestType) Enum() *RequestType {
*p = x *p = x
return p return p
} }
func (x RequestType) String() string { func (x RequestType) String() string {
return proto.EnumName(RequestType_name, int32(x)) return proto.EnumName(RequestType_name, int32(x))
} }
func (x *RequestType) UnmarshalJSON(data []byte) error { func (x *RequestType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(RequestType_value, data, "RequestType") value, err := proto.UnmarshalJSONEnum(RequestType_value, data, "RequestType")
if err != nil { if err != nil {
@ -352,6 +364,7 @@ var ButtonRequestType_name = map[int32]string{
10: "ButtonRequest_Address", 10: "ButtonRequest_Address",
11: "ButtonRequest_PublicKey", 11: "ButtonRequest_PublicKey",
} }
var ButtonRequestType_value = map[string]int32{ var ButtonRequestType_value = map[string]int32{
"ButtonRequest_Other": 1, "ButtonRequest_Other": 1,
"ButtonRequest_FeeOverThreshold": 2, "ButtonRequest_FeeOverThreshold": 2,
@ -371,9 +384,11 @@ func (x ButtonRequestType) Enum() *ButtonRequestType {
*p = x *p = x
return p return p
} }
func (x ButtonRequestType) String() string { func (x ButtonRequestType) String() string {
return proto.EnumName(ButtonRequestType_name, int32(x)) return proto.EnumName(ButtonRequestType_name, int32(x))
} }
func (x *ButtonRequestType) UnmarshalJSON(data []byte) error { func (x *ButtonRequestType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ButtonRequestType_value, data, "ButtonRequestType") value, err := proto.UnmarshalJSONEnum(ButtonRequestType_value, data, "ButtonRequestType")
if err != nil { if err != nil {
@ -400,6 +415,7 @@ var PinMatrixRequestType_name = map[int32]string{
2: "PinMatrixRequestType_NewFirst", 2: "PinMatrixRequestType_NewFirst",
3: "PinMatrixRequestType_NewSecond", 3: "PinMatrixRequestType_NewSecond",
} }
var PinMatrixRequestType_value = map[string]int32{ var PinMatrixRequestType_value = map[string]int32{
"PinMatrixRequestType_Current": 1, "PinMatrixRequestType_Current": 1,
"PinMatrixRequestType_NewFirst": 2, "PinMatrixRequestType_NewFirst": 2,
@ -411,9 +427,11 @@ func (x PinMatrixRequestType) Enum() *PinMatrixRequestType {
*p = x *p = x
return p return p
} }
func (x PinMatrixRequestType) String() string { func (x PinMatrixRequestType) String() string {
return proto.EnumName(PinMatrixRequestType_name, int32(x)) return proto.EnumName(PinMatrixRequestType_name, int32(x))
} }
func (x *PinMatrixRequestType) UnmarshalJSON(data []byte) error { func (x *PinMatrixRequestType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(PinMatrixRequestType_value, data, "PinMatrixRequestType") value, err := proto.UnmarshalJSONEnum(PinMatrixRequestType_value, data, "PinMatrixRequestType")
if err != nil { if err != nil {
@ -445,6 +463,7 @@ var RecoveryDeviceType_name = map[int32]string{
0: "RecoveryDeviceType_ScrambledWords", 0: "RecoveryDeviceType_ScrambledWords",
1: "RecoveryDeviceType_Matrix", 1: "RecoveryDeviceType_Matrix",
} }
var RecoveryDeviceType_value = map[string]int32{ var RecoveryDeviceType_value = map[string]int32{
"RecoveryDeviceType_ScrambledWords": 0, "RecoveryDeviceType_ScrambledWords": 0,
"RecoveryDeviceType_Matrix": 1, "RecoveryDeviceType_Matrix": 1,
@ -455,9 +474,11 @@ func (x RecoveryDeviceType) Enum() *RecoveryDeviceType {
*p = x *p = x
return p return p
} }
func (x RecoveryDeviceType) String() string { func (x RecoveryDeviceType) String() string {
return proto.EnumName(RecoveryDeviceType_name, int32(x)) return proto.EnumName(RecoveryDeviceType_name, int32(x))
} }
func (x *RecoveryDeviceType) UnmarshalJSON(data []byte) error { func (x *RecoveryDeviceType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(RecoveryDeviceType_value, data, "RecoveryDeviceType") value, err := proto.UnmarshalJSONEnum(RecoveryDeviceType_value, data, "RecoveryDeviceType")
if err != nil { if err != nil {
@ -484,6 +505,7 @@ var WordRequestType_name = map[int32]string{
1: "WordRequestType_Matrix9", 1: "WordRequestType_Matrix9",
2: "WordRequestType_Matrix6", 2: "WordRequestType_Matrix6",
} }
var WordRequestType_value = map[string]int32{ var WordRequestType_value = map[string]int32{
"WordRequestType_Plain": 0, "WordRequestType_Plain": 0,
"WordRequestType_Matrix9": 1, "WordRequestType_Matrix9": 1,
@ -495,9 +517,11 @@ func (x WordRequestType) Enum() *WordRequestType {
*p = x *p = x
return p return p
} }
func (x WordRequestType) String() string { func (x WordRequestType) String() string {
return proto.EnumName(WordRequestType_name, int32(x)) return proto.EnumName(WordRequestType_name, int32(x))
} }
func (x *WordRequestType) UnmarshalJSON(data []byte) error { func (x *WordRequestType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(WordRequestType_value, data, "WordRequestType") value, err := proto.UnmarshalJSONEnum(WordRequestType_value, data, "WordRequestType")
if err != nil { if err != nil {

View file

@ -1007,9 +1007,9 @@ func newPodMetadata(env build.Environment, archive string) podMetadata {
// Cross compilation // Cross compilation
func doXgo(cmdline []string) { func doXgo(cmdline []string) {
var (
alltools = flag.Bool("alltools", false, `Flag whether we're building all known tools, or only on in particular`) var alltools = flag.Bool("alltools", false, `Flag whether we're building all known tools, or only on in particular`)
)
flag.CommandLine.Parse(cmdline) flag.CommandLine.Parse(cmdline)
env := build.Env() env := build.Env()

View file

@ -176,14 +176,16 @@ Clef that the file is 'safe' to execute.`,
Description: ` Description: `
The setpw command stores a password for a given address (keyfile). If you enter a blank passphrase, it will The setpw command stores a password for a given address (keyfile). If you enter a blank passphrase, it will
remove any stored credential for that address (keyfile) remove any stored credential for that address (keyfile)
`} `,
}
gendocCommand = cli.Command{ gendocCommand = cli.Command{
Action: GenDoc, Action: GenDoc,
Name: "gendoc", Name: "gendoc",
Usage: "Generate documentation about json-rpc format", Usage: "Generate documentation about json-rpc format",
Description: ` Description: `
The gendoc generates example structures of the json-rpc communication types. The gendoc generates example structures of the json-rpc communication types.
`} `,
}
) )
func init() { func init() {
@ -213,8 +215,8 @@ func init() {
} }
app.Action = signer app.Action = signer
app.Commands = []cli.Command{initCommand, attestCommand, setCredentialCommand, gendocCommand} app.Commands = []cli.Command{initCommand, attestCommand, setCredentialCommand, gendocCommand}
} }
func main() { func main() {
if err := app.Run(os.Args); err != nil { if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
@ -281,6 +283,7 @@ NOTE: This file does not contain your accounts. Those need to be backed up separ
`) `)
return nil return nil
} }
func attestFile(ctx *cli.Context) error { func attestFile(ctx *cli.Context) error {
if len(ctx.Args()) < 1 { if len(ctx.Args()) < 1 {
utils.Fatalf("This command requires an argument.") utils.Fatalf("This command requires an argument.")
@ -352,9 +355,9 @@ func signer(c *cli.Context) error {
if err := initialize(c); err != nil { if err := initialize(c); err != nil {
return err return err
} }
var (
ui core.UIClientAPI var ui core.UIClientAPI
)
if c.GlobalBool(stdiouiFlag.Name) { if c.GlobalBool(stdiouiFlag.Name) {
log.Info("Using stdin/stdout as UI-channel") log.Info("Using stdin/stdout as UI-channel")
ui = core.NewStdIOUI() ui = core.NewStdIOUI()
@ -449,7 +452,8 @@ func signer(c *cli.Context) error {
Namespace: "account", Namespace: "account",
Public: true, Public: true,
Service: api, Service: api,
Version: "1.0"}, Version: "1.0",
},
} }
if c.GlobalBool(utils.RPCEnabledFlag.Name) { if c.GlobalBool(utils.RPCEnabledFlag.Name) {
@ -554,6 +558,7 @@ func homeDir() string {
} }
return "" return ""
} }
func readMasterKey(ctx *cli.Context, ui core.UIClientAPI) ([]byte, error) { func readMasterKey(ctx *cli.Context, ui core.UIClientAPI) ([]byte, error) {
var ( var (
file string file string
@ -577,7 +582,8 @@ func readMasterKey(ctx *cli.Context, ui core.UIClientAPI) ([]byte, error) {
resp, err := ui.OnInputRequired(core.UserInputRequest{ resp, err := ui.OnInputRequired(core.UserInputRequest{
Title: "Master Password", Title: "Master Password",
Prompt: "Please enter the password to decrypt the master seed", Prompt: "Please enter the password to decrypt the master seed",
IsPassword: true}) IsPassword: true,
})
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -634,7 +640,6 @@ func confirm(text string) bool {
} }
func testExternalUI(api *core.SignerAPI) { func testExternalUI(api *core.SignerAPI) {
ctx := context.WithValue(context.Background(), "remote", "clef binary") ctx := context.WithValue(context.Background(), "remote", "clef binary")
ctx = context.WithValue(ctx, "scheme", "in-proc") ctx = context.WithValue(ctx, "scheme", "in-proc")
ctx = context.WithValue(ctx, "local", "main") ctx = context.WithValue(ctx, "local", "main")
@ -755,7 +760,6 @@ func testExternalUI(api *core.SignerAPI) {
} }
result := fmt.Sprintf("Tests completed. %d errors:\n%s\n", len(errs), strings.Join(errs, "\n")) result := fmt.Sprintf("Tests completed. %d errors:\n%s\n", len(errs), strings.Join(errs, "\n"))
api.UI.ShowInfo(result) api.UI.ShowInfo(result)
} }
// getPassPhrase retrieves the password associated with clef, either fetched // getPassPhrase retrieves the password associated with clef, either fetched
@ -813,7 +817,6 @@ func decryptSeed(keyjson []byte, auth string) ([]byte, error) {
// GenDoc outputs examples of all structures used in json-rpc communication // GenDoc outputs examples of all structures used in json-rpc communication
func GenDoc(ctx *cli.Context) { func GenDoc(ctx *cli.Context) {
var ( var (
a = common.HexToAddress("0xdeadbeef000000000000000000000000deadbeef") a = common.HexToAddress("0xdeadbeef000000000000000000000000deadbeef")
b = common.HexToAddress("0x1111111122222222222233333333334444444444") b = common.HexToAddress("0x1111111122222222222233333333334444444444")
@ -848,7 +851,8 @@ func GenDoc(ctx *cli.Context) {
ContentType: accounts.MimetypeTextPlain, ContentType: accounts.MimetypeTextPlain,
Rawdata: []byte(msg), Rawdata: []byte(msg),
Message: message, Message: message,
Hash: sighash}) Hash: sighash,
})
} }
{ // Sign plain text response { // Sign plain text response
add("SignDataResponse - approve", "Response to SignDataRequest", add("SignDataResponse - approve", "Response to SignDataRequest",
@ -883,13 +887,15 @@ func GenDoc(ctx *cli.Context) {
GasPrice: hexutil.Big(*big.NewInt(5)), GasPrice: hexutil.Big(*big.NewInt(5)),
Gas: 1000, Gas: 1000,
Input: nil, Input: nil,
}}) },
})
} }
{ // Sign tx response { // Sign tx response
data := hexutil.Bytes([]byte{0x04, 0x03, 0x02, 0x01}) data := hexutil.Bytes([]byte{0x04, 0x03, 0x02, 0x01})
add("SignTxResponse - approve", "Response to request to sign a transaction. This response needs to contain the `transaction`"+ add("SignTxResponse - approve", "Response to request to sign a transaction. This response needs to contain the `transaction`"+
", because the UI is free to make modifications to the transaction.", ", because the UI is free to make modifications to the transaction.",
&core.SignTxResponse{Approved: true, &core.SignTxResponse{
Approved: true,
Transaction: core.SendTxArgs{ Transaction: core.SendTxArgs{
Data: &data, Data: &data,
Nonce: 0x4, Nonce: 0x4,
@ -899,7 +905,8 @@ func GenDoc(ctx *cli.Context) {
GasPrice: hexutil.Big(*big.NewInt(5)), GasPrice: hexutil.Big(*big.NewInt(5)),
Gas: 1000, Gas: 1000,
Input: nil, Input: nil,
}}) },
})
add("SignTxResponse - deny", "Response to SignTxRequest. When denying a request, there's no need to "+ add("SignTxResponse - deny", "Response to SignTxRequest. When denying a request, there's no need to "+
"provide the transaction in return", "provide the transaction in return",
&core.SignTxResponse{}) &core.SignTxResponse{})
@ -939,7 +946,8 @@ func GenDoc(ctx *cli.Context) {
Meta: meta, Meta: meta,
Accounts: []accounts.Account{ Accounts: []accounts.Account{
{a, accounts.URL{Scheme: "keystore", Path: "/path/to/keyfile/a"}}, {a, accounts.URL{Scheme: "keystore", Path: "/path/to/keyfile/a"}},
{b, accounts.URL{Scheme: "keystore", Path: "/path/to/keyfile/b"}}}, {b, accounts.URL{Scheme: "keystore", Path: "/path/to/keyfile/b"}},
},
}) })
add("ListResponse", "Response to list request. The response contains a list of all addresses to show to the caller. "+ add("ListResponse", "Response to list request. The response contains a list of all addresses to show to the caller. "+
@ -948,7 +956,8 @@ func GenDoc(ctx *cli.Context) {
Accounts: []accounts.Account{ Accounts: []accounts.Account{
{common.HexToAddress("0xcowbeef000000cowbeef00000000000000000c0w"), accounts.URL{Path: ".. ignored .."}}, {common.HexToAddress("0xcowbeef000000cowbeef00000000000000000c0w"), accounts.URL{Path: ".. ignored .."}},
{common.HexToAddress("0xffffffffffffffffffffffffffffffffffffffff"), accounts.URL{}}, {common.HexToAddress("0xffffffffffffffffffffffffffffffffffffffff"), accounts.URL{}},
}}) },
})
} }
fmt.Println(`## UI Client interface fmt.Println(`## UI Client interface

View file

@ -24,9 +24,7 @@ import (
"gopkg.in/urfave/cli.v1" "gopkg.in/urfave/cli.v1"
) )
const ( const defaultKeyfileName = "keyfile.json"
defaultKeyfileName = "keyfile.json"
)
// Git SHA1 commit hash of the release (set via linker flags) // Git SHA1 commit hash of the release (set via linker flags)
var gitCommit = "" var gitCommit = ""

View file

@ -84,9 +84,7 @@ var (
logFlag = flag.Int("loglevel", 3, "Log level to use for Ethereum and the faucet") logFlag = flag.Int("loglevel", 3, "Log level to use for Ethereum and the faucet")
) )
var ( var ether = new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)
ether = new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)
)
func main() { func main() {
// Parse the flags and set up the logger to print everything requested // Parse the flags and set up the logger to print everything requested

View file

@ -51,18 +51,23 @@ type bindataFileInfo struct {
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return false
} }
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

View file

@ -43,9 +43,7 @@ import (
cli "gopkg.in/urfave/cli.v1" cli "gopkg.in/urfave/cli.v1"
) )
const ( const clientIdentifier = "geth" // Client identifier to advertise over the network
clientIdentifier = "geth" // Client identifier to advertise over the network
)
var ( var (
// Git SHA1 commit hash of the release (set via linker flags) // Git SHA1 commit hash of the release (set via linker flags)

View file

@ -147,25 +147,41 @@ func newAlethGenesisSpec(network string, genesis *core.Genesis) (*alethGenesisSp
spec.setAccount(address, account) spec.setAccount(address, account)
} }
spec.setPrecompile(1, &alethGenesisSpecBuiltin{Name: "ecrecover", spec.setPrecompile(1, &alethGenesisSpecBuiltin{
Linear: &alethGenesisSpecLinearPricing{Base: 3000}}) Name: "ecrecover",
spec.setPrecompile(2, &alethGenesisSpecBuiltin{Name: "sha256", Linear: &alethGenesisSpecLinearPricing{Base: 3000},
Linear: &alethGenesisSpecLinearPricing{Base: 60, Word: 12}}) })
spec.setPrecompile(3, &alethGenesisSpecBuiltin{Name: "ripemd160", spec.setPrecompile(2, &alethGenesisSpecBuiltin{
Linear: &alethGenesisSpecLinearPricing{Base: 600, Word: 120}}) Name: "sha256",
spec.setPrecompile(4, &alethGenesisSpecBuiltin{Name: "identity", Linear: &alethGenesisSpecLinearPricing{Base: 60, Word: 12},
Linear: &alethGenesisSpecLinearPricing{Base: 15, Word: 3}}) })
spec.setPrecompile(3, &alethGenesisSpecBuiltin{
Name: "ripemd160",
Linear: &alethGenesisSpecLinearPricing{Base: 600, Word: 120},
})
spec.setPrecompile(4, &alethGenesisSpecBuiltin{
Name: "identity",
Linear: &alethGenesisSpecLinearPricing{Base: 15, Word: 3},
})
if genesis.Config.ByzantiumBlock != nil { if genesis.Config.ByzantiumBlock != nil {
spec.setPrecompile(5, &alethGenesisSpecBuiltin{Name: "modexp", spec.setPrecompile(5, &alethGenesisSpecBuiltin{
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64())}) Name: "modexp",
spec.setPrecompile(6, &alethGenesisSpecBuiltin{Name: "alt_bn128_G1_add",
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()), StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()),
Linear: &alethGenesisSpecLinearPricing{Base: 500}}) })
spec.setPrecompile(7, &alethGenesisSpecBuiltin{Name: "alt_bn128_G1_mul", spec.setPrecompile(6, &alethGenesisSpecBuiltin{
Name: "alt_bn128_G1_add",
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()), StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()),
Linear: &alethGenesisSpecLinearPricing{Base: 40000}}) Linear: &alethGenesisSpecLinearPricing{Base: 500},
spec.setPrecompile(8, &alethGenesisSpecBuiltin{Name: "alt_bn128_pairing_product", })
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64())}) spec.setPrecompile(7, &alethGenesisSpecBuiltin{
Name: "alt_bn128_G1_mul",
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()),
Linear: &alethGenesisSpecLinearPricing{Base: 40000},
})
spec.setPrecompile(8, &alethGenesisSpecBuiltin{
Name: "alt_bn128_pairing_product",
StartingBlock: (hexutil.Uint64)(genesis.Config.ByzantiumBlock.Uint64()),
})
} }
return spec, nil return spec, nil
} }
@ -193,7 +209,6 @@ func (spec *alethGenesisSpec) setAccount(address common.Address, account core.Ge
} }
a.Balance = (*math2.HexOrDecimal256)(account.Balance) a.Balance = (*math2.HexOrDecimal256)(account.Balance)
a.Nonce = account.Nonce a.Nonce = account.Nonce
} }
func (spec *alethGenesisSpec) setByzantium(num *big.Int) { func (spec *alethGenesisSpec) setByzantium(num *big.Int) {
@ -385,8 +400,10 @@ func newParityChainSpec(network string, genesis *core.Genesis, bootnodes []strin
Nonce: math2.HexOrDecimal64(account.Nonce), Nonce: math2.HexOrDecimal64(account.Nonce),
} }
} }
spec.setPrecompile(1, &parityChainSpecBuiltin{Name: "ecrecover", spec.setPrecompile(1, &parityChainSpecBuiltin{
Pricing: &parityChainSpecPricing{Linear: &parityChainSpecLinearPricing{Base: 3000}}}) Name: "ecrecover",
Pricing: &parityChainSpecPricing{Linear: &parityChainSpecLinearPricing{Base: 3000}},
})
spec.setPrecompile(2, &parityChainSpecBuiltin{ spec.setPrecompile(2, &parityChainSpecBuiltin{
Name: "sha256", Pricing: &parityChainSpecPricing{Linear: &parityChainSpecLinearPricing{Base: 60, Word: 12}}, Name: "sha256", Pricing: &parityChainSpecPricing{Linear: &parityChainSpecLinearPricing{Base: 60, Word: 12}},

View file

@ -272,7 +272,6 @@ func cmdLineOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Con
} }
return currentConfig return currentConfig
} }
// envVarsOverride overrides the current config with whatver is provided in environment variables // envVarsOverride overrides the current config with whatver is provided in environment variables

View file

@ -142,7 +142,6 @@ func TestConfigCmdLineOverrides(t *testing.T) {
} }
func TestConfigFileOverrides(t *testing.T) { func TestConfigFileOverrides(t *testing.T) {
// assign ports // assign ports
httpPort, err := assignTCPPort() httpPort, err := assignTCPPort()
if err != nil { if err != nil {
@ -354,7 +353,6 @@ func TestConfigEnvVars(t *testing.T) {
} }
func TestConfigCmdLineOverridesFile(t *testing.T) { func TestConfigCmdLineOverridesFile(t *testing.T) {
// assign ports // assign ports
httpPort, err := assignTCPPort() httpPort, err := assignTCPPort()
if err != nil { if err != nil {

View file

@ -136,7 +136,6 @@ func feedCreateManifest(ctx *cli.Context) {
return return
} }
fmt.Println(manifestAddress) // output manifest address to the user in a single line (useful for other commands to pick up) fmt.Println(manifestAddress) // output manifest address to the user in a single line (useful for other commands to pick up)
} }
func feedUpdate(ctx *cli.Context) { func feedUpdate(ctx *cli.Context) {
@ -234,5 +233,4 @@ func feedGetUser(ctx *cli.Context) common.Address {
utils.Fatalf("Cannot read private key. Must specify --user or --bzzaccount") utils.Fatalf("Cannot read private key. Must specify --user or --bzzaccount")
} }
return crypto.PubkeyToAddress(pk.PublicKey) return crypto.PubkeyToAddress(pk.PublicKey)
} }

View file

@ -65,7 +65,8 @@ func TestCLIFeedUpdate(t *testing.T) {
"feed", "update", "feed", "update",
"--topic", topic.Hex(), "--topic", topic.Hex(),
"--name", name, "--name", name,
hexData} hexData,
}
// create an update and expect an exit without errors // create an update and expect an exit without errors
log.Info("updating a feed with 'swarm feed update'") log.Info("updating a feed with 'swarm feed update'")
@ -183,7 +184,8 @@ func TestCLIFeedUpdate(t *testing.T) {
"--bzzaccount", pkFileName, "--bzzaccount", pkFileName,
"feed", "update", "feed", "update",
"--manifest", manifestAddress, "--manifest", manifestAddress,
hexData} hexData,
}
// create an update and expect an error given there is a user mismatch // create an update and expect an error given there is a user mismatch
log.Info("updating a feed with 'swarm feed update'") log.Info("updating a feed with 'swarm feed update'")

View file

@ -222,7 +222,8 @@ func doUploadEmptyDir(t *testing.T, node *testNode) string {
"--bzzapi", node.URL, "--bzzapi", node.URL,
"--recursive", "--recursive",
"up", "up",
tmpDir} tmpDir,
}
log.Info("swarmfs cli test: uploading dir with 'swarm up'") log.Info("swarmfs cli test: uploading dir with 'swarm up'")
up := runSwarm(t, flags...) up := runSwarm(t, flags...)

View file

@ -63,7 +63,8 @@ var hashCommand = cli.Command{
}, },
}, },
}, },
}} },
}
func hash(ctx *cli.Context) { func hash(ctx *cli.Context) {
args := ctx.Args() args := ctx.Args()
@ -85,6 +86,7 @@ func hash(ctx *cli.Context) {
fmt.Printf("%v\n", addr) fmt.Printf("%v\n", addr)
} }
} }
func ensNodeHash(ctx *cli.Context) { func ensNodeHash(ctx *cli.Context) {
args := ctx.Args() args := ctx.Args()
if len(args) < 1 { if len(args) < 1 {
@ -97,6 +99,7 @@ func ensNodeHash(ctx *cli.Context) {
stringHex := hex.EncodeToString(hash[:]) stringHex := hex.EncodeToString(hash[:])
fmt.Println(stringHex) fmt.Println(stringHex)
} }
func encodeEipHash(ctx *cli.Context) { func encodeEipHash(ctx *cli.Context) {
args := ctx.Args() args := ctx.Args()
if len(args) < 1 { if len(args) < 1 {

View file

@ -471,5 +471,4 @@ func setSwarmBootstrapNodes(ctx *cli.Context, cfg *node.Config) {
} }
cfg.P2P.BootstrapNodes = append(cfg.P2P.BootstrapNodes, node) cfg.P2P.BootstrapNodes = append(cfg.P2P.BootstrapNodes, node)
} }
} }

View file

@ -71,6 +71,7 @@ func initCluster(t *testing.T) {
func serverFunc(api *api.API) swarmhttp.TestServer { func serverFunc(api *api.API) swarmhttp.TestServer {
return swarmhttp.NewServer(api, "") return swarmhttp.NewServer(api, "")
} }
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
// check if we have been reexec'd // check if we have been reexec'd
if reexec.Init() { if reexec.Init() {
@ -322,7 +323,6 @@ func existingTestNode(t *testing.T, dir string, bzzaccount string) *testNode {
} }
func newTestNode(t *testing.T, dir string) *testNode { func newTestNode(t *testing.T, dir string) *testNode {
conf, account := getTestAccount(t, dir) conf, account := getTestAccount(t, dir)
ks := keystore.NewKeyStore(path.Join(dir, "keystore"), 1<<18, 1) ks := keystore.NewKeyStore(path.Join(dir, "keystore"), 1<<18, 1)

View file

@ -22,9 +22,7 @@ import (
cli "gopkg.in/urfave/cli.v1" cli "gopkg.in/urfave/cli.v1"
) )
const ( const feedRandomDataLength = 8
feedRandomDataLength = 8
)
func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error { func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error {
errc := make(chan error) errc := make(chan error)
@ -265,7 +263,6 @@ func feedUploadAndSync(c *cli.Context, tuid string) error {
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
for _, host := range hosts { for _, host := range hosts {
// manifest retrieve, topic only // manifest retrieve, topic only
for _, url := range []string{manifestWithTopic, manifestWithSubTopic, manifestWithMergedTopic} { for _, url := range []string{manifestWithTopic, manifestWithSubTopic, manifestWithMergedTopic} {
wg.Add(1) wg.Add(1)
@ -282,7 +279,6 @@ func feedUploadAndSync(c *cli.Context, tuid string) error {
} }
}(url, httpEndpoint(host), ruid) }(url, httpEndpoint(host), ruid)
} }
} }
wg.Wait() wg.Wait()
log.Info("all endpoints synced random file successfully") log.Info("all endpoints synced random file successfully")

View file

@ -32,9 +32,7 @@ import (
cli "gopkg.in/urfave/cli.v1" cli "gopkg.in/urfave/cli.v1"
) )
var ( var gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
)
var ( var (
allhosts string allhosts string
@ -51,7 +49,6 @@ var (
) )
func main() { func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "smoke-test" app.Name = "smoke-test"
app.Usage = "" app.Usage = ""

View file

@ -137,7 +137,6 @@ func TestSnapshotCreate(t *testing.T) {
t.Errorf("got services %v for node %v, want %v", gotServices, i, wantServices) t.Errorf("got services %v for node %v, want %v", gotServices, i, wantServices)
} }
} }
}) })
} }
} }

View file

@ -93,14 +93,16 @@ func testDefault(toEncrypt bool, t *testing.T) {
flags := []string{ flags := []string{
"--bzzapi", cluster.Nodes[0].URL, "--bzzapi", cluster.Nodes[0].URL,
"up", "up",
tmpFileName} tmpFileName,
}
if toEncrypt { if toEncrypt {
hashRegexp = `[a-f\d]{128}` hashRegexp = `[a-f\d]{128}`
flags = []string{ flags = []string{
"--bzzapi", cluster.Nodes[0].URL, "--bzzapi", cluster.Nodes[0].URL,
"up", "up",
"--encrypt", "--encrypt",
tmpFileName} tmpFileName,
}
} }
// upload the file with 'swarm up' and expect a hash // upload the file with 'swarm up' and expect a hash
log.Info(fmt.Sprintf("uploading file with 'swarm up'")) log.Info(fmt.Sprintf("uploading file with 'swarm up'"))
@ -207,7 +209,8 @@ func testRecursive(toEncrypt bool, t *testing.T) {
"--bzzapi", cluster.Nodes[0].URL, "--bzzapi", cluster.Nodes[0].URL,
"--recursive", "--recursive",
"up", "up",
tmpUploadDir} tmpUploadDir,
}
if toEncrypt { if toEncrypt {
hashRegexp = `[a-f\d]{128}` hashRegexp = `[a-f\d]{128}`
flags = []string{ flags = []string{
@ -215,7 +218,8 @@ func testRecursive(toEncrypt bool, t *testing.T) {
"--recursive", "--recursive",
"up", "up",
"--encrypt", "--encrypt",
tmpUploadDir} tmpUploadDir,
}
} }
// upload the file with 'swarm up' and expect a hash // upload the file with 'swarm up' and expect a hash
log.Info(fmt.Sprintf("uploading file with 'swarm up'")) log.Info(fmt.Sprintf("uploading file with 'swarm up'"))

View file

@ -39,9 +39,7 @@ import (
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
) )
const ( const importBatchSize = 2500
importBatchSize = 2500
)
// Fatalf formats a message to standard error and exits the program. // Fatalf formats a message to standard error and exits the program.
// The message is also printed to standard output if standard error // The message is also printed to standard output if standard error

View file

@ -60,8 +60,7 @@ import (
cli "gopkg.in/urfave/cli.v1" cli "gopkg.in/urfave/cli.v1"
) )
var ( var CommandHelpTemplate = `{{.cmd.Name}}{{if .cmd.Subcommands}} command{{end}}{{if .cmd.Flags}} [command options]{{end}} [arguments...]
CommandHelpTemplate = `{{.cmd.Name}}{{if .cmd.Subcommands}} command{{end}}{{if .cmd.Flags}} [command options]{{end}} [arguments...]
{{if .cmd.Description}}{{.cmd.Description}} {{if .cmd.Description}}{{.cmd.Description}}
{{end}}{{if .cmd.Subcommands}} {{end}}{{if .cmd.Subcommands}}
SUBCOMMANDS: SUBCOMMANDS:
@ -71,7 +70,6 @@ SUBCOMMANDS:
{{range $categorized.Flags}}{{"\t"}}{{.}} {{range $categorized.Flags}}{{"\t"}}{{.}}
{{end}} {{end}}
{{end}}{{end}}` {{end}}{{end}}`
)
func init() { func init() {
cli.AppHelpTemplate = `{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...] cli.AppHelpTemplate = `{{.Name}} {{if .Flags}}[global options] {{end}}command{{if .Flags}} [command options]{{end}} [arguments...]

View file

@ -21,8 +21,7 @@ import (
"testing" "testing"
) )
const ( const testSource = `
testSource = `
pragma solidity >0.0.0; pragma solidity >0.0.0;
contract test { contract test {
/// @notice Will multiply ` + "`a`" + ` by 7. /// @notice Will multiply ` + "`a`" + ` by 7.
@ -31,7 +30,6 @@ contract test {
} }
} }
` `
)
func skipWithoutSolc(t *testing.T) { func skipWithoutSolc(t *testing.T) {
if _, err := exec.LookPath("solc"); err != nil { if _, err := exec.LookPath("solc"); err != nil {

View file

@ -171,7 +171,6 @@ func BenchmarkByteAt(b *testing.B) {
} }
func BenchmarkByteAtOld(b *testing.B) { func BenchmarkByteAtOld(b *testing.B) {
bigint := MustParseBig256("0x18F8F8F1000111000110011100222004330052300000000000000000FEFCF3CC") bigint := MustParseBig256("0x18F8F8F1000111000110011100222004330052300000000000000000FEFCF3CC")
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
PaddedBigBytes(bigint, 32) PaddedBigBytes(bigint, 32)
@ -237,6 +236,7 @@ func TestBigEndianByteAt(t *testing.T) {
} }
} }
func TestLittleEndianByteAt(t *testing.T) { func TestLittleEndianByteAt(t *testing.T) {
tests := []struct { tests := []struct {
x string x string

View file

@ -16,9 +16,7 @@
package math package math
import ( import "testing"
"testing"
)
type operation byte type operation byte

View file

@ -2,9 +2,7 @@
package prque package prque
import ( import "container/heap"
"container/heap"
)
// Priority queue data structure. // Priority queue data structure.
type Prque struct { type Prque struct {

View file

@ -16,9 +16,7 @@
package common package common
import ( import "fmt"
"fmt"
)
// StorageSize is a wrapper around a float value that supports user friendly // StorageSize is a wrapper around a float value that supports user friendly
// formatting. // formatting.

View file

@ -16,9 +16,7 @@
package common package common
import ( import "testing"
"testing"
)
func TestStorageSizeString(t *testing.T) { func TestStorageSizeString(t *testing.T) {
tests := []struct { tests := []struct {

View file

@ -153,7 +153,6 @@ func BenchmarkAddressHex(b *testing.B) {
} }
func TestMixedcaseAccount_Address(t *testing.T) { func TestMixedcaseAccount_Address(t *testing.T) {
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md
// Note: 0X{checksum_addr} is not valid according to spec above // Note: 0X{checksum_addr} is not valid according to spec above
@ -190,9 +189,7 @@ func TestMixedcaseAccount_Address(t *testing.T) {
if err := json.Unmarshal([]byte(r), &r2); err == nil { if err := json.Unmarshal([]byte(r), &r2); err == nil {
t.Errorf("Expected failure, input %v", r) t.Errorf("Expected failure, input %v", r)
} }
} }
} }
func TestHash_Scan(t *testing.T) { func TestHash_Scan(t *testing.T) {

View file

@ -814,7 +814,8 @@ var datasetSizes = [maxEpoch]uint64{
18102613376, 18111004544, 18119388544, 18127781248, 18136170368, 18102613376, 18111004544, 18119388544, 18127781248, 18136170368,
18144558976, 18152947328, 18161336192, 18169724288, 18178108544, 18144558976, 18152947328, 18161336192, 18169724288, 18178108544,
18186498944, 18194886784, 18203275648, 18211666048, 18220048768, 18186498944, 18194886784, 18203275648, 18211666048, 18220048768,
18228444544, 18236833408, 18245220736} 18228444544, 18236833408, 18245220736,
}
// cacheSizes is a lookup table for the ethash verification cache size for the // cacheSizes is a lookup table for the ethash verification cache size for the
// first 2048 epochs (i.e. 61440000 blocks). // first 2048 epochs (i.e. 61440000 blocks).
@ -1145,4 +1146,5 @@ var cacheSizes = [maxEpoch]uint64{
282590272, 282720832, 282853184, 282983744, 283115072, 283246144, 282590272, 282720832, 282853184, 282983744, 283115072, 283246144,
283377344, 283508416, 283639744, 283770304, 283901504, 284032576, 283377344, 283508416, 283639744, 283770304, 283901504, 284032576,
284163136, 284294848, 284426176, 284556992, 284687296, 284819264, 284163136, 284294848, 284426176, 284556992, 284687296, 284819264,
284950208, 285081536} 284950208, 285081536,
}

View file

@ -36,10 +36,8 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
const (
// staleThreshold is the maximum depth of the acceptable stale but valid ethash solution. // staleThreshold is the maximum depth of the acceptable stale but valid ethash solution.
staleThreshold = 7 const staleThreshold = 7
)
var ( var (
errNoMiningWork = errors.New("no mining work available yet") errNoMiningWork = errors.New("no mining work available yet")

View file

@ -63,6 +63,7 @@ func (p *hookedPrompter) PromptInput(prompt string) (string, error) {
func (p *hookedPrompter) PromptPassword(prompt string) (string, error) { func (p *hookedPrompter) PromptPassword(prompt string) (string, error) {
return "", errors.New("not implemented") return "", errors.New("not implemented")
} }
func (p *hookedPrompter) PromptConfirm(prompt string) (bool, error) { func (p *hookedPrompter) PromptConfirm(prompt string) (bool, error) {
return false, errors.New("not implemented") return false, errors.New("not implemented")
} }

View file

@ -55,10 +55,8 @@ import (
// * depositing ether to the chequebook // * depositing ether to the chequebook
// * watching incoming ether // * watching incoming ether
var ( var gasToCash = uint64(2000000) // gas cost of a cash transaction using chequebook
gasToCash = uint64(2000000) // gas cost of a cash transaction using chequebook
// gasToDeploy = uint64(3000000) // gasToDeploy = uint64(3000000)
)
// Backend wraps all methods required for chequebook operation. // Backend wraps all methods required for chequebook operation.
type Backend interface { type Backend interface {

View file

@ -105,7 +105,6 @@ func TestIssueAndReceive(t *testing.T) {
if received.Cmp(big.NewInt(43)) != 0 { if received.Cmp(big.NewInt(43)) != 0 {
t.Errorf("expected: %v, got %v", "43", received) t.Errorf("expected: %v, got %v", "43", received)
} }
} }
func TestCheckbookFile(t *testing.T) { func TestCheckbookFile(t *testing.T) {
@ -216,7 +215,6 @@ func TestVerifyErrors(t *testing.T) {
if err == nil { if err == nil {
t.Fatalf("expected incorrect amount error, got none and value %v", received) t.Fatalf("expected incorrect amount error, got none and value %v", received)
} }
} }
func TestDeposit(t *testing.T) { func TestDeposit(t *testing.T) {
@ -355,7 +353,6 @@ func TestDeposit(t *testing.T) {
if chbook.Balance().Cmp(exp) != 0 { if chbook.Balance().Cmp(exp) != 0 {
t.Fatalf("expected balance %v, got %v", exp, chbook.Balance()) t.Fatalf("expected balance %v, got %v", exp, chbook.Balance())
} }
} }
func TestCash(t *testing.T) { func TestCash(t *testing.T) {
@ -483,5 +480,4 @@ func TestCash(t *testing.T) {
t.Fatalf("expected no error, got %v", err) t.Fatalf("expected no error, got %v", err)
} }
backend.Commit() backend.Commit()
} }

View file

@ -180,9 +180,9 @@ func (_Chequebook *ChequebookTransactorRaw) Transact(opts *bind.TransactOpts, me
// //
// Solidity: function sent( address) constant returns(uint256) // Solidity: function sent( address) constant returns(uint256)
func (_Chequebook *ChequebookCaller) Sent(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { func (_Chequebook *ChequebookCaller) Sent(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) {
var (
ret0 = new(*big.Int) var ret0 = new(*big.Int)
)
out := ret0 out := ret0
err := _Chequebook.contract.Call(opts, out, "sent", arg0) err := _Chequebook.contract.Call(opts, out, "sent", arg0)
return *ret0, err return *ret0, err
@ -321,7 +321,6 @@ type ChequebookOverdraft struct {
// //
// Solidity: event Overdraft(deadbeat address) // Solidity: event Overdraft(deadbeat address)
func (_Chequebook *ChequebookFilterer) FilterOverdraft(opts *bind.FilterOpts) (*ChequebookOverdraftIterator, error) { func (_Chequebook *ChequebookFilterer) FilterOverdraft(opts *bind.FilterOpts) (*ChequebookOverdraftIterator, error) {
logs, sub, err := _Chequebook.contract.FilterLogs(opts, "Overdraft") logs, sub, err := _Chequebook.contract.FilterLogs(opts, "Overdraft")
if err != nil { if err != nil {
return nil, err return nil, err
@ -333,7 +332,6 @@ func (_Chequebook *ChequebookFilterer) FilterOverdraft(opts *bind.FilterOpts) (*
// //
// Solidity: event Overdraft(deadbeat address) // Solidity: event Overdraft(deadbeat address)
func (_Chequebook *ChequebookFilterer) WatchOverdraft(opts *bind.WatchOpts, sink chan<- *ChequebookOverdraft) (event.Subscription, error) { func (_Chequebook *ChequebookFilterer) WatchOverdraft(opts *bind.WatchOpts, sink chan<- *ChequebookOverdraft) (event.Subscription, error) {
logs, sub, err := _Chequebook.contract.WatchLogs(opts, "Overdraft") logs, sub, err := _Chequebook.contract.WatchLogs(opts, "Overdraft")
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -64,8 +64,8 @@ func TestEIPSpecCidDecode(t *testing.T) {
if !bytes.Equal(hashBytes, decodedHashBytes) { if !bytes.Equal(hashBytes, decodedHashBytes) {
t.Fatal("should be equal") t.Fatal("should be equal")
} }
} }
func TestManualCidDecode(t *testing.T) { func TestManualCidDecode(t *testing.T) {
// call cid encode method with hash. expect byte slice returned, compare according to spec // call cid encode method with hash. expect byte slice returned, compare according to spec

View file

@ -192,9 +192,9 @@ func (_ENS *ENSTransactorRaw) Transact(opts *bind.TransactOpts, method string, p
// //
// Solidity: function owner(bytes32 node) constant returns(address) // Solidity: function owner(bytes32 node) constant returns(address)
func (_ENS *ENSCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_ENS *ENSCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _ENS.contract.Call(opts, out, "owner", node) err := _ENS.contract.Call(opts, out, "owner", node)
return *ret0, err return *ret0, err
@ -218,9 +218,9 @@ func (_ENS *ENSCallerSession) Owner(node [32]byte) (common.Address, error) {
// //
// Solidity: function resolver(bytes32 node) constant returns(address) // Solidity: function resolver(bytes32 node) constant returns(address)
func (_ENS *ENSCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_ENS *ENSCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _ENS.contract.Call(opts, out, "resolver", node) err := _ENS.contract.Call(opts, out, "resolver", node)
return *ret0, err return *ret0, err
@ -244,9 +244,9 @@ func (_ENS *ENSCallerSession) Resolver(node [32]byte) (common.Address, error) {
// //
// Solidity: function ttl(bytes32 node) constant returns(uint64) // Solidity: function ttl(bytes32 node) constant returns(uint64)
func (_ENS *ENSCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) { func (_ENS *ENSCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) {
var (
ret0 = new(uint64) var ret0 = new(uint64)
)
out := ret0 out := ret0
err := _ENS.contract.Call(opts, out, "ttl", node) err := _ENS.contract.Call(opts, out, "ttl", node)
return *ret0, err return *ret0, err
@ -429,7 +429,6 @@ type ENSNewOwner struct {
// //
// Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner) // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSNewOwnerIterator, error) { func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSNewOwnerIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -450,7 +449,6 @@ func (_ENS *ENSFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte,
// //
// Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner) // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
func (_ENS *ENSFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) { func (_ENS *ENSFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -570,7 +568,6 @@ type ENSNewResolver struct {
// //
// Solidity: event NewResolver(bytes32 indexed node, address resolver) // Solidity: event NewResolver(bytes32 indexed node, address resolver)
func (_ENS *ENSFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSNewResolverIterator, error) { func (_ENS *ENSFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSNewResolverIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -587,7 +584,6 @@ func (_ENS *ENSFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byt
// //
// Solidity: event NewResolver(bytes32 indexed node, address resolver) // Solidity: event NewResolver(bytes32 indexed node, address resolver)
func (_ENS *ENSFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSNewResolver, node [][32]byte) (event.Subscription, error) { func (_ENS *ENSFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSNewResolver, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -703,7 +699,6 @@ type ENSNewTTL struct {
// //
// Solidity: event NewTTL(bytes32 indexed node, uint64 ttl) // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
func (_ENS *ENSFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSNewTTLIterator, error) { func (_ENS *ENSFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSNewTTLIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -720,7 +715,6 @@ func (_ENS *ENSFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*
// //
// Solidity: event NewTTL(bytes32 indexed node, uint64 ttl) // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
func (_ENS *ENSFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSNewTTL, node [][32]byte) (event.Subscription, error) { func (_ENS *ENSFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSNewTTL, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -836,7 +830,6 @@ type ENSTransfer struct {
// //
// Solidity: event Transfer(bytes32 indexed node, address owner) // Solidity: event Transfer(bytes32 indexed node, address owner)
func (_ENS *ENSFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSTransferIterator, error) { func (_ENS *ENSFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSTransferIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -853,7 +846,6 @@ func (_ENS *ENSFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte)
// //
// Solidity: event Transfer(bytes32 indexed node, address owner) // Solidity: event Transfer(bytes32 indexed node, address owner)
func (_ENS *ENSFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSTransfer, node [][32]byte) (event.Subscription, error) { func (_ENS *ENSFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSTransfer, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)

View file

@ -192,9 +192,9 @@ func (_ENSRegistry *ENSRegistryTransactorRaw) Transact(opts *bind.TransactOpts,
// //
// Solidity: function owner(bytes32 node) constant returns(address) // Solidity: function owner(bytes32 node) constant returns(address)
func (_ENSRegistry *ENSRegistryCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_ENSRegistry *ENSRegistryCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _ENSRegistry.contract.Call(opts, out, "owner", node) err := _ENSRegistry.contract.Call(opts, out, "owner", node)
return *ret0, err return *ret0, err
@ -218,9 +218,9 @@ func (_ENSRegistry *ENSRegistryCallerSession) Owner(node [32]byte) (common.Addre
// //
// Solidity: function resolver(bytes32 node) constant returns(address) // Solidity: function resolver(bytes32 node) constant returns(address)
func (_ENSRegistry *ENSRegistryCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_ENSRegistry *ENSRegistryCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _ENSRegistry.contract.Call(opts, out, "resolver", node) err := _ENSRegistry.contract.Call(opts, out, "resolver", node)
return *ret0, err return *ret0, err
@ -244,9 +244,9 @@ func (_ENSRegistry *ENSRegistryCallerSession) Resolver(node [32]byte) (common.Ad
// //
// Solidity: function ttl(bytes32 node) constant returns(uint64) // Solidity: function ttl(bytes32 node) constant returns(uint64)
func (_ENSRegistry *ENSRegistryCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) { func (_ENSRegistry *ENSRegistryCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) {
var (
ret0 = new(uint64) var ret0 = new(uint64)
)
out := ret0 out := ret0
err := _ENSRegistry.contract.Call(opts, out, "ttl", node) err := _ENSRegistry.contract.Call(opts, out, "ttl", node)
return *ret0, err return *ret0, err
@ -429,7 +429,6 @@ type ENSRegistryNewOwner struct {
// //
// Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner) // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
func (_ENSRegistry *ENSRegistryFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSRegistryNewOwnerIterator, error) { func (_ENSRegistry *ENSRegistryFilterer) FilterNewOwner(opts *bind.FilterOpts, node [][32]byte, label [][32]byte) (*ENSRegistryNewOwnerIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -450,7 +449,6 @@ func (_ENSRegistry *ENSRegistryFilterer) FilterNewOwner(opts *bind.FilterOpts, n
// //
// Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner) // Solidity: event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner)
func (_ENSRegistry *ENSRegistryFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) { func (_ENSRegistry *ENSRegistryFilterer) WatchNewOwner(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewOwner, node [][32]byte, label [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -570,7 +568,6 @@ type ENSRegistryNewResolver struct {
// //
// Solidity: event NewResolver(bytes32 indexed node, address resolver) // Solidity: event NewResolver(bytes32 indexed node, address resolver)
func (_ENSRegistry *ENSRegistryFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryNewResolverIterator, error) { func (_ENSRegistry *ENSRegistryFilterer) FilterNewResolver(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryNewResolverIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -587,7 +584,6 @@ func (_ENSRegistry *ENSRegistryFilterer) FilterNewResolver(opts *bind.FilterOpts
// //
// Solidity: event NewResolver(bytes32 indexed node, address resolver) // Solidity: event NewResolver(bytes32 indexed node, address resolver)
func (_ENSRegistry *ENSRegistryFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewResolver, node [][32]byte) (event.Subscription, error) { func (_ENSRegistry *ENSRegistryFilterer) WatchNewResolver(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewResolver, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -703,7 +699,6 @@ type ENSRegistryNewTTL struct {
// //
// Solidity: event NewTTL(bytes32 indexed node, uint64 ttl) // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
func (_ENSRegistry *ENSRegistryFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryNewTTLIterator, error) { func (_ENSRegistry *ENSRegistryFilterer) FilterNewTTL(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryNewTTLIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -720,7 +715,6 @@ func (_ENSRegistry *ENSRegistryFilterer) FilterNewTTL(opts *bind.FilterOpts, nod
// //
// Solidity: event NewTTL(bytes32 indexed node, uint64 ttl) // Solidity: event NewTTL(bytes32 indexed node, uint64 ttl)
func (_ENSRegistry *ENSRegistryFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewTTL, node [][32]byte) (event.Subscription, error) { func (_ENSRegistry *ENSRegistryFilterer) WatchNewTTL(opts *bind.WatchOpts, sink chan<- *ENSRegistryNewTTL, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -836,7 +830,6 @@ type ENSRegistryTransfer struct {
// //
// Solidity: event Transfer(bytes32 indexed node, address owner) // Solidity: event Transfer(bytes32 indexed node, address owner)
func (_ENSRegistry *ENSRegistryFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryTransferIterator, error) { func (_ENSRegistry *ENSRegistryFilterer) FilterTransfer(opts *bind.FilterOpts, node [][32]byte) (*ENSRegistryTransferIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -853,7 +846,6 @@ func (_ENSRegistry *ENSRegistryFilterer) FilterTransfer(opts *bind.FilterOpts, n
// //
// Solidity: event Transfer(bytes32 indexed node, address owner) // Solidity: event Transfer(bytes32 indexed node, address owner)
func (_ENSRegistry *ENSRegistryFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSRegistryTransfer, node [][32]byte) (event.Subscription, error) { func (_ENSRegistry *ENSRegistryFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ENSRegistryTransfer, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)

View file

@ -222,9 +222,9 @@ func (_PublicResolver *PublicResolverCallerSession) ABI(node [32]byte, contentTy
// //
// Solidity: function addr(bytes32 node) constant returns(address) // Solidity: function addr(bytes32 node) constant returns(address)
func (_PublicResolver *PublicResolverCaller) Addr(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_PublicResolver *PublicResolverCaller) Addr(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "addr", node) err := _PublicResolver.contract.Call(opts, out, "addr", node)
return *ret0, err return *ret0, err
@ -248,9 +248,9 @@ func (_PublicResolver *PublicResolverCallerSession) Addr(node [32]byte) (common.
// //
// Solidity: function contenthash(bytes32 node) constant returns(bytes) // Solidity: function contenthash(bytes32 node) constant returns(bytes)
func (_PublicResolver *PublicResolverCaller) Contenthash(opts *bind.CallOpts, node [32]byte) ([]byte, error) { func (_PublicResolver *PublicResolverCaller) Contenthash(opts *bind.CallOpts, node [32]byte) ([]byte, error) {
var (
ret0 = new([]byte) var ret0 = new([]byte)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "contenthash", node) err := _PublicResolver.contract.Call(opts, out, "contenthash", node)
return *ret0, err return *ret0, err
@ -274,9 +274,9 @@ func (_PublicResolver *PublicResolverCallerSession) Contenthash(node [32]byte) (
// //
// Solidity: function name(bytes32 node) constant returns(string) // Solidity: function name(bytes32 node) constant returns(string)
func (_PublicResolver *PublicResolverCaller) Name(opts *bind.CallOpts, node [32]byte) (string, error) { func (_PublicResolver *PublicResolverCaller) Name(opts *bind.CallOpts, node [32]byte) (string, error) {
var (
ret0 = new(string) var ret0 = new(string)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "name", node) err := _PublicResolver.contract.Call(opts, out, "name", node)
return *ret0, err return *ret0, err
@ -336,9 +336,9 @@ func (_PublicResolver *PublicResolverCallerSession) Pubkey(node [32]byte) (struc
// //
// Solidity: function supportsInterface(bytes4 interfaceID) constant returns(bool) // Solidity: function supportsInterface(bytes4 interfaceID) constant returns(bool)
func (_PublicResolver *PublicResolverCaller) SupportsInterface(opts *bind.CallOpts, interfaceID [4]byte) (bool, error) { func (_PublicResolver *PublicResolverCaller) SupportsInterface(opts *bind.CallOpts, interfaceID [4]byte) (bool, error) {
var (
ret0 = new(bool) var ret0 = new(bool)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "supportsInterface", interfaceID) err := _PublicResolver.contract.Call(opts, out, "supportsInterface", interfaceID)
return *ret0, err return *ret0, err
@ -362,9 +362,9 @@ func (_PublicResolver *PublicResolverCallerSession) SupportsInterface(interfaceI
// //
// Solidity: function text(bytes32 node, string key) constant returns(string) // Solidity: function text(bytes32 node, string key) constant returns(string)
func (_PublicResolver *PublicResolverCaller) Text(opts *bind.CallOpts, node [32]byte, key string) (string, error) { func (_PublicResolver *PublicResolverCaller) Text(opts *bind.CallOpts, node [32]byte, key string) (string, error) {
var (
ret0 = new(string) var ret0 = new(string)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "text", node, key) err := _PublicResolver.contract.Call(opts, out, "text", node, key)
return *ret0, err return *ret0, err
@ -588,7 +588,6 @@ type PublicResolverABIChanged struct {
// //
// Solidity: event ABIChanged(bytes32 indexed node, uint256 indexed contentType) // Solidity: event ABIChanged(bytes32 indexed node, uint256 indexed contentType)
func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.FilterOpts, node [][32]byte, contentType []*big.Int) (*PublicResolverABIChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.FilterOpts, node [][32]byte, contentType []*big.Int) (*PublicResolverABIChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -609,7 +608,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.Filte
// //
// Solidity: event ABIChanged(bytes32 indexed node, uint256 indexed contentType) // Solidity: event ABIChanged(bytes32 indexed node, uint256 indexed contentType)
func (_PublicResolver *PublicResolverFilterer) WatchABIChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverABIChanged, node [][32]byte, contentType []*big.Int) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchABIChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverABIChanged, node [][32]byte, contentType []*big.Int) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -729,7 +727,6 @@ type PublicResolverAddrChanged struct {
// //
// Solidity: event AddrChanged(bytes32 indexed node, address a) // Solidity: event AddrChanged(bytes32 indexed node, address a)
func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverAddrChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverAddrChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -746,7 +743,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.Filt
// //
// Solidity: event AddrChanged(bytes32 indexed node, address a) // Solidity: event AddrChanged(bytes32 indexed node, address a)
func (_PublicResolver *PublicResolverFilterer) WatchAddrChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverAddrChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchAddrChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverAddrChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -862,7 +858,6 @@ type PublicResolverContenthashChanged struct {
// //
// Solidity: event ContenthashChanged(bytes32 indexed node, bytes hash) // Solidity: event ContenthashChanged(bytes32 indexed node, bytes hash)
func (_PublicResolver *PublicResolverFilterer) FilterContenthashChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverContenthashChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterContenthashChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverContenthashChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -879,7 +874,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterContenthashChanged(opts *bi
// //
// Solidity: event ContenthashChanged(bytes32 indexed node, bytes hash) // Solidity: event ContenthashChanged(bytes32 indexed node, bytes hash)
func (_PublicResolver *PublicResolverFilterer) WatchContenthashChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverContenthashChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchContenthashChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverContenthashChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -995,7 +989,6 @@ type PublicResolverNameChanged struct {
// //
// Solidity: event NameChanged(bytes32 indexed node, string name) // Solidity: event NameChanged(bytes32 indexed node, string name)
func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverNameChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverNameChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1012,7 +1005,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.Filt
// //
// Solidity: event NameChanged(bytes32 indexed node, string name) // Solidity: event NameChanged(bytes32 indexed node, string name)
func (_PublicResolver *PublicResolverFilterer) WatchNameChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverNameChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchNameChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverNameChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1129,7 +1121,6 @@ type PublicResolverPubkeyChanged struct {
// //
// Solidity: event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y) // Solidity: event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y)
func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverPubkeyChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverPubkeyChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1146,7 +1137,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.Fi
// //
// Solidity: event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y) // Solidity: event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y)
func (_PublicResolver *PublicResolverFilterer) WatchPubkeyChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverPubkeyChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchPubkeyChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverPubkeyChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1263,7 +1253,6 @@ type PublicResolverTextChanged struct {
// //
// Solidity: event TextChanged(bytes32 indexed node, string indexedKey, string key) // Solidity: event TextChanged(bytes32 indexed node, string indexedKey, string key)
func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverTextChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverTextChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1280,7 +1269,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.Filt
// //
// Solidity: event TextChanged(bytes32 indexed node, string indexedKey, string key) // Solidity: event TextChanged(bytes32 indexed node, string indexedKey, string key)
func (_PublicResolver *PublicResolverFilterer) WatchTextChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverTextChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchTextChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverTextChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)

View file

@ -216,9 +216,9 @@ func (_PublicResolver *PublicResolverCallerSession) ABI(node [32]byte, contentTy
// //
// Solidity: function addr(node bytes32) constant returns(ret address) // Solidity: function addr(node bytes32) constant returns(ret address)
func (_PublicResolver *PublicResolverCaller) Addr(opts *bind.CallOpts, node [32]byte) (common.Address, error) { func (_PublicResolver *PublicResolverCaller) Addr(opts *bind.CallOpts, node [32]byte) (common.Address, error) {
var (
ret0 = new(common.Address) var ret0 = new(common.Address)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "addr", node) err := _PublicResolver.contract.Call(opts, out, "addr", node)
return *ret0, err return *ret0, err
@ -242,9 +242,9 @@ func (_PublicResolver *PublicResolverCallerSession) Addr(node [32]byte) (common.
// //
// Solidity: function content(node bytes32) constant returns(ret bytes32) // Solidity: function content(node bytes32) constant returns(ret bytes32)
func (_PublicResolver *PublicResolverCaller) Content(opts *bind.CallOpts, node [32]byte) ([32]byte, error) { func (_PublicResolver *PublicResolverCaller) Content(opts *bind.CallOpts, node [32]byte) ([32]byte, error) {
var (
ret0 = new([32]byte) var ret0 = new([32]byte)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "content", node) err := _PublicResolver.contract.Call(opts, out, "content", node)
return *ret0, err return *ret0, err
@ -268,9 +268,9 @@ func (_PublicResolver *PublicResolverCallerSession) Content(node [32]byte) ([32]
// //
// Solidity: function name(node bytes32) constant returns(ret string) // Solidity: function name(node bytes32) constant returns(ret string)
func (_PublicResolver *PublicResolverCaller) Name(opts *bind.CallOpts, node [32]byte) (string, error) { func (_PublicResolver *PublicResolverCaller) Name(opts *bind.CallOpts, node [32]byte) (string, error) {
var (
ret0 = new(string) var ret0 = new(string)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "name", node) err := _PublicResolver.contract.Call(opts, out, "name", node)
return *ret0, err return *ret0, err
@ -330,9 +330,9 @@ func (_PublicResolver *PublicResolverCallerSession) Pubkey(node [32]byte) (struc
// //
// Solidity: function supportsInterface(interfaceID bytes4) constant returns(bool) // Solidity: function supportsInterface(interfaceID bytes4) constant returns(bool)
func (_PublicResolver *PublicResolverCaller) SupportsInterface(opts *bind.CallOpts, interfaceID [4]byte) (bool, error) { func (_PublicResolver *PublicResolverCaller) SupportsInterface(opts *bind.CallOpts, interfaceID [4]byte) (bool, error) {
var (
ret0 = new(bool) var ret0 = new(bool)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "supportsInterface", interfaceID) err := _PublicResolver.contract.Call(opts, out, "supportsInterface", interfaceID)
return *ret0, err return *ret0, err
@ -356,9 +356,9 @@ func (_PublicResolver *PublicResolverCallerSession) SupportsInterface(interfaceI
// //
// Solidity: function text(node bytes32, key string) constant returns(ret string) // Solidity: function text(node bytes32, key string) constant returns(ret string)
func (_PublicResolver *PublicResolverCaller) Text(opts *bind.CallOpts, node [32]byte, key string) (string, error) { func (_PublicResolver *PublicResolverCaller) Text(opts *bind.CallOpts, node [32]byte, key string) (string, error) {
var (
ret0 = new(string) var ret0 = new(string)
)
out := ret0 out := ret0
err := _PublicResolver.contract.Call(opts, out, "text", node, key) err := _PublicResolver.contract.Call(opts, out, "text", node, key)
return *ret0, err return *ret0, err
@ -582,7 +582,6 @@ type PublicResolverABIChanged struct {
// //
// Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256) // Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256)
func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.FilterOpts, node [][32]byte, contentType []*big.Int) (*PublicResolverABIChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.FilterOpts, node [][32]byte, contentType []*big.Int) (*PublicResolverABIChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -603,7 +602,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterABIChanged(opts *bind.Filte
// //
// Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256) // Solidity: event ABIChanged(node indexed bytes32, contentType indexed uint256)
func (_PublicResolver *PublicResolverFilterer) WatchABIChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverABIChanged, node [][32]byte, contentType []*big.Int) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchABIChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverABIChanged, node [][32]byte, contentType []*big.Int) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -723,7 +721,6 @@ type PublicResolverAddrChanged struct {
// //
// Solidity: event AddrChanged(node indexed bytes32, a address) // Solidity: event AddrChanged(node indexed bytes32, a address)
func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverAddrChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverAddrChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -740,7 +737,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterAddrChanged(opts *bind.Filt
// //
// Solidity: event AddrChanged(node indexed bytes32, a address) // Solidity: event AddrChanged(node indexed bytes32, a address)
func (_PublicResolver *PublicResolverFilterer) WatchAddrChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverAddrChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchAddrChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverAddrChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -856,7 +852,6 @@ type PublicResolverContentChanged struct {
// //
// Solidity: event ContentChanged(node indexed bytes32, hash bytes32) // Solidity: event ContentChanged(node indexed bytes32, hash bytes32)
func (_PublicResolver *PublicResolverFilterer) FilterContentChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverContentChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterContentChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverContentChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -873,7 +868,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterContentChanged(opts *bind.F
// //
// Solidity: event ContentChanged(node indexed bytes32, hash bytes32) // Solidity: event ContentChanged(node indexed bytes32, hash bytes32)
func (_PublicResolver *PublicResolverFilterer) WatchContentChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverContentChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchContentChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverContentChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -989,7 +983,6 @@ type PublicResolverNameChanged struct {
// //
// Solidity: event NameChanged(node indexed bytes32, name string) // Solidity: event NameChanged(node indexed bytes32, name string)
func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverNameChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverNameChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1006,7 +999,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterNameChanged(opts *bind.Filt
// //
// Solidity: event NameChanged(node indexed bytes32, name string) // Solidity: event NameChanged(node indexed bytes32, name string)
func (_PublicResolver *PublicResolverFilterer) WatchNameChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverNameChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchNameChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverNameChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1123,7 +1115,6 @@ type PublicResolverPubkeyChanged struct {
// //
// Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32) // Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32)
func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverPubkeyChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.FilterOpts, node [][32]byte) (*PublicResolverPubkeyChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1140,7 +1131,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterPubkeyChanged(opts *bind.Fi
// //
// Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32) // Solidity: event PubkeyChanged(node indexed bytes32, x bytes32, y bytes32)
func (_PublicResolver *PublicResolverFilterer) WatchPubkeyChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverPubkeyChanged, node [][32]byte) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchPubkeyChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverPubkeyChanged, node [][32]byte) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1257,7 +1247,6 @@ type PublicResolverTextChanged struct {
// //
// Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string) // Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string)
func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.FilterOpts, node [][32]byte, indexedKey []string) (*PublicResolverTextChangedIterator, error) { func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.FilterOpts, node [][32]byte, indexedKey []string) (*PublicResolverTextChangedIterator, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)
@ -1278,7 +1267,6 @@ func (_PublicResolver *PublicResolverFilterer) FilterTextChanged(opts *bind.Filt
// //
// Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string) // Solidity: event TextChanged(node indexed bytes32, indexedKey indexed string, key string)
func (_PublicResolver *PublicResolverFilterer) WatchTextChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverTextChanged, node [][32]byte, indexedKey []string) (event.Subscription, error) { func (_PublicResolver *PublicResolverFilterer) WatchTextChanged(opts *bind.WatchOpts, sink chan<- *PublicResolverTextChanged, node [][32]byte, indexedKey []string) (event.Subscription, error) {
var nodeRule []interface{} var nodeRule []interface{}
for _, nodeItem := range node { for _, nodeItem := range node {
nodeRule = append(nodeRule, nodeItem) nodeRule = append(nodeRule, nodeItem)

View file

@ -37,36 +37,47 @@ import (
func BenchmarkInsertChain_empty_memdb(b *testing.B) { func BenchmarkInsertChain_empty_memdb(b *testing.B) {
benchInsertChain(b, false, nil) benchInsertChain(b, false, nil)
} }
func BenchmarkInsertChain_empty_diskdb(b *testing.B) { func BenchmarkInsertChain_empty_diskdb(b *testing.B) {
benchInsertChain(b, true, nil) benchInsertChain(b, true, nil)
} }
func BenchmarkInsertChain_valueTx_memdb(b *testing.B) { func BenchmarkInsertChain_valueTx_memdb(b *testing.B) {
benchInsertChain(b, false, genValueTx(0)) benchInsertChain(b, false, genValueTx(0))
} }
func BenchmarkInsertChain_valueTx_diskdb(b *testing.B) { func BenchmarkInsertChain_valueTx_diskdb(b *testing.B) {
benchInsertChain(b, true, genValueTx(0)) benchInsertChain(b, true, genValueTx(0))
} }
func BenchmarkInsertChain_valueTx_100kB_memdb(b *testing.B) { func BenchmarkInsertChain_valueTx_100kB_memdb(b *testing.B) {
benchInsertChain(b, false, genValueTx(100*1024)) benchInsertChain(b, false, genValueTx(100*1024))
} }
func BenchmarkInsertChain_valueTx_100kB_diskdb(b *testing.B) { func BenchmarkInsertChain_valueTx_100kB_diskdb(b *testing.B) {
benchInsertChain(b, true, genValueTx(100*1024)) benchInsertChain(b, true, genValueTx(100*1024))
} }
func BenchmarkInsertChain_uncles_memdb(b *testing.B) { func BenchmarkInsertChain_uncles_memdb(b *testing.B) {
benchInsertChain(b, false, genUncles) benchInsertChain(b, false, genUncles)
} }
func BenchmarkInsertChain_uncles_diskdb(b *testing.B) { func BenchmarkInsertChain_uncles_diskdb(b *testing.B) {
benchInsertChain(b, true, genUncles) benchInsertChain(b, true, genUncles)
} }
func BenchmarkInsertChain_ring200_memdb(b *testing.B) { func BenchmarkInsertChain_ring200_memdb(b *testing.B) {
benchInsertChain(b, false, genTxRing(200)) benchInsertChain(b, false, genTxRing(200))
} }
func BenchmarkInsertChain_ring200_diskdb(b *testing.B) { func BenchmarkInsertChain_ring200_diskdb(b *testing.B) {
benchInsertChain(b, true, genTxRing(200)) benchInsertChain(b, true, genTxRing(200))
} }
func BenchmarkInsertChain_ring1000_memdb(b *testing.B) { func BenchmarkInsertChain_ring1000_memdb(b *testing.B) {
benchInsertChain(b, false, genTxRing(1000)) benchInsertChain(b, false, genTxRing(1000))
} }
func BenchmarkInsertChain_ring1000_diskdb(b *testing.B) { func BenchmarkInsertChain_ring1000_diskdb(b *testing.B) {
benchInsertChain(b, true, genTxRing(1000)) benchInsertChain(b, true, genTxRing(1000))
} }
@ -187,36 +198,47 @@ func benchInsertChain(b *testing.B, disk bool, gen func(int, *BlockGen)) {
func BenchmarkChainRead_header_10k(b *testing.B) { func BenchmarkChainRead_header_10k(b *testing.B) {
benchReadChain(b, false, 10000) benchReadChain(b, false, 10000)
} }
func BenchmarkChainRead_full_10k(b *testing.B) { func BenchmarkChainRead_full_10k(b *testing.B) {
benchReadChain(b, true, 10000) benchReadChain(b, true, 10000)
} }
func BenchmarkChainRead_header_100k(b *testing.B) { func BenchmarkChainRead_header_100k(b *testing.B) {
benchReadChain(b, false, 100000) benchReadChain(b, false, 100000)
} }
func BenchmarkChainRead_full_100k(b *testing.B) { func BenchmarkChainRead_full_100k(b *testing.B) {
benchReadChain(b, true, 100000) benchReadChain(b, true, 100000)
} }
func BenchmarkChainRead_header_500k(b *testing.B) { func BenchmarkChainRead_header_500k(b *testing.B) {
benchReadChain(b, false, 500000) benchReadChain(b, false, 500000)
} }
func BenchmarkChainRead_full_500k(b *testing.B) { func BenchmarkChainRead_full_500k(b *testing.B) {
benchReadChain(b, true, 500000) benchReadChain(b, true, 500000)
} }
func BenchmarkChainWrite_header_10k(b *testing.B) { func BenchmarkChainWrite_header_10k(b *testing.B) {
benchWriteChain(b, false, 10000) benchWriteChain(b, false, 10000)
} }
func BenchmarkChainWrite_full_10k(b *testing.B) { func BenchmarkChainWrite_full_10k(b *testing.B) {
benchWriteChain(b, true, 10000) benchWriteChain(b, true, 10000)
} }
func BenchmarkChainWrite_header_100k(b *testing.B) { func BenchmarkChainWrite_header_100k(b *testing.B) {
benchWriteChain(b, false, 100000) benchWriteChain(b, false, 100000)
} }
func BenchmarkChainWrite_full_100k(b *testing.B) { func BenchmarkChainWrite_full_100k(b *testing.B) {
benchWriteChain(b, true, 100000) benchWriteChain(b, true, 100000)
} }
func BenchmarkChainWrite_header_500k(b *testing.B) { func BenchmarkChainWrite_header_500k(b *testing.B) {
benchWriteChain(b, false, 500000) benchWriteChain(b, false, 500000)
} }
func BenchmarkChainWrite_full_500k(b *testing.B) { func BenchmarkChainWrite_full_500k(b *testing.B) {
benchWriteChain(b, true, 500000) benchWriteChain(b, true, 500000)
} }

View file

@ -1098,9 +1098,9 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) {
defer bc.blockProcFeed.Send(false) defer bc.blockProcFeed.Send(false)
// Remove already known canon-blocks // Remove already known canon-blocks
var (
block, prev *types.Block var block, prev *types.Block
)
// Do a sanity check that the provided chain is actually ordered and linked // Do a sanity check that the provided chain is actually ordered and linked
for i := 1; i < len(chain); i++ { for i := 1; i < len(chain); i++ {
block = chain[i] block = chain[i]

View file

@ -1200,7 +1200,6 @@ done:
t.Errorf("unexpected event fired: %v", e) t.Errorf("unexpected event fired: %v", e)
case <-time.After(250 * time.Millisecond): case <-time.After(250 * time.Millisecond):
} }
} }
// Tests if the canonical block can be fetched from the database during chain insertion. // Tests if the canonical block can be fetched from the database during chain insertion.
@ -1620,10 +1619,10 @@ func benchmarkLargeNumberOfValueToNonexisting(b *testing.B, numTxs, numBlocks in
b.StopTimer() b.StopTimer()
if got := chain.CurrentBlock().Transactions().Len(); got != numTxs*numBlocks { if got := chain.CurrentBlock().Transactions().Len(); got != numTxs*numBlocks {
b.Fatalf("Transactions were not included, expected %d, got %d", numTxs*numBlocks, got) b.Fatalf("Transactions were not included, expected %d, got %d", numTxs*numBlocks, got)
}
}
}
}
}
}
func BenchmarkBlockChain_1x1000ValueTransferToNonexisting(b *testing.B) { func BenchmarkBlockChain_1x1000ValueTransferToNonexisting(b *testing.B) {
var ( var (
numTxs = 1000 numTxs = 1000
@ -1639,6 +1638,7 @@ func BenchmarkBlockChain_1x1000ValueTransferToNonexisting(b *testing.B) {
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn) benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn)
} }
func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) { func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) {
var ( var (
numTxs = 1000 numTxs = 1000
@ -1656,6 +1656,7 @@ func BenchmarkBlockChain_1x1000ValueTransferToExisting(b *testing.B) {
benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn) benchmarkLargeNumberOfValueToNonexisting(b, numTxs, numBlocks, recipientFn, dataFn)
} }
func BenchmarkBlockChain_1x1000Executions(b *testing.B) { func BenchmarkBlockChain_1x1000Executions(b *testing.B) {
var ( var (
numTxs = 1000 numTxs = 1000
@ -1735,7 +1736,6 @@ func TestLowDiffLongChain(t *testing.T) {
// - A common ancestor is placed at prune-point + blocksBetweenCommonAncestorAndPruneblock // - A common ancestor is placed at prune-point + blocksBetweenCommonAncestorAndPruneblock
// - The sidechain S is prepended with numCanonBlocksInSidechain blocks from the canon chain // - The sidechain S is prepended with numCanonBlocksInSidechain blocks from the canon chain
func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommonAncestorAndPruneblock int) { func testSideImport(t *testing.T, numCanonBlocksInSidechain, blocksBetweenCommonAncestorAndPruneblock int) {
// Generate a canonical chain to act as the main dataset // Generate a canonical chain to act as the main dataset
engine := ethash.NewFaker() engine := ethash.NewFaker()
db := rawdb.NewMemoryDatabase() db := rawdb.NewMemoryDatabase()

View file

@ -16,9 +16,7 @@
package bloombits package bloombits
import ( import "sync"
"sync"
)
// request represents a bloom retrieval task to prioritize and pull from the local // request represents a bloom retrieval task to prioritize and pull from the local
// database or remotely from the network. // database or remotely from the network.

View file

@ -153,6 +153,7 @@ func (e *GenesisMismatchError) Error() string {
func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig, common.Hash, error) { func SetupGenesisBlock(db ethdb.Database, genesis *Genesis) (*params.ChainConfig, common.Hash, error) {
return SetupGenesisBlockWithOverride(db, genesis, nil) return SetupGenesisBlockWithOverride(db, genesis, nil)
} }
func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, constantinopleOverride *big.Int) (*params.ChainConfig, common.Hash, error) { func SetupGenesisBlockWithOverride(db ethdb.Database, genesis *Genesis, constantinopleOverride *big.Int) (*params.ChainConfig, common.Hash, error) {
if genesis != nil && genesis.Config == nil { if genesis != nil && genesis.Config == nil {
return params.AllEthashProtocolChanges, common.Hash{}, errGenesisNoConfig return params.AllEthashProtocolChanges, common.Hash{}, errGenesisNoConfig

View file

@ -16,9 +16,7 @@
package rawdb package rawdb
import ( import "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethdb"
)
// table is a wrapper around a database that prefixes each key access with a pre- // table is a wrapper around a database that prefixes each key access with a pre-
// configured string. // configured string.

View file

@ -25,10 +25,8 @@ import (
lru "github.com/hashicorp/golang-lru" lru "github.com/hashicorp/golang-lru"
) )
const (
// Number of codehash->size associations to keep. // Number of codehash->size associations to keep.
codeSizeCacheSize = 100000 const codeSizeCacheSize = 100000
)
// Database wraps access to tries and contract code. // Database wraps access to tries and contract code.
type Database interface { type Database interface {

View file

@ -27,9 +27,7 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
) )
var ( var errInsufficientBalanceForGas = errors.New("insufficient balance to pay for gas")
errInsufficientBalanceForGas = errors.New("insufficient balance to pay for gas")
)
/* /*
The State Transitioning Model The State Transitioning Model

View file

@ -35,10 +35,8 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
) )
const (
// chainHeadChanSize is the size of channel listening to ChainHeadEvent. // chainHeadChanSize is the size of channel listening to ChainHeadEvent.
chainHeadChanSize = 10 const chainHeadChanSize = 10
)
var ( var (
// ErrInvalidSender is returned if the transaction contains an invalid signature. // ErrInvalidSender is returned if the transaction contains an invalid signature.

View file

@ -573,7 +573,6 @@ func TestTransactionPostponing(t *testing.T) {
// Add a batch consecutive pending transactions for validation // Add a batch consecutive pending transactions for validation
txs := []*types.Transaction{} txs := []*types.Transaction{}
for i, key := range keys { for i, key := range keys {
for j := 0; j < 100; j++ { for j := 0; j < 100; j++ {
var tx *types.Transaction var tx *types.Transaction
if (i+j)%2 == 0 { if (i+j)%2 == 0 {
@ -761,6 +760,7 @@ func TestTransactionQueueAccountLimiting(t *testing.T) {
func TestTransactionQueueGlobalLimiting(t *testing.T) { func TestTransactionQueueGlobalLimiting(t *testing.T) {
testTransactionQueueGlobalLimiting(t, false) testTransactionQueueGlobalLimiting(t, false)
} }
func TestTransactionQueueGlobalLimitingNoLocals(t *testing.T) { func TestTransactionQueueGlobalLimitingNoLocals(t *testing.T) {
testTransactionQueueGlobalLimiting(t, true) testTransactionQueueGlobalLimiting(t, true)
} }

View file

@ -77,6 +77,7 @@ func TestUncleHash(t *testing.T) {
t.Fatalf("empty uncle hash is wrong, got %x != %x", h, exp) t.Fatalf("empty uncle hash is wrong, got %x != %x", h, exp)
} }
} }
func BenchmarkUncleHash(b *testing.B) { func BenchmarkUncleHash(b *testing.B) {
uncles := make([]*Header, 0) uncles := make([]*Header, 0)
b.ResetTimer() b.ResetTimer()

View file

@ -78,7 +78,6 @@ func (b Bloom) Test(test *big.Int) bool {
func (b Bloom) TestBytes(test []byte) bool { func (b Bloom) TestBytes(test []byte) bool {
return b.Test(new(big.Int).SetBytes(test)) return b.Test(new(big.Int).SetBytes(test))
} }
// MarshalText encodes b as a hex string with 0x prefix. // MarshalText encodes b as a hex string with 0x prefix.

View file

@ -31,9 +31,7 @@ import (
//go:generate gencodec -type txdata -field-override txdataMarshaling -out gen_tx_json.go //go:generate gencodec -type txdata -field-override txdataMarshaling -out gen_tx_json.go
var ( var ErrInvalidSig = errors.New("invalid transaction v, r, s values")
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
)
type Transaction struct { type Transaction struct {
data txdata data txdata

View file

@ -27,9 +27,7 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
) )
var ( var ErrInvalidChainId = errors.New("invalid chain id for signer")
ErrInvalidChainId = errors.New("invalid chain id for signer")
)
// sigCache is used to cache the derived sender and contains // sigCache is used to cache the derived sender and contains
// the signer used to derive it. // the signer used to derive it.

View file

@ -24,6 +24,7 @@ type bitvec []byte
func (bits *bitvec) set(pos uint64) { func (bits *bitvec) set(pos uint64) {
(*bits)[pos/8] |= 0x80 >> (pos % 8) (*bits)[pos/8] |= 0x80 >> (pos % 8)
} }
func (bits *bitvec) set8(pos uint64) { func (bits *bitvec) set8(pos uint64) {
(*bits)[pos/8] |= 0xFF >> (pos % 8) (*bits)[pos/8] |= 0xFF >> (pos % 8)
(*bits)[pos/8+1] |= ^(0xFF >> (pos % 8)) (*bits)[pos/8+1] |= ^(0xFF >> (pos % 8))

View file

@ -64,6 +64,7 @@ func BenchmarkJumpdestAnalysis_1200k(bench *testing.B) {
} }
bench.StopTimer() bench.StopTimer()
} }
func BenchmarkJumpdestHashing_1200k(bench *testing.B) { func BenchmarkJumpdestHashing_1200k(bench *testing.B) {
// 4 ms // 4 ms
code := make([]byte, 1200000) code := make([]byte, 1200000)

View file

@ -111,6 +111,7 @@ type sha256hash struct{}
func (c *sha256hash) RequiredGas(input []byte) uint64 { func (c *sha256hash) RequiredGas(input []byte) uint64 {
return uint64(len(input)+31)/32*params.Sha256PerWordGas + params.Sha256BaseGas return uint64(len(input)+31)/32*params.Sha256PerWordGas + params.Sha256BaseGas
} }
func (c *sha256hash) Run(input []byte) ([]byte, error) { func (c *sha256hash) Run(input []byte) ([]byte, error) {
h := sha256.Sum256(input) h := sha256.Sum256(input)
return h[:], nil return h[:], nil
@ -126,6 +127,7 @@ type ripemd160hash struct{}
func (c *ripemd160hash) RequiredGas(input []byte) uint64 { func (c *ripemd160hash) RequiredGas(input []byte) uint64 {
return uint64(len(input)+31)/32*params.Ripemd160PerWordGas + params.Ripemd160BaseGas return uint64(len(input)+31)/32*params.Ripemd160PerWordGas + params.Ripemd160BaseGas
} }
func (c *ripemd160hash) Run(input []byte) ([]byte, error) { func (c *ripemd160hash) Run(input []byte) ([]byte, error) {
ripemd := ripemd160.New() ripemd := ripemd160.New()
ripemd.Write(input) ripemd.Write(input)
@ -142,6 +144,7 @@ type dataCopy struct{}
func (c *dataCopy) RequiredGas(input []byte) uint64 { func (c *dataCopy) RequiredGas(input []byte) uint64 {
return uint64(len(input)+31)/32*params.IdentityPerWordGas + params.IdentityBaseGas return uint64(len(input)+31)/32*params.IdentityPerWordGas + params.IdentityBaseGas
} }
func (c *dataCopy) Run(in []byte) ([]byte, error) { func (c *dataCopy) Run(in []byte) ([]byte, error) {
return in, nil return in, nil
} }

View file

@ -442,7 +442,6 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
evm.vmConfig.Tracer.CaptureEnd(ret, gas-contract.Gas, time.Since(start), err) evm.vmConfig.Tracer.CaptureEnd(ret, gas-contract.Gas, time.Since(start), err)
} }
return ret, address, contract.Gas, err return ret, address, contract.Gas, err
} }
// Create creates a new contract using code as deployment code. // Create creates a new contract using code as deployment code.

View file

@ -44,7 +44,6 @@ var commonParams []*twoOperandParams
var twoOpMethods map[string]executionFunc var twoOpMethods map[string]executionFunc
func init() { func init() {
// Params is a list of common edgecases that should be used for some common tests // Params is a list of common edgecases that should be used for some common tests
params := []string{ params := []string{
"0000000000000000000000000000000000000000000000000000000000000000", // 0 "0000000000000000000000000000000000000000000000000000000000000000", // 0
@ -90,7 +89,6 @@ func init() {
} }
func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFunc, name string) { func testTwoOperandOp(t *testing.T, tests []TwoOperandTestcase, opFn executionFunc, name string) {
var ( var (
env = NewEVM(Context{}, nil, params.TestChainConfig, Config{}) env = NewEVM(Context{}, nil, params.TestChainConfig, Config{})
stack = newstack() stack = newstack()
@ -422,11 +420,13 @@ func BenchmarkOpEq(b *testing.B) {
opBenchmark(b, opEq, x, y) opBenchmark(b, opEq, x, y)
} }
func BenchmarkOpEq2(b *testing.B) { func BenchmarkOpEq2(b *testing.B) {
x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff" x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff"
y := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201fffffffe" y := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201fffffffe"
opBenchmark(b, opEq, x, y) opBenchmark(b, opEq, x, y)
} }
func BenchmarkOpAnd(b *testing.B) { func BenchmarkOpAnd(b *testing.B) {
x := "ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff" x := "ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
y := "ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff" y := "ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffffffff"
@ -477,18 +477,21 @@ func BenchmarkOpSHL(b *testing.B) {
opBenchmark(b, opSHL, x, y) opBenchmark(b, opSHL, x, y)
} }
func BenchmarkOpSHR(b *testing.B) { func BenchmarkOpSHR(b *testing.B) {
x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff" x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff"
y := "ff" y := "ff"
opBenchmark(b, opSHR, x, y) opBenchmark(b, opSHR, x, y)
} }
func BenchmarkOpSAR(b *testing.B) { func BenchmarkOpSAR(b *testing.B) {
x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff" x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff"
y := "ff" y := "ff"
opBenchmark(b, opSAR, x, y) opBenchmark(b, opSAR, x, y)
} }
func BenchmarkOpIsZero(b *testing.B) { func BenchmarkOpIsZero(b *testing.B) {
x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff" x := "FBCDEF090807060504030201ffffffffFBCDEF090807060504030201ffffffff"
opBenchmark(b, opIszero, x) opBenchmark(b, opIszero, x)

View file

@ -16,9 +16,7 @@
package vm package vm
import ( import "testing"
"testing"
)
func TestIntPoolPoolGet(t *testing.T) { func TestIntPoolPoolGet(t *testing.T) {
poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap) poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap)

View file

@ -70,6 +70,7 @@ func memoryCall(stack *Stack) (uint64, bool) {
} }
return y, false return y, false
} }
func memoryDelegateCall(stack *Stack) (uint64, bool) { func memoryDelegateCall(stack *Stack) (uint64, bool) {
x, overflow := calcMemSize64(stack.Back(4), stack.Back(5)) x, overflow := calcMemSize64(stack.Back(4), stack.Back(5))
if overflow { if overflow {

View file

@ -16,9 +16,7 @@
package vm package vm
import ( import "fmt"
"fmt"
)
// OpCode is an EVM opcode // OpCode is an EVM opcode
type OpCode byte type OpCode byte

View file

@ -149,6 +149,7 @@ func BenchmarkCall(b *testing.B) {
} }
} }
} }
func benchmarkEVM_Create(bench *testing.B, code string) { func benchmarkEVM_Create(bench *testing.B, code string) {
var ( var (
statedb, _ = state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase())) statedb, _ = state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase()))
@ -191,14 +192,17 @@ func BenchmarkEVM_CREATE_500(bench *testing.B) {
// initcode size 500K, repeatedly calls CREATE and then modifies the mem contents // initcode size 500K, repeatedly calls CREATE and then modifies the mem contents
benchmarkEVM_Create(bench, "5b6207a120600080f0600152600056") benchmarkEVM_Create(bench, "5b6207a120600080f0600152600056")
} }
func BenchmarkEVM_CREATE2_500(bench *testing.B) { func BenchmarkEVM_CREATE2_500(bench *testing.B) {
// initcode size 500K, repeatedly calls CREATE2 and then modifies the mem contents // initcode size 500K, repeatedly calls CREATE2 and then modifies the mem contents
benchmarkEVM_Create(bench, "5b586207a120600080f5600152600056") benchmarkEVM_Create(bench, "5b586207a120600080f5600152600056")
} }
func BenchmarkEVM_CREATE_1200(bench *testing.B) { func BenchmarkEVM_CREATE_1200(bench *testing.B) {
// initcode size 1200K, repeatedly calls CREATE and then modifies the mem contents // initcode size 1200K, repeatedly calls CREATE and then modifies the mem contents
benchmarkEVM_Create(bench, "5b62124f80600080f0600152600056") benchmarkEVM_Create(bench, "5b62124f80600080f0600152600056")
} }
func BenchmarkEVM_CREATE2_1200(bench *testing.B) { func BenchmarkEVM_CREATE2_1200(bench *testing.B) {
// initcode size 1200K, repeatedly calls CREATE2 and then modifies the mem contents // initcode size 1200K, repeatedly calls CREATE2 and then modifies the mem contents
benchmarkEVM_Create(bench, "5b5862124f80600080f5600152600056") benchmarkEVM_Create(bench, "5b5862124f80600080f5600152600056")

View file

@ -43,6 +43,7 @@ func (st *Stack) push(d *big.Int) {
// st.data = append(st.data, stackItem) // st.data = append(st.data, stackItem)
st.data = append(st.data, d) st.data = append(st.data, d)
} }
func (st *Stack) pushN(ds ...*big.Int) { func (st *Stack) pushN(ds ...*big.Int) {
st.data = append(st.data, ds...) st.data = append(st.data, ds...)
} }

View file

@ -16,13 +16,12 @@
package vm package vm
import ( import "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/params"
)
func minSwapStack(n int) int { func minSwapStack(n int) int {
return minStack(n, n) return minStack(n, n)
} }
func maxSwapStack(n int) int { func maxSwapStack(n int) int {
return maxStack(n, n) return maxStack(n, n)
} }
@ -30,6 +29,7 @@ func maxSwapStack(n int) int {
func minDupStack(n int) int { func minDupStack(n int) int {
return minStack(n, n+1) return minStack(n, n+1)
} }
func maxDupStack(n int) int { func maxDupStack(n int) int {
return maxStack(n, n+1) return maxStack(n, n+1)
} }
@ -37,6 +37,7 @@ func maxDupStack(n int) int {
func maxStack(pop, push int) int { func maxStack(pop, push int) int {
return int(params.StackLimit) + pop - push return int(params.StackLimit) + pop - push
} }
func minStack(pops, push int) int { func minStack(pops, push int) int {
return pops return pops
} }

View file

@ -32,18 +32,23 @@ type bindataFileInfo struct {
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return false
} }
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

View file

@ -43,9 +43,7 @@ import (
"golang.org/x/net/websocket" "golang.org/x/net/websocket"
) )
const ( const sampleLimit = 200 // Maximum number of data samples
sampleLimit = 200 // Maximum number of data samples
)
// Dashboard contains the dashboard internals. // Dashboard contains the dashboard internals.
type Dashboard struct { type Dashboard struct {

View file

@ -16,9 +16,7 @@
package dashboard package dashboard
import ( import "encoding/json"
"encoding/json"
)
type Message struct { type Message struct {
General *GeneralMessage `json:"general,omitempty"` General *GeneralMessage `json:"general,omitempty"`

View file

@ -79,11 +79,9 @@ func (eth *Ethereum) startBloomHandlers(sectionSize uint64) {
} }
} }
const (
// bloomThrottling is the time to wait between processing two consecutive index // bloomThrottling is the time to wait between processing two consecutive index
// sections. It's useful during chain upgrades to prevent disk overload. // sections. It's useful during chain upgrades to prevent disk overload.
bloomThrottling = 100 * time.Millisecond const bloomThrottling = 100 * time.Millisecond
)
// BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index // BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index
// for the Ethereum header bloom filters, permitting blazing fast filtering. // for the Ethereum header bloom filters, permitting blazing fast filtering.

View file

@ -1130,7 +1130,6 @@ func (d *Downloader) fetchParts(errCancel error, deliveryCh chan dataPack, deliv
expire func() map[string]int, pending func() int, inFlight func() bool, throttle func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, error), expire func() map[string]int, pending func() int, inFlight func() bool, throttle func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, error),
fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int, fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int,
idle func() ([]*peerConnection, int), setIdle func(*peerConnection, int), kind string) error { idle func() ([]*peerConnection, int), setIdle func(*peerConnection, int), kind string) error {
// Create a ticker to detect expired retrieval tasks // Create a ticker to detect expired retrieval tasks
ticker := time.NewTicker(100 * time.Millisecond) ticker := time.NewTicker(100 * time.Millisecond)
defer ticker.Stop() defer ticker.Stop()

View file

@ -1453,12 +1453,15 @@ func (ftp *floodingTestPeer) Head() (common.Hash, *big.Int) { return ftp.peer.He
func (ftp *floodingTestPeer) RequestHeadersByHash(hash common.Hash, count int, skip int, reverse bool) error { func (ftp *floodingTestPeer) RequestHeadersByHash(hash common.Hash, count int, skip int, reverse bool) error {
return ftp.peer.RequestHeadersByHash(hash, count, skip, reverse) return ftp.peer.RequestHeadersByHash(hash, count, skip, reverse)
} }
func (ftp *floodingTestPeer) RequestBodies(hashes []common.Hash) error { func (ftp *floodingTestPeer) RequestBodies(hashes []common.Hash) error {
return ftp.peer.RequestBodies(hashes) return ftp.peer.RequestBodies(hashes)
} }
func (ftp *floodingTestPeer) RequestReceipts(hashes []common.Hash) error { func (ftp *floodingTestPeer) RequestReceipts(hashes []common.Hash) error {
return ftp.peer.RequestReceipts(hashes) return ftp.peer.RequestReceipts(hashes)
} }
func (ftp *floodingTestPeer) RequestNodeData(hashes []common.Hash) error { func (ftp *floodingTestPeer) RequestNodeData(hashes []common.Hash) error {
return ftp.peer.RequestNodeData(hashes) return ftp.peer.RequestNodeData(hashes)
} }
@ -1502,33 +1505,41 @@ func TestRemoteHeaderRequestSpan(t *testing.T) {
expected []int expected []int
}{ }{
// Remote is way higher. We should ask for the remote head and go backwards // Remote is way higher. We should ask for the remote head and go backwards
{1500, 1000, {
1500, 1000,
[]int{1323, 1339, 1355, 1371, 1387, 1403, 1419, 1435, 1451, 1467, 1483, 1499}, []int{1323, 1339, 1355, 1371, 1387, 1403, 1419, 1435, 1451, 1467, 1483, 1499},
}, },
{15000, 13006, {
15000, 13006,
[]int{14823, 14839, 14855, 14871, 14887, 14903, 14919, 14935, 14951, 14967, 14983, 14999}, []int{14823, 14839, 14855, 14871, 14887, 14903, 14919, 14935, 14951, 14967, 14983, 14999},
}, },
// Remote is pretty close to us. We don't have to fetch as many // Remote is pretty close to us. We don't have to fetch as many
{1200, 1150, {
1200, 1150,
[]int{1149, 1154, 1159, 1164, 1169, 1174, 1179, 1184, 1189, 1194, 1199}, []int{1149, 1154, 1159, 1164, 1169, 1174, 1179, 1184, 1189, 1194, 1199},
}, },
// Remote is equal to us (so on a fork with higher td) // Remote is equal to us (so on a fork with higher td)
// We should get the closest couple of ancestors // We should get the closest couple of ancestors
{1500, 1500, {
1500, 1500,
[]int{1497, 1499}, []int{1497, 1499},
}, },
// We're higher than the remote! Odd // We're higher than the remote! Odd
{1000, 1500, {
1000, 1500,
[]int{997, 999}, []int{997, 999},
}, },
// Check some weird edgecases that it behaves somewhat rationally // Check some weird edgecases that it behaves somewhat rationally
{0, 1500, {
0, 1500,
[]int{0, 2}, []int{0, 2},
}, },
{6000000, 0, {
6000000, 0,
[]int{5999823, 5999839, 5999855, 5999871, 5999887, 5999903, 5999919, 5999935, 5999951, 5999967, 5999983, 5999999}, []int{5999823, 5999839, 5999855, 5999871, 5999887, 5999903, 5999919, 5999935, 5999951, 5999967, 5999983, 5999999},
}, },
{0, 0, {
0, 0,
[]int{0, 2}, []int{0, 2},
}, },
} }

View file

@ -18,9 +18,7 @@
package downloader package downloader
import ( import "github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics"
)
var ( var (
headerInMeter = metrics.NewRegisteredMeter("eth/downloader/headers/in", nil) headerInMeter = metrics.NewRegisteredMeter("eth/downloader/headers/in", nil)

View file

@ -99,15 +99,19 @@ func (w *lightPeerWrapper) Head() (common.Hash, *big.Int) { return w.peer.Head()
func (w *lightPeerWrapper) RequestHeadersByHash(h common.Hash, amount int, skip int, reverse bool) error { func (w *lightPeerWrapper) RequestHeadersByHash(h common.Hash, amount int, skip int, reverse bool) error {
return w.peer.RequestHeadersByHash(h, amount, skip, reverse) return w.peer.RequestHeadersByHash(h, amount, skip, reverse)
} }
func (w *lightPeerWrapper) RequestHeadersByNumber(i uint64, amount int, skip int, reverse bool) error { func (w *lightPeerWrapper) RequestHeadersByNumber(i uint64, amount int, skip int, reverse bool) error {
return w.peer.RequestHeadersByNumber(i, amount, skip, reverse) return w.peer.RequestHeadersByNumber(i, amount, skip, reverse)
} }
func (w *lightPeerWrapper) RequestBodies([]common.Hash) error { func (w *lightPeerWrapper) RequestBodies([]common.Hash) error {
panic("RequestBodies not supported in light client mode sync") panic("RequestBodies not supported in light client mode sync")
} }
func (w *lightPeerWrapper) RequestReceipts([]common.Hash) error { func (w *lightPeerWrapper) RequestReceipts([]common.Hash) error {
panic("RequestReceipts not supported in light client mode sync") panic("RequestReceipts not supported in light client mode sync")
} }
func (w *lightPeerWrapper) RequestNodeData([]common.Hash) error { func (w *lightPeerWrapper) RequestNodeData([]common.Hash) error {
panic("RequestNodeData not supported in light client mode sync") panic("RequestNodeData not supported in light client mode sync")
} }

View file

@ -803,7 +803,6 @@ func (q *queue) DeliverReceipts(id string, receiptList [][]*types.Receipt) (int,
func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQueue *prque.Prque, func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, taskQueue *prque.Prque,
pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}, reqTimer metrics.Timer, pendPool map[string]*fetchRequest, donePool map[common.Hash]struct{}, reqTimer metrics.Timer,
results int, reconstruct func(header *types.Header, index int, result *fetchResult) error) (int, error) { results int, reconstruct func(header *types.Header, index int, result *fetchResult) error) (int, error) {
// Short circuit if the data was never requested // Short circuit if the data was never requested
request := pendPool[id] request := pendPool[id]
if request == nil { if request == nil {

View file

@ -39,9 +39,7 @@ const (
blockLimit = 64 // Maximum number of unique blocks a peer may have delivered blockLimit = 64 // Maximum number of unique blocks a peer may have delivered
) )
var ( var errTerminated = errors.New("terminated")
errTerminated = errors.New("terminated")
)
// blockRetrievalFn is a callback type for retrieving a block from the local chain. // blockRetrievalFn is a callback type for retrieving a block from the local chain.
type blockRetrievalFn func(common.Hash) *types.Block type blockRetrievalFn func(common.Hash) *types.Block

View file

@ -18,9 +18,7 @@
package fetcher package fetcher
import ( import "github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics"
)
var ( var (
propAnnounceInMeter = metrics.NewRegisteredMeter("eth/fetcher/prop/announces/in", nil) propAnnounceInMeter = metrics.NewRegisteredMeter("eth/fetcher/prop/announces/in", nil)

View file

@ -34,9 +34,7 @@ import (
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
var ( var deadline = 5 * time.Minute // consider a filter inactive if it has not been polled for within deadline
deadline = 5 * time.Minute // consider a filter inactive if it has not been polled for within deadline
)
// filter is a helper struct that holds meta information over the filter type // filter is a helper struct that holds meta information over the filter type
// and associated subscription in the event system. // and associated subscription in the event system.
@ -251,7 +249,6 @@ func (api *PublicFilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc
} }
go func() { go func() {
for { for {
select { select {
case logs := <-matchedLogs: case logs := <-matchedLogs:

View file

@ -70,9 +70,7 @@ const (
chainEvChanSize = 10 chainEvChanSize = 10
) )
var ( var ErrInvalidSubscriptionID = errors.New("invalid id")
ErrInvalidSubscriptionID = errors.New("invalid id")
)
type subscription struct { type subscription struct {
id rpc.ID id rpc.ID

View file

@ -54,9 +54,7 @@ const (
minBroadcastPeers = 4 minBroadcastPeers = 4
) )
var ( var daoChallengeTimeout = 15 * time.Second // Time allowance for a node to reply to the DAO handshake challenge
daoChallengeTimeout = 15 * time.Second // Time allowance for a node to reply to the DAO handshake challenge
)
// errIncompatibleConfig is returned if the requested protocols and configs are // errIncompatibleConfig is returned if the requested protocols and configs are
// not compatible (low protocol version restrictions and high requirements). // not compatible (low protocol version restrictions and high requirements).

View file

@ -61,18 +61,23 @@ type bindataFileInfo struct {
func (fi bindataFileInfo) Name() string { func (fi bindataFileInfo) Name() string {
return fi.name return fi.name
} }
func (fi bindataFileInfo) Size() int64 { func (fi bindataFileInfo) Size() int64 {
return fi.size return fi.size
} }
func (fi bindataFileInfo) Mode() os.FileMode { func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode return fi.mode
} }
func (fi bindataFileInfo) ModTime() time.Time { func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime return fi.modTime
} }
func (fi bindataFileInfo) IsDir() bool { func (fi bindataFileInfo) IsDir() bool {
return false return false
} }
func (fi bindataFileInfo) Sys() interface{} { func (fi bindataFileInfo) Sys() interface{} {
return nil return nil
} }

View file

@ -54,6 +54,7 @@ func (s *senderFromServer) Sender(tx *types.Transaction) (common.Address, error)
func (s *senderFromServer) Hash(tx *types.Transaction) common.Hash { func (s *senderFromServer) Hash(tx *types.Transaction) common.Hash {
panic("can't sign with senderFromServer") panic("can't sign with senderFromServer")
} }
func (s *senderFromServer) SignatureValues(tx *types.Transaction, sig []byte) (R, S, V *big.Int, err error) { func (s *senderFromServer) SignatureValues(tx *types.Transaction, sig []byte) (R, S, V *big.Int, err error) {
panic("can't sign with senderFromServer") panic("can't sign with senderFromServer")
} }

View file

@ -16,9 +16,7 @@
package graphql package graphql
import ( import "testing"
"testing"
)
func TestBuildSchema(t *testing.T) { func TestBuildSchema(t *testing.T) {
// Make sure the schema can be parsed and matched up to the object model. // Make sure the schema can be parsed and matched up to the object model.

Some files were not shown because too many files have changed in this diff Show more