Skip to content

Commit

Permalink
Improve function docs
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
  • Loading branch information
peterbroadhurst committed Jun 27, 2022
1 parent 7500b71 commit 86d9540
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (e *Entry) GenerateFunctionSelectorCtx(ctx context.Context) ([]byte, error)
}

// FunctionSelectorBytes is a convenience function to get the ID as bytes.
// Will return a nil 4 bytes on error
// Will return all zeros on error (ensures non-nil)
func (e *Entry) FunctionSelectorBytes() ethtypes.HexBytes0xPrefix {
id, err := e.GenerateFunctionSelector()
if err != nil {
Expand Down Expand Up @@ -447,6 +447,8 @@ func (e *Entry) SignatureHashCtx(context.Context) (ethtypes.HexBytes0xPrefix, er
return hash.Sum(nil), nil
}

// SignatureHashBytes is a convenience function to get the signature hash as bytes.
// Will return all zeros on error (ensures non-nil)
func (e *Entry) SignatureHashBytes() ethtypes.HexBytes0xPrefix {
sh, err := e.SignatureHashCtx(context.Background())
if err != nil {
Expand Down

0 comments on commit 86d9540

Please sign in to comment.