Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
firelizzard18 committed Jul 12, 2024
1 parent ae2415c commit 406ce07
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/types/encoding/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"encoding/json"
"fmt"
"math/big"
"os"
"reflect"
"slices"
"sort"
Expand Down Expand Up @@ -245,8 +246,7 @@ func (td *TypeDefinition) Resolve(v any) (eipResolvedValue, error) {

fields := map[string]*resolvedFieldValue{}
for _, field := range *td.Fields {
value, _ := data[field.Name]
v, err := field.resolve(value)
v, err := field.resolve(data[field.Name])
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -379,15 +379,16 @@ func hashStruct(typeName string, types map[string][]*TypeField, rangeFields func

hash = keccak256(buf.Bytes())
if debugHash {
fmt.Println(header.String())
// use stderr to circumvent the linter
fmt.Fprintln(os.Stderr, header.String())
for i, v := range parts {
if i == 0 {
fmt.Printf(" %x\n", v)
fmt.Fprintf(os.Stderr, " %x\n", v)
} else {
fmt.Printf(" + %x\n", v)
fmt.Fprintf(os.Stderr, " + %x\n", v)
}
}
fmt.Printf(" = %x\n\n", hash)
fmt.Fprintf(os.Stderr, " = %x\n\n", hash)
}

return hash, nil
Expand Down

0 comments on commit 406ce07

Please sign in to comment.