Skip to content

Commit

Permalink
add noop error check
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Apr 14, 2021
1 parent 7e9bc8a commit 7ee294b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions types/address/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ type Addressable interface {
// Hash creates a new address from address type and key
func Hash(typ string, key []byte) []byte {
hasher := sha256.New()
hasher.Write(conv.UnsafeStrToBytes(typ))
_, err := hasher.Write(conv.UnsafeStrToBytes(typ))
// the error always nil, it's here only to satisfy the io.Writer interface
errors.AssertNil(err)
th := hasher.Sum(nil)

hasher.Reset()
_, err := hasher.Write(th)
// the error always nil, it's here only to satisfy the io.Writer interface
_, err = hasher.Write(th)
errors.AssertNil(err)
_, err = hasher.Write(key)
errors.AssertNil(err)
Expand Down

0 comments on commit 7ee294b

Please sign in to comment.