Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit d63ff38

Browse files
committed
Temp fix SignAndVerifyListing test
1 parent 9bbd62a commit d63ff38

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

core/order.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (n *OpenBazaarNode) Purchase(data *repo.PurchaseData) (orderID string, paym
162162
}
163163

164164
if wal.IsDust(*total) {
165-
return "", "", retCurrency, false, ErrSpendAmountIsDust
165+
return "", "", retCurrency, false, ErrSpendAmountIsDust
166166
}
167167

168168
payment.BigAmount = total.String()

repo/signed_listing_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ package repo_test
22

33
import (
44
"bytes"
5+
"crypto/rand"
6+
crypto "gx/ipfs/QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK/go-libp2p-crypto"
7+
peer "gx/ipfs/QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h/go-libp2p-peer"
58
"math/big"
69
"testing"
710

@@ -200,6 +203,20 @@ func TestSignAndVerifyListing(t *testing.T) {
200203
if err != nil {
201204
t.Fatalf("create test node: %v", err)
202205
}
206+
207+
priv, pub, err := crypto.GenerateEd25519Key(rand.Reader)
208+
if err != nil {
209+
t.Fatal(err)
210+
}
211+
212+
pid, err := peer.IDFromPublicKey(pub)
213+
if err != nil {
214+
t.Fatal(err)
215+
}
216+
217+
testnode.IpfsNode.Identity = pid
218+
testnode.IpfsNode.PrivateKey = priv
219+
203220
lpb := factory.NewListing("test")
204221
l, err := repo.NewListingFromProtobuf(lpb)
205222
if err != nil {

0 commit comments

Comments
 (0)