Skip to content

Commit 7360a7e

Browse files
committed
merge
2 parents 003f7f9 + 8d7d6e3 commit 7360a7e

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

sign.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ func SignMessage(privateKey string, message string) (string, error) {
2929

3030
// Create the hash
3131
messageHash := chainhash.DoubleHashB(buf.Bytes())
32+
<<<<<<< HEAD
3233
// fmt.Printf("%x", messageHash)
34+
=======
35+
36+
>>>>>>> 8d7d6e33b2784fbeaf5bd30a409422d3bd573994
3337
// Get the private key
3438
var ecdsaPrivateKey *bsvec.PrivateKey
3539
if ecdsaPrivateKey, err = PrivateKeyFromString(privateKey); err != nil {

sign_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package bitcoin
22

33
import (
4+
"fmt"
45
"testing"
56
)
67

@@ -97,15 +98,15 @@ func TestSignMessage(t *testing.T) {
9798
}
9899

99100
// ExampleSignMessage example using SignMessage()
100-
// func ExampleSignMessage() {
101-
// signature, err := SignMessage("ef0b8bad0be285099534277fde328f8f19b3be9cadcd4c08e6ac0b5f863745ac", "This is a test message")
102-
// if err != nil {
103-
// fmt.Printf("error occurred: %s", err.Error())
104-
// return
105-
// }
106-
// fmt.Printf("signature created: %s", signature)
107-
// // Output:signature created: H+zZagsyz7ioC/ZOa5EwsaKice0vs2BvZ0ljgkFHxD3vGsMlGeD4sXHEcfbI4h8lP29VitSBdf4A+nHXih7svf4=
108-
// }
101+
func ExampleSignMessage() {
102+
signature, err := SignMessage("ef0b8bad0be285099534277fde328f8f19b3be9cadcd4c08e6ac0b5f863745ac", "This is a test message")
103+
if err != nil {
104+
fmt.Printf("error occurred: %s", err.Error())
105+
return
106+
}
107+
fmt.Printf("signature created: %s", signature)
108+
// Output:signature created: H+zZagsyz7ioC/ZOa5EwsaKice0vs2BvZ0ljgkFHxD3vGsMlGeD4sXHEcfbI4h8lP29VitSBdf4A+nHXih7svf4=
109+
}
109110

110111
// BenchmarkSignMessage benchmarks the method SignMessage()
111112
func BenchmarkSignMessage(b *testing.B) {

verify_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,17 @@ func TestVerifyMessage(t *testing.T) {
3434
},
3535
{
3636
"1LN5p7Eg9Zju1b4g4eFPTBMPoMZGCxzrET",
37-
"IFTYA0Vd/fBSl8XwgTDNcQ6LxIl6+Pz7wrOgNs1qyr/zb7R7FZvdISLHp6/TlHvUYqFzWvGbX1WvHPvrYXPkVx8=",
38-
"This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af. This time I'm writing a new message that is obnixiously long af.",
37+
"IKmgOFrfWRffRNjrQcJQHSBD7WL2di+4doWdaz/a/p5RUiT7ErpUqbYeLi0yzmONFaV8uLWF2vydTjA8W8KnjZU=",
38+
"This time I'm writing a new message that is obnoxiously long af. This time I'm writing a " +
39+
"new message that is obnoxiously long af. This time I'm writing a new message that is obnoxiously " +
40+
"long af. This time I'm writing a new message that is obnoxiously long af. This time I'm writing a " +
41+
"new message that is obnoxiously long af. This time I'm writing a new message that is obnoxiously " +
42+
"long af. This time I'm writing a new message that is obnoxiously long af. This time I'm writing a " +
43+
"new message that is obnoxiously long af. This time I'm writing a new message that is obnoxiously " +
44+
"long af. This time I'm writing a new message that is obnoxiously long af. This time I'm writing a " +
45+
"new message that is obnoxiously long af. This time I'm writing a new message that is obnoxiously " +
46+
"long af. This time I'm writing a new message that is obnoxiously long af. This time I'm writing a " +
47+
"new message that is obnoxiously long af.",
3948
false,
4049
},
4150
{

0 commit comments

Comments
 (0)