From 586e2d7abf88891db5442f098678315278fd64e4 Mon Sep 17 00:00:00 2001 From: mrz1836 Date: Fri, 30 Oct 2020 13:27:36 -0400 Subject: [PATCH] Removed max length on message for testing --- verify.go | 9 ++++++--- verify_test.go | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/verify.go b/verify.go index 711cf9c..00c5035 100644 --- a/verify.go +++ b/verify.go @@ -94,9 +94,12 @@ func messageHash(message, header string) ([]byte, error) { return nil, fmt.Errorf("long header is not supported") } messageLength := len(message) - if messageLength >= 0xfd { - return nil, fmt.Errorf("long message is not supported") - } + /* + // @mrz testing with no limit to the size of the message + if messageLength >= 0xfd { + return nil, fmt.Errorf("long message is not supported") + } + */ bitcoinMsg := string([]byte{byte(headerLength)}) bitcoinMsg += header bitcoinMsg += string([]byte{byte(messageLength)}) diff --git a/verify_test.go b/verify_test.go index 8601397..27037eb 100644 --- a/verify_test.go +++ b/verify_test.go @@ -89,8 +89,9 @@ func TestVerifyMessageMessageHash(t *testing.T) { {"example message", hBSV, "002c483012a3c71d36349682d5ef6495926d4712b5cd2462f1e3c9f57bd4449f", false}, {"", hBSV, "80e795d4a4caadd7047af389d9f7f220562feb6196032e2131e10563352c4bcc", false}, {"example message", "", "f91e1e5a01b6aad5ec785946e4233b0613bf6183ffde8da9879949cbf7d7ca57", false}, - {"4qdD3HdK7SC4R9wTgfhr4QkNqRCKunbtRFlYPRYY6lGPiTbA9wZplnscnazyK0NMAx3KtvjDwWIX4J8djkSIYZaSNFEmztekNoe8NR0MLydp21U6Ayfm97oHelvTBcI5hQYccY45oI2KKEB1gyS0V6pbxoDtgjbCAGcnQvLB2iFykNcdU7A6Yntx812tKp90KilPADcEoKfkexMddqJ1pMz262MNhpTWmC4QOFMlB3xB5iTy2fxm6DgT3QLkiesk3kwM", "", "", true}, {"", "4qdD3HdK7SC4R9wTgfhr4QkNqRCKunbtRFlYPRYY6lGPiTbA9wZplnscnazyK0NMAx3KtvjDwWIX4J8djkSIYZaSNFEmztekNoe8NR0MLydp21U6Ayfm97oHelvTBcI5hQYccY45oI2KKEB1gyS0V6pbxoDtgjbCAGcnQvLB2iFykNcdU7A6Yntx812tKp90KilPADcEoKfkexMddqJ1pMz262MNhpTWmC4QOFMlB3xB5iTy2fxm6DgT3QLkiesk3kwM", "", true}, + // @mrz - Disabled testing message length + // {"4qdD3HdK7SC4R9wTgfhr4QkNqRCKunbtRFlYPRYY6lGPiTbA9wZplnscnazyK0NMAx3KtvjDwWIX4J8djkSIYZaSNFEmztekNoe8NR0MLydp21U6Ayfm97oHelvTBcI5hQYccY45oI2KKEB1gyS0V6pbxoDtgjbCAGcnQvLB2iFykNcdU7A6Yntx812tKp90KilPADcEoKfkexMddqJ1pMz262MNhpTWmC4QOFMlB3xB5iTy2fxm6DgT3QLkiesk3kwM", "", "", true}, } // Run tests