You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by cm...@apache.org on 2019/10/11 09:56:13 UTC
[incubator-milagro-dta] branch tendermint updated (bb3e96d ->
d36c3ed)
This is an automated email from the ASF dual-hosted git repository.
cmorris pushed a change to branch tendermint
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git.
from bb3e96d Merge branch 'tendermint' of ssh://github.com/apache/incubator-milagro-dta into tendermint
new 5a806f0 Fix e2e tests
new 1595b33 Convert OrderRef to 32Bytes random number
new d36c3ed Add OrderReference Signature to Order
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
cmd/service/main.go | 4 +-
cmd/servicetester/e2e_test.sh | 68 +++++++++--------
cmd/servicetester/fulltest.sh | 10 ++-
go.mod | 1 +
libs/documents/docs.pb.go | 172 ++++++++++++++++++++++--------------------
libs/documents/docs.proto | 13 ++--
pkg/common/common.go | 21 +++++-
pkg/defaultservice/order.go | 22 +++---
8 files changed, 175 insertions(+), 136 deletions(-)
[incubator-milagro-dta] 03/03: Add OrderReference Signature to Order
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmorris pushed a commit to branch tendermint
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git
commit d36c3ed6be4dc3e7074d3c0ffaf5e0bd4d6f0dd1
Author: Christopher Morris <ch...@morris.net>
AuthorDate: Fri Oct 11 10:55:57 2019 +0100
Add OrderReference Signature to Order
---
libs/documents/docs.pb.go | 172 +++++++++++++++++++++++---------------------
libs/documents/docs.proto | 13 ++--
pkg/common/common.go | 12 +++-
pkg/defaultservice/order.go | 22 +++---
4 files changed, 120 insertions(+), 99 deletions(-)
diff --git a/libs/documents/docs.pb.go b/libs/documents/docs.pb.go
index b8fe2ee..a57e80a 100644
--- a/libs/documents/docs.pb.go
+++ b/libs/documents/docs.pb.go
@@ -5,10 +5,11 @@ package documents
import (
fmt "fmt"
+ math "math"
+
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
- math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -420,12 +421,13 @@ type OrderDocument struct {
PrincipalCID string `protobuf:"bytes,4,opt,name=PrincipalCID,proto3" json:"PrincipalCID,omitempty"`
BeneficiaryCID string `protobuf:"bytes,5,opt,name=BeneficiaryCID,proto3" json:"BeneficiaryCID,omitempty"`
Reference string `protobuf:"bytes,6,opt,name=Reference,proto3" json:"Reference,omitempty"`
- Timestamp int64 `protobuf:"varint,7,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
- OrderPart2 *OrderPart2 `protobuf:"bytes,8,opt,name=OrderPart2,proto3" json:"OrderPart2,omitempty"`
- OrderPart3 *OrderPart3 `protobuf:"bytes,9,opt,name=OrderPart3,proto3" json:"OrderPart3,omitempty"`
- OrderPart4 *OrderPart4 `protobuf:"bytes,10,opt,name=OrderPart4,proto3" json:"OrderPart4,omitempty"`
- OrderReqExtension map[string]string `protobuf:"bytes,11,rep,name=OrderReqExtension,proto3" json:"OrderReqExtension,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- OrderSecretReqExtension map[string]string `protobuf:"bytes,12,rep,name=OrderSecretReqExtension,proto3" json:"OrderSecretReqExtension,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ ReferenceSignature []byte `protobuf:"bytes,7,opt,name=ReferenceSignature,proto3" json:"ReferenceSignature,omitempty"`
+ Timestamp int64 `protobuf:"varint,8,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"`
+ OrderPart2 *OrderPart2 `protobuf:"bytes,9,opt,name=OrderPart2,proto3" json:"OrderPart2,omitempty"`
+ OrderPart3 *OrderPart3 `protobuf:"bytes,10,opt,name=OrderPart3,proto3" json:"OrderPart3,omitempty"`
+ OrderPart4 *OrderPart4 `protobuf:"bytes,11,opt,name=OrderPart4,proto3" json:"OrderPart4,omitempty"`
+ OrderReqExtension map[string]string `protobuf:"bytes,12,rep,name=OrderReqExtension,proto3" json:"OrderReqExtension,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ OrderSecretReqExtension map[string]string `protobuf:"bytes,13,rep,name=OrderSecretReqExtension,proto3" json:"OrderSecretReqExtension,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -498,6 +500,13 @@ func (m *OrderDocument) GetReference() string {
return ""
}
+func (m *OrderDocument) GetReferenceSignature() []byte {
+ if m != nil {
+ return m.ReferenceSignature
+ }
+ return nil
+}
+
func (m *OrderDocument) GetTimestamp() int64 {
if m != nil {
return m.Timestamp
@@ -926,78 +935,79 @@ func init() {
func init() { proto.RegisterFile("docs.proto", fileDescriptor_2a25dace11219bce) }
var fileDescriptor_2a25dace11219bce = []byte{
- // 1160 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6f, 0x1b, 0x45,
- 0x14, 0xc7, 0x1f, 0x71, 0xea, 0x67, 0xd7, 0x75, 0xa6, 0x4e, 0x62, 0x99, 0xa8, 0x89, 0x56, 0x11,
- 0x0a, 0x12, 0x71, 0x88, 0xed, 0x44, 0x25, 0xaa, 0x84, 0xb0, 0x1d, 0xc0, 0x94, 0x0f, 0x33, 0x4e,
- 0x03, 0x52, 0x95, 0x46, 0x9b, 0xdd, 0x89, 0x33, 0x8a, 0x3d, 0xb3, 0xec, 0x8e, 0x93, 0x5a, 0xc0,
- 0x99, 0x03, 0x47, 0xfe, 0x00, 0x24, 0xa4, 0x5e, 0x39, 0x22, 0x71, 0x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,
+ // 1171 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
+ 0x14, 0xc7, 0x7f, 0xe2, 0xc4, 0xcf, 0xae, 0xeb, 0x4e, 0x9d, 0x64, 0x65, 0xa2, 0x26, 0x5a, 0x45,
+ 0x28, 0x48, 0xc4, 0x21, 0xb6, 0x13, 0x95, 0xa8, 0x12, 0xc2, 0x76, 0x00, 0x53, 0xfe, 0x98, 0x75,
+ 0x1a, 0x90, 0xaa, 0x34, 0xda, 0xec, 0x4e, 0x9c, 0x51, 0xbc, 0x33, 0xcb, 0xee, 0x38, 0xa9, 0x05,
+ 0x9c, 0x39, 0x70, 0xe4, 0x03, 0x20, 0x55, 0xea, 0x95, 0x23, 0x12, 0x77, 0xbe, 0x47, 0xa4, 0x20,
+ 0x81, 0xf8, 0x06, 0xdc, 0x40, 0x33, 0xbb, 0xeb, 0xdd, 0x75, 0xec, 0xa4, 0x15, 0x54, 0x22, 0xa7,
+ 0x79, 0x7f, 0x7e, 0xef, 0xbd, 0x79, 0xef, 0xf7, 0x76, 0x1c, 0x00, 0x93, 0x19, 0x6e, 0xc5, 0x76,
+ 0x18, 0x67, 0x28, 0x6b, 0x32, 0x63, 0x60, 0x61, 0xca, 0xdd, 0xf2, 0x76, 0x8f, 0xf0, 0x93, 0xc1,
+ 0x51, 0xc5, 0x60, 0xd6, 0x86, 0x75, 0x4e, 0xf8, 0x29, 0x3b, 0xdf, 0xe8, 0xb1, 0x75, 0xe9, 0xb7,
+ 0x7e, 0xa6, 0xf7, 0x89, 0xa9, 0x73, 0xe6, 0xb8, 0x1b, 0xa3, 0xa3, 0x17, 0xa2, 0xbc, 0x1e, 0xc1,
+ 0xf5, 0x58, 0x8f, 0x6d, 0x48, 0xf5, 0xd1, 0xe0, 0x58, 0x4a, 0x52, 0x90, 0x27, 0xcf, 0x5d, 0xfd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0, 0x93, 0xfe, 0xff, 0x3c, 0xac,
+ 0xbf, 0xb2, 0x0e, 0x6d, 0x43, 0xa6, 0xc3, 0xfa, 0xc4, 0x18, 0x5e, 0xf3, 0x83, 0x0c, 0x41, 0xfa,
+ 0x53, 0xdd, 0x0a, 0xc0, 0xf2, 0xac, 0x6e, 0xc2, 0x9d, 0x4e, 0x5f, 0x27, 0x74, 0x0f, 0xbb, 0xdc,
+ 0xff, 0xd9, 0xbf, 0x89, 0x96, 0x20, 0x2b, 0x8c, 0x1c, 0xbb, 0x7c, 0xd3, 0x4f, 0x1f, 0x2a, 0xd4,
+ 0x1a, 0xdc, 0xf5, 0xf9, 0x34, 0x0d, 0x54, 0x1d, 0x07, 0x55, 0xd5, 0x35, 0xc8, 0x77, 0x89, 0x65,
+ 0xf7, 0x71, 0x97, 0x3b, 0x84, 0xf6, 0x44, 0x95, 0x4d, 0x46, 0x39, 0xa6, 0xc1, 0x0c, 0x03, 0xf1,
+ 0x28, 0x23, 0xff, 0x13, 0xaa, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x3c, 0x74, 0x10, 0x00, 0x89,
+ 0x0d, 0x00, 0x00,
}
diff --git a/libs/documents/docs.proto b/libs/documents/docs.proto
index 0abd82c..fcb2b8a 100644
--- a/libs/documents/docs.proto
+++ b/libs/documents/docs.proto
@@ -106,12 +106,13 @@ message OrderDocument {
string PrincipalCID = 4 [(validator.field) = {regex: "^Q[[:alnum:]]{45}$|^$"}]; //empty if ok
string BeneficiaryCID = 5 [(validator.field) = {regex: "^Q[[:alnum:]]{45}$|^$"}]; //empty if ok
string Reference = 6 [(validator.field) = {string_not_empty:true}]; //an id for this order e.g. walletID
- int64 Timestamp = 7 [(validator.field) = {int_gt:1564050341,int_lt:32521429541}];
- OrderPart2 OrderPart2 = 8;
- OrderPart3 OrderPart3 = 9;
- OrderPart4 OrderPart4 = 10;
- map<string, string> OrderReqExtension = 11;
- map<string, string> OrderSecretReqExtension = 12;
+ bytes ReferenceSignature = 7;
+ int64 Timestamp = 8 [(validator.field) = {int_gt:1564050341,int_lt:32521429541}];
+ OrderPart2 OrderPart2 = 9;
+ OrderPart3 OrderPart3 = 10;
+ OrderPart4 OrderPart4 = 11;
+ map<string, string> OrderReqExtension = 12;
+ map<string, string> OrderSecretReqExtension = 13;
}
diff --git a/pkg/common/common.go b/pkg/common/common.go
index 5a50939..f7b6aa0 100644
--- a/pkg/common/common.go
+++ b/pkg/common/common.go
@@ -28,6 +28,7 @@ import (
"github.com/apache/incubator-milagro-dta/pkg/tendermint"
"github.com/mr-tron/base58"
+ "github.com/apache/incubator-milagro-dta/libs/crypto"
"github.com/apache/incubator-milagro-dta/libs/cryptowallet"
"github.com/apache/incubator-milagro-dta/libs/datastore"
"github.com/apache/incubator-milagro-dta/libs/documents"
@@ -35,7 +36,7 @@ import (
)
// CreateNewDepositOrder - Generate an empty new Deposit Order with random reference
-func CreateNewDepositOrder(BeneficiaryIDDocumentCID string, nodeID string, orderType string) (*documents.OrderDoc, error) {
+func CreateNewDepositOrder(BeneficiaryIDDocumentCID string, nodeID string, orderType string, blsSK []byte) (*documents.OrderDoc, error) {
//Create a reference for this order
refBytes, err := cryptowallet.RandomBytes(32)
reference := base58.Encode(refBytes[:])
@@ -55,6 +56,15 @@ func CreateNewDepositOrder(BeneficiaryIDDocumentCID string, nodeID string, order
order.Type = orderType
order.PrincipalCID = nodeID
order.Reference = reference
+
+ rc, signature := crypto.BLSSign([]byte(reference), blsSK)
+
+ if rc != 0 {
+ return &documents.OrderDoc{}, errors.New("Failed to sign order reference")
+ }
+
+ order.ReferenceSignature = signature
+
order.BeneficiaryCID = BeneficiaryIDDocumentCID
order.Timestamp = time.Now().Unix()
return &order, nil
diff --git a/pkg/defaultservice/order.go b/pkg/defaultservice/order.go
index d5fc403..f613fa8 100644
--- a/pkg/defaultservice/order.go
+++ b/pkg/defaultservice/order.go
@@ -142,8 +142,18 @@ func (s *Service) Order(req *api.OrderRequest) (string, error) {
return "", err
}
+ // BLS key
+ keyseed, err := s.KeyStore.Get("seed")
+ if err != nil {
+ return "", err
+ }
+ _, blsSK, err := identity.GenerateBLSKeys(keyseed)
+ if err != nil {
+ return "", err
+ }
+
//Create Order
- order, err := common.CreateNewDepositOrder(beneficiaryIDDocumentCID, nodeID, s.Plugin.Name())
+ order, err := common.CreateNewDepositOrder(beneficiaryIDDocumentCID, nodeID, s.Plugin.Name(), blsSK)
if err != nil {
return "", err
}
@@ -156,16 +166,6 @@ func (s *Service) Order(req *api.OrderRequest) (string, error) {
order.OrderReqExtension[key] = value
}
- // BLS key
- keyseed, err := s.KeyStore.Get("seed")
- if err != nil {
- return "", err
- }
- _, blsSK, err := identity.GenerateBLSKeys(keyseed)
- if err != nil {
- return "", err
- }
-
//Create a new Transaction payload and TX
tx, txID, err := common.CreateOrderTX(nodeID, api.TXFulfillRequest, s.Store, blsSK, order, recipientList, s.MasterFiduciaryNodeID())
s.Logger.Debug("Created new %v Tx: %v", api.TXFulfillRequest, txID)
[incubator-milagro-dta] 02/03: Convert OrderRef to 32Bytes random
number
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmorris pushed a commit to branch tendermint
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git
commit 1595b33367ed18d796c50e5c321d7f92a90df7b2
Author: Christopher Morris <ch...@morris.net>
AuthorDate: Fri Oct 11 10:40:11 2019 +0100
Convert OrderRef to 32Bytes random number
---
pkg/common/common.go | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/pkg/common/common.go b/pkg/common/common.go
index 52c7d0e..5a50939 100644
--- a/pkg/common/common.go
+++ b/pkg/common/common.go
@@ -26,17 +26,20 @@ import (
"time"
"github.com/apache/incubator-milagro-dta/pkg/tendermint"
+ "github.com/mr-tron/base58"
+ "github.com/apache/incubator-milagro-dta/libs/cryptowallet"
"github.com/apache/incubator-milagro-dta/libs/datastore"
"github.com/apache/incubator-milagro-dta/libs/documents"
- "github.com/google/uuid"
"github.com/pkg/errors"
)
// CreateNewDepositOrder - Generate an empty new Deposit Order with random reference
func CreateNewDepositOrder(BeneficiaryIDDocumentCID string, nodeID string, orderType string) (*documents.OrderDoc, error) {
//Create a reference for this order
- reference, err := uuid.NewUUID()
+ refBytes, err := cryptowallet.RandomBytes(32)
+ reference := base58.Encode(refBytes[:])
+
if err != nil {
return nil, err
}
@@ -51,7 +54,7 @@ func CreateNewDepositOrder(BeneficiaryIDDocumentCID string, nodeID string, order
//oder.Type will be used to extend the things that an order can do.
order.Type = orderType
order.PrincipalCID = nodeID
- order.Reference = reference.String()
+ order.Reference = reference
order.BeneficiaryCID = BeneficiaryIDDocumentCID
order.Timestamp = time.Now().Unix()
return &order, nil
[incubator-milagro-dta] 01/03: Fix e2e tests
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmorris pushed a commit to branch tendermint
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git
commit 5a806f0cd29a0755b92e338dfb5bee776fb1f1d9
Author: Christopher Morris <ch...@morris.net>
AuthorDate: Fri Oct 11 10:39:57 2019 +0100
Fix e2e tests
---
cmd/service/main.go | 4 +--
cmd/servicetester/e2e_test.sh | 68 ++++++++++++++++++++++++-------------------
cmd/servicetester/fulltest.sh | 10 +++++--
go.mod | 1 +
4 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/cmd/service/main.go b/cmd/service/main.go
index 88a101d..d34580f 100644
--- a/cmd/service/main.go
+++ b/cmd/service/main.go
@@ -219,8 +219,8 @@ func startDaemon(args []string) error {
case "none":
return nil
case "dump":
- return nil
- // return svcPlugin.Dump(tx)
+ //return nil
+ return svcPlugin.Dump(tx)
case "v1/fulfill/order":
_, err := svcPlugin.FulfillOrder(tx)
return err
diff --git a/cmd/servicetester/e2e_test.sh b/cmd/servicetester/e2e_test.sh
index 236ee29..7d1b0f4 100755
--- a/cmd/servicetester/e2e_test.sh
+++ b/cmd/servicetester/e2e_test.sh
@@ -24,20 +24,27 @@ defaultURL="http://localhost:5556"
apiURL="${1:-$defaultURL}"
configdir=~/.milagro
host="34.246.173.153:26657"
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+ORANGE='\033[0;33m'
+BLUE='\033[1;34m'
+NC='\033[0m' # No Color
+
+
status () {
#Determine if an extension is running
statusOutput=$(curl -s -X GET "$apiURL/$apiVersion/status" -H "accept: */*" -H "Content-Type: application/json")
- echo "$apiURL/$apiVersion/status"
+ #printf "$apiURL/$apiVersion/status\n"
identity=$(echo $statusOutput | jq .nodeCID)
extensionVendor=$(echo $statusOutput | jq -r .extensionVendor)
plugin=$(echo $statusOutput | jq -r .plugin)
- echo "Plugin $plugin"
+ printf "Plugin ${BLUE}$plugin ${NC}\n"
if [ -z "${extensionVendor}" ]; then
- echo "Server Not Running"
+ printf "${RED} Server Not Running{NC}\n"
exit 1
fi
}
@@ -46,38 +53,39 @@ status () {
execute_bitcoin () {
# #Run 4 Tests against the Bitcoin Extension
- echo "Bitcoin Plugin Tests [2 Tests]"
+ echo " Bitcoin Plugin Tests [2 Tests]"
( sleep 1; curl -s -X POST "$apiURL/$apiVersion/order" -H "accept: */*" -H "Content-Type: application/json" -d "{\"beneficiaryIDDocumentCID\":\"\",\"extension\":{\"coin\":\"0\"}}" > ref ) &
output1=$(fishhook $configdir $host "self" 2)
- ref=$(cat ref)
+ ref=$(cat ref | jq .orderReference)
commitment1=$(echo $output1 | jq .OrderPart2.CommitmentPublicKey)
address1=$(echo $output1 | jq .OrderPart2.Extension.address)
(sleep 1; curl -s -X POST "$apiURL/$apiVersion/order/secret" -H "accept: */*" -H "Content-Type: application/json" -d "{\"orderReference\":$ref,\"beneficiaryIDDocumentCID\":$identity}" > /dev/null ) &
+
output2=$(fishhook $configdir $host "self" 2)
address2=$(echo $output2 | jq .OrderPart4.Extension.address)
commitment2=$(echo $output2 | jq .OrderPart4.Extension.FinalPublicKey)
#echo "Committment1 $commitment1 $address1"
#echo "Committment2 $commitment2 $address2"
if [ -z $commitment2 ]; then
- echo "Failed Commitment is empty"
+ printf " ${RED}FAIL${NC} Commitment is empty\n"
exit 1
fi
if [ $commitment1 != $commitment2 ]; then
- echo "Fail"
+ printf " ${RED}FAIL${NC}\n "
exit 1
fi
if [ $address2 != $address2 ]; then
- echo "Fail"
+ printf " ${RED}FAIL${NC}\n "
exit 1
fi
- echo "Pass - Id, Order & OrderSecret(Beneficiary)"
+ printf " ${GREEN}Pass${NC} - Id, Order & OrderSecret(Beneficiary)\n"
( sleep 1; curl -s -X POST "$apiURL/$apiVersion/order" -H "accept: */*" -H "Content-Type: application/json" -d "{\"beneficiaryIDDocumentCID\":$identity,\"extension\":{\"coin\":\"0\"}}" > ref ) &
output1=$(fishhook $configdir $host "self" 2)
- ref=$(cat ref)
+ ref=$(cat ref | jq .orderReference)
commitment1=$(echo $output1 | jq .OrderPart2.CommitmentPublicKey)
address1=$(echo $output1 | jq .OrderPart2.Extension.address)
(sleep 1; curl -s -X POST "$apiURL/$apiVersion/order/secret" -H "accept: */*" -H "Content-Type: application/json" -d "{\"orderReference\":$ref}" > /dev/null ) &
@@ -87,18 +95,18 @@ execute_bitcoin () {
#echo "Committment1 $commitment1 $address1"
#echo "Committment2 $commitment2 $address2"
if [ -z $commitment2 ]; then
- echo "Failed Commitment is empty"
+ printf " ${RED}FAIL${NC} Commitment is empty\n"
exit 1
fi
if [ $commitment1 != $commitment2 ]; then
- echo "Fail"
+ printf " ${RED}FAIL${NC}\n "
exit 1
fi
if [ $address2 != $address2 ]; then
- echo "Fail"
+ printf " ${RED}FAIL${NC}\n"
exit 1
fi
- echo "Pass - Id, Order(Beneficiary) & OrderSecret"
+ printf " ${GREEN}Pass${NC} - Id, Order(Beneficiary) & OrderSecret\n"
}
@@ -107,12 +115,12 @@ execute_bitcoin () {
execute_safeguardsecret () {
inputString="This is some random test text 1234567890!"
- echo "Encrypt a String [1 Test]"
+ printf " Encrypt a String [1 Test]\n"
( sleep 1; curl -s -X POST "$apiURL/$apiVersion/order" -H "accept: */*" -H "Content-Type: application/json" -d "{\"beneficiaryIDDocumentCID\":$identity,\"extension\":{\"plainText\":\"$inputString\"}}" > ref ) &
output1=$(fishhook $configdir $host "self" 2)
- ref=$(cat ref)
+ ref=$(cat ref | jq .orderReference)
cipherText=$(echo $output1 | jq .OrderPart2.Extension.cypherText)
#echo $cipherText
@@ -122,14 +130,14 @@ execute_safeguardsecret () {
if [ -z "$plaintext" ]; then
- echo "Failed Commitment is empty"
+ printf " ${RED}FAIL${NC} Commitment is empty\n"
exit 1
fi
if [ "$inputString" == "$plaintext" ]; then
- echo "Order Create/Retrieve Pass"
+ printf " ${GREEN}Pass ${NC}Order Create/Retrieve\n"
else
- echo "Order Create/Retrieve Fail"
+ printf " ${RED}FAIL ${NC}Order Create/Retrieve\n"
exit 1
fi
@@ -139,10 +147,10 @@ execute_safeguardsecret () {
execute_milagro () {
- echo "Milagro Tests [1 Test]"
+ echo " Milagro Tests [1 Test]"
( sleep 1; curl -s -X POST "$apiURL/$apiVersion/order" -H "accept: */*" -H "Content-Type: application/json" -d "{\"beneficiaryIDDocumentCID\":$identity}" > ref ) &
output1=$(fishhook $configdir $host "self" 1)
- ref=$(cat ref)
+ ref=$(cat ref | jq .orderReference)
commitment1=$(echo $output1 | jq .OrderPart2.CommitmentPublicKey)
#echo "Committment1 $commitment1"
@@ -154,14 +162,14 @@ execute_milagro () {
#echo "Committment2 $commitment2"
if [ -z $commitment2 ]; then
- echo "Failed Commitment is empty"
+ eprintfcho " ${RED}FAIL${NC} Commitment is empty\n"
exit 1
fi
if [ $commitment1 == $commitment2 ]; then
- echo "Order Create/Retrieve Pass"
+ printf " ${GREEN}Pass${NC} Order Create/Retrieve\n"
else
- echo "Order Create/Retrieve Fail"
+ printf " ${RED}FAIL${NC} Order Create/Retrieve\n"
exit 1
fi
}
@@ -174,7 +182,7 @@ execute_milagro () {
# #############################################################################
execute_orderlist () {
- echo "Milagro Tests [1 Test]"
+ printf "Milagro Tests [1 Test]\n"
commitment2=$(echo $output2 | jq .commitment)
outputList=$(curl -s -X GET "$apiURL/$apiVersion/order?page=0&perPage=2&sortBy=dateCreatedDsc" -H "accept: */*")
orderReference=$(echo $outputList | jq -r ".orderReference | .[$orderIndex]")
@@ -184,10 +192,10 @@ execute_orderlist () {
hasSecret=`echo $outputOrder | grep "Secret"`
if [ -z $hasSecret ]; then
- echo "Failed Order has error"
+ printf " ${RED}FAIL${NC} Order has erro\n"
exit 1
else
- echo "Passed orderList & get"
+ printf " ${GREEN}Pass${NC} orderList & get\n"
fi
}
@@ -195,20 +203,20 @@ execute_orderlist () {
status
+
if [ $plugin == "bitcoinwallet" ]; then
execute_bitcoin
fi
-if [ $plugin == "qredoplugin" ]; then
- execute_bitcoin
-fi
if [ $plugin == "milagro" ]; then
execute_milagro
fi
+
if [ $plugin == "safeguardsecret" ]; then
execute_safeguardsecret
fi
+
#execute_orderlist
diff --git a/cmd/servicetester/fulltest.sh b/cmd/servicetester/fulltest.sh
index 3c1f991..7586079 100755
--- a/cmd/servicetester/fulltest.sh
+++ b/cmd/servicetester/fulltest.sh
@@ -17,6 +17,12 @@
# specific language governing permissions and limitations
# under the License.
+RED='\033[0;31m'
+GREEN='\033[0;32m'
+ORANGE='\033[0;33m'
+NC='\033[0m' # No Color
+
+
pushd () {
command pushd "$@" > /dev/null
@@ -35,9 +41,9 @@ start_server () {
report () {
if [ $2 -eq 0 ]; then
- echo "PASSED $1"
+ printf " ${GREEN}PASSED $1 ${NC}\n"
else
- echo "FAILED $1"
+ printf " ${RED}FAILED $1 ${NC}\n"
fi
}
diff --git a/go.mod b/go.mod
index 7e241de..b7aa963 100644
--- a/go.mod
+++ b/go.mod
@@ -20,6 +20,7 @@ require (
github.com/leodido/go-urn v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.9 // indirect
+ github.com/mr-tron/base58 v1.1.2
github.com/multiformats/go-multihash v0.0.5
github.com/mwitkow/go-proto-validators v0.1.0
github.com/pkg/errors v0.8.1