From b932c5711c73152b0fdff723ac2f98043812f3c0 Mon Sep 17 00:00:00 2001 From: Chihyun Song Date: Tue, 25 Jun 2024 18:03:58 +0900 Subject: [PATCH 1/3] Remove klaytn from ecrecover error --- api/api_private_account.go | 2 +- api/api_public_transaction_pool.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api_private_account.go b/api/api_private_account.go index 3786ac9bf..e3632837e 100644 --- a/api/api_private_account.go +++ b/api/api_private_account.go @@ -492,7 +492,7 @@ func (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Byt return common.Address{}, errors.New("signature must be 65 bytes long") } if sig[crypto.RecoveryIDOffset] != 27 && sig[crypto.RecoveryIDOffset] != 28 { - return common.Address{}, errors.New("invalid Klaytn signature (V is not 27 or 28)") + return common.Address{}, errors.New("invalid signature (V is not 27 or 28)") } // Transform yellow paper V from 27/28 to 0/1 diff --git a/api/api_public_transaction_pool.go b/api/api_public_transaction_pool.go index c7c7ad976..cf6846a1c 100644 --- a/api/api_public_transaction_pool.go +++ b/api/api_public_transaction_pool.go @@ -600,7 +600,7 @@ func (s *PublicTransactionPoolAPI) RecoverFromMessage( return common.Address{}, fmt.Errorf("signature must be 65 bytes long") } if sig[crypto.RecoveryIDOffset] != 27 && sig[crypto.RecoveryIDOffset] != 28 { - return common.Address{}, fmt.Errorf("invalid Klaytn signature (V is not 27 or 28)") + return common.Address{}, fmt.Errorf("invalid signature (V is not 27 or 28)") } // Transform yellow paper V from 27/28 to 0/1 From 41d39cdf9b11c6e2f4287bcf890036d5d39f67a6 Mon Sep 17 00:00:00 2001 From: Chihyun Song Date: Tue, 25 Jun 2024 18:08:01 +0900 Subject: [PATCH 2/3] Fix PR template --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8ab6ef8ac..27e35fbbc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,10 +13,10 @@ Please put an x in the boxes related to your change. ## Checklist -*Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.* +_Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._ -- [ ] I have read the [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/kaiachain/kaia/blob/main/CONTRIBUTING.md) doc -- [ ] I have read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) and signed by comment ```I have read the CLA Document and I hereby sign the CLA``` in first time contribute +- [ ] I have read the [CONTRIBUTING GUIDELINES](https://github.com/kaiachain/kaia/blob/main/CONTRIBUTING.md) doc +- [ ] I have read the [CLA](https://gist.github.com/kaiachain-dev/bbf65cc330275c057463c4c94ce787a6) and signed by comment `I have read the CLA Document and I hereby sign the CLA` in first time contribute - [ ] Lint and unit tests pass locally with my changes (`$ make test`) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation (if appropriate) From ad5cbbf8452f85b0d9e84b762b02520aa3538176 Mon Sep 17 00:00:00 2001 From: Chihyun Song Date: Wed, 26 Jun 2024 10:25:31 +0900 Subject: [PATCH 3/3] Fix linter issue --- api/api_public_transaction_pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api_public_transaction_pool.go b/api/api_public_transaction_pool.go index cf6846a1c..d21e8f214 100644 --- a/api/api_public_transaction_pool.go +++ b/api/api_public_transaction_pool.go @@ -597,10 +597,10 @@ func (s *PublicTransactionPoolAPI) RecoverFromMessage( ctx context.Context, address common.Address, data, sig hexutil.Bytes, blockNumber rpc.BlockNumber, ) (common.Address, error) { if len(sig) != crypto.SignatureLength { - return common.Address{}, fmt.Errorf("signature must be 65 bytes long") + return common.Address{}, errors.New("signature must be 65 bytes long") } if sig[crypto.RecoveryIDOffset] != 27 && sig[crypto.RecoveryIDOffset] != 28 { - return common.Address{}, fmt.Errorf("invalid signature (V is not 27 or 28)") + return common.Address{}, errors.New("invalid signature (V is not 27 or 28)") } // Transform yellow paper V from 27/28 to 0/1