mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
rpc: simplify suitableCallbacks
This commit is contained in:
parent
1ff152f3a4
commit
1af79d14dd
1 changed files with 10 additions and 18 deletions
28
rpc/utils.go
28
rpc/utils.go
|
|
@ -133,30 +133,22 @@ METHODS:
|
||||||
firstArg = 2
|
firstArg = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
if h.isSubscribe {
|
|
||||||
h.argTypes = make([]reflect.Type, numIn-firstArg) // skip rcvr type
|
|
||||||
for i := firstArg; i < numIn; i++ {
|
|
||||||
argType := mtype.In(i)
|
|
||||||
if isExportedOrBuiltinType(argType) {
|
|
||||||
h.argTypes[i-firstArg] = argType
|
|
||||||
} else {
|
|
||||||
continue METHODS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subscriptions[mname] = &h
|
|
||||||
continue METHODS
|
|
||||||
}
|
|
||||||
|
|
||||||
// determine method arguments, ignore first arg since it's the receiver type
|
// determine method arguments, ignore first arg since it's the receiver type
|
||||||
// Arguments must be exported or builtin types
|
|
||||||
h.argTypes = make([]reflect.Type, numIn-firstArg)
|
h.argTypes = make([]reflect.Type, numIn-firstArg)
|
||||||
for i := firstArg; i < numIn; i++ {
|
for i := firstArg; i < numIn; i++ {
|
||||||
argType := mtype.In(i)
|
argType := mtype.In(i)
|
||||||
if !isExportedOrBuiltinType(argType) {
|
|
||||||
|
// Arguments must be exported or builtin types
|
||||||
|
if isExportedOrBuiltinType(argType) {
|
||||||
|
h.argTypes[i-firstArg] = argType
|
||||||
|
} else {
|
||||||
continue METHODS
|
continue METHODS
|
||||||
}
|
}
|
||||||
h.argTypes[i-firstArg] = argType
|
}
|
||||||
|
|
||||||
|
if h.isSubscribe {
|
||||||
|
subscriptions[mname] = &h
|
||||||
|
continue METHODS
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that all returned values are exported or builtin types
|
// check that all returned values are exported or builtin types
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue