Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Return empty announcements instead of error; go eth ecrecover lib com…
Browse files Browse the repository at this point in the history
…patibility
  • Loading branch information
Kyle committed Oct 12, 2023
1 parent 9ad91ab commit 0dcf5ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion interchaintest/tests/hyperlane_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func generateHyperlaneValidatorConfig(bech32, privKey, chainID, chainName, rpcUr
"chains": {
"%s": {
"connection": { "rpc_url": "%s", "grpc_url": "%s", "chain_id": "%s" },
"signer": { "type":"cosmosKey", "key": "%s", "prefix": "cosmos", "baseDenom": "stake"},
"signer": { "type":"cosmosKey", "key": "%s", "prefix": "cosmos", "base_denom": "stake"},
"name": "%s",
"domain": %d,
"addresses": {
Expand Down
2 changes: 1 addition & 1 deletion x/announce/keeper/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (k Keeper) getAnnouncements(ctx sdk.Context, validator []byte) (*types.Stor
announcements := &types.StoredAnnouncements{}

if announceBytes == nil {
return nil, errors.New("No announcements stored for validator")
return announcements, nil
}

err := announcements.Unmarshal(announceBytes)
Expand Down
4 changes: 4 additions & 0 deletions x/announce/types/announcement.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func toEthSignedMessageHash(packedHash []byte) []byte {
}

func VerifyAnnouncementDigest(digest []byte, signature []byte, expectedSigner []byte) error {
if signature[64] >= 4 {
signature[64] = signature[64] - 27
}

sigPublicKey, err := crypto.Ecrecover(digest, signature)
if err != nil {
return err
Expand Down

0 comments on commit 0dcf5ed

Please sign in to comment.