Apply suggestions from code review

Co-Authored-By: Adam Babik <a.babik@designfortress.com>
This commit is contained in:
Samuel Hawksby-Robinson 2020-04-09 12:21:47 +01:00 committed by Andrea Maria Piana
parent 960284056b
commit 91e1bdc8ce

View File

@ -11,8 +11,10 @@ import (
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
) )
// statusOptionKey is a current type used in statusOptions as a key.
type statusOptionKey uint type statusOptionKey uint
// statusOptionKeyType is a type of a statusOptions key used for a particular instance of statusOptions struct.
type statusOptionKeyType uint type statusOptionKeyType uint
type statusOptionKeyToType struct { type statusOptionKeyToType struct {
@ -22,7 +24,7 @@ type statusOptionKeyToType struct {
} }
const ( const (
sOKTS statusOptionKeyType = iota // Status Option Key Type String sOKTS statusOptionKeyType = iota + 1 // Status Option Key Type String
sOKTU // Status Option Key Type Uint sOKTU // Status Option Key Type Uint
) )
@ -220,7 +222,7 @@ func (o *statusOptions) addKeyToType(ktt *statusOptionKeyToType) {
o.keyTypeMapping.keyFieldIdx[ktt.Key] = ktt o.keyTypeMapping.keyFieldIdx[ktt.Key] = ktt
} }
func (k statusOptionKeyToType) decodeStream(s *rlp.Stream) error { func (k *statusOptionKeyToType) decodeStream(s *rlp.Stream) error {
var key statusOptionKey var key statusOptionKey
// If uint can be decoded return it // If uint can be decoded return it