Skip to content

Commit

Permalink
chore: add annotation for tmSignatureRecover (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 authored Nov 10, 2023
1 parent 19026ec commit 5509d7d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/vm/contracts_lightclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,16 @@ func (c *tmSignatureRecover) RequiredGas(input []byte) uint64 {
}

const (
tmPubKeyLength uint8 = 33
tmSignatureLength uint8 = 64
tmSignatureMsgLength uint8 = 32
tmPubKeyLength uint8 = 33
tmSignatureLength uint8 = 64
tmSignatureMsgHashLength uint8 = 32
)

// input:
// | tmPubKey | tmSignature | tmSignatureMsgHash |
// | 33 bytes | 64 bytes | 32 bytes |
func (c *tmSignatureRecover) Run(input []byte) (result []byte, err error) {
if len(input) != int(tmPubKeyLength)+int(tmSignatureLength)+int(tmSignatureMsgLength) {
if len(input) != int(tmPubKeyLength)+int(tmSignatureLength)+int(tmSignatureMsgHashLength) {
return nil, fmt.Errorf("invalid input")
}

Expand Down

0 comments on commit 5509d7d

Please sign in to comment.