1
- /******************************************************************
1
+ /*
2
2
Copyright IT People Corp. 2017 All Rights Reserved.
3
3
4
- Licensed under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License.
6
- You may obtain a copy of the License at
4
+ SPDX-License-Identifier: Apache-2.0
7
5
8
- http://www.apache.org/licenses/LICENSE-2.0
9
-
10
- Unless required by applicable law or agreed to in writing, software
11
- distributed under the License is distributed on an "AS IS" BASIS,
12
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- See the License for the specific language governing permissions and
14
- limitations under the License.
15
-
16
- ******************************************************************/
6
+ */
17
7
18
8
///////////////////////////////////////////////////////////////////////
19
9
// Author : IT People - Mohan Venkataraman - Auction API for v1.0
@@ -394,7 +384,7 @@ func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, function strin
394
384
395
385
if len (args ) < 1 {
396
386
fmt .Println ("Query() : Include at least 1 arguments Key " )
397
- return shim .Error ("Query() : Expecting Transation type and Key value for query" )
387
+ return shim .Error ("Query() : Expecting Transaction type and Key value for query" )
398
388
}
399
389
400
390
QueryRequest := QueryFunction (function )
@@ -457,7 +447,7 @@ func GetUser(stub shim.ChaincodeStubInterface, function string, args []string) p
457
447
return shim .Error (jsonResp )
458
448
}
459
449
460
- fmt .Println ("GetUser() : Response : Successfull -" )
450
+ fmt .Println ("GetUser() : Response : Successful -" )
461
451
return shim .Success (Avalbytes )
462
452
}
463
453
@@ -491,7 +481,7 @@ func GetItem(stub shim.ChaincodeStubInterface, function string, args []string) p
491
481
itemObj .ItemImage = []byte {}
492
482
Avalbytes , _ = ARtoJSON (itemObj )
493
483
494
- fmt .Println ("GetItem() : Response : Successfull " )
484
+ fmt .Println ("GetItem() : Response : Successful " )
495
485
return shim .Success (Avalbytes )
496
486
}
497
487
@@ -546,7 +536,7 @@ func ValidateItemOwnership(stub shim.ChaincodeStubInterface, function string, ar
546
536
return shim .Error (jsonResp )
547
537
}
548
538
549
- fmt .Print ("ValidateItemOwnership() : Response : Successfull - \n " )
539
+ fmt .Print ("ValidateItemOwnership() : Response : Successful - \n " )
550
540
return shim .Success (Avalbytes )
551
541
}
552
542
@@ -575,7 +565,7 @@ func GetAuctionRequest(stub shim.ChaincodeStubInterface, function string, args [
575
565
return shim .Error (jsonResp )
576
566
}
577
567
578
- fmt .Println ("GetAuctionRequest() : Response : Successfull - \n " )
568
+ fmt .Println ("GetAuctionRequest() : Response : Successful - \n " )
579
569
return shim .Success (Avalbytes )
580
570
}
581
571
@@ -611,7 +601,7 @@ func GetBid(stub shim.ChaincodeStubInterface, function string, args []string) pb
611
601
return shim .Error (jsonResp )
612
602
}
613
603
614
- fmt .Println ("GetBid() : Response : Successfull -" )
604
+ fmt .Println ("GetBid() : Response : Successful -" )
615
605
return shim .Success (Avalbytes )
616
606
}
617
607
@@ -639,7 +629,7 @@ func GetTransaction(stub shim.ChaincodeStubInterface, function string, args []st
639
629
return shim .Error (jsonResp )
640
630
}
641
631
642
- fmt .Println ("GetTransaction() : Response : Successfull " )
632
+ fmt .Println ("GetTransaction() : Response : Successful " )
643
633
return shim .Success (Avalbytes )
644
634
}
645
635
@@ -649,7 +639,7 @@ func GetTransaction(stub shim.ChaincodeStubInterface, function string, args []st
649
639
// There are different types of users - Traders (TRD), Auction Houses (AH)
650
640
// Shippers (SHP), Insurance Companies (INS), Banks (BNK)
651
641
// While this version of the chain code does not enforce strict validation
652
- // the business process recomends validating each persona for the service
642
+ // the business process recommends validating each persona for the service
653
643
// they provide or their participation on the auction blockchain, future enhancements will do that
654
644
// ./peer chaincode invoke -l golang -n mycc -c '{"Function": "PostUser", "Args":["100", "USER", "Ashley Hart", "TRD", "Morrisville Parkway, #216, Morrisville, NC 27560", "9198063535", "[email protected] ", "SUNTRUST", "00017102345", "0234678"]}'
655
645
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -934,7 +924,7 @@ func TransferItem(stub shim.ChaincodeStubInterface, function string, args []stri
934
924
myItem .AES_Key , _ = GenAESKey ()
935
925
myItem .ItemImage = Encrypt (myItem .AES_Key , image )
936
926
937
- // Update the owner to the new owner transfered to
927
+ // Update the owner to the new owner transferred to
938
928
myItem .CurrentOwnerID = args [3 ]
939
929
940
930
ar , err = ARtoJSON (myItem )
@@ -1193,7 +1183,7 @@ func PostTransaction(stub shim.ChaincodeStubInterface, function string, args []s
1193
1183
1194
1184
buyer := response .Payload
1195
1185
1196
- fmt .Println ("PostTransaction(): Validated Buyer information successfully " , buyer , ar .UserId )
1186
+ fmt .Println ("PostTransaction(): Validated Buyer information Successfully " , buyer , ar .UserId )
1197
1187
1198
1188
// Validate Item record
1199
1189
response = ValidateItemSubmission (stub , ar .ItemID )
@@ -1203,7 +1193,7 @@ func PostTransaction(stub shim.ChaincodeStubInterface, function string, args []s
1203
1193
}
1204
1194
1205
1195
lastUpdatedItemOBCObject := response .Payload
1206
- fmt .Println ("PostTransaction() : Validated Item Object in Blockchain successfully " , ar .ItemID )
1196
+ fmt .Println ("PostTransaction() : Validated Item Object in Blockchain Successfully " , ar .ItemID )
1207
1197
1208
1198
// Update Item Object with new Owner Key
1209
1199
response = UpdateItemObject (stub , lastUpdatedItemOBCObject , ar .HammerPrice , ar .UserId )
@@ -1216,7 +1206,7 @@ func PostTransaction(stub shim.ChaincodeStubInterface, function string, args []s
1216
1206
fmt .Println ("PostTransaction() : New encryption Key is " , newKey )
1217
1207
}
1218
1208
1219
- fmt .Println ("PostTransaction() : Updated Item Master Object in Blockchain successfully " , ar .ItemID )
1209
+ fmt .Println ("PostTransaction() : Updated Item Master Object in Blockchain Successfully " , ar .ItemID )
1220
1210
1221
1211
// Post an Item Log
1222
1212
itemObject , err := JSONtoAR (lastUpdatedItemOBCObject )
@@ -1235,7 +1225,7 @@ func PostTransaction(stub shim.ChaincodeStubInterface, function string, args []s
1235
1225
return shim .Error (err .Error ())
1236
1226
}
1237
1227
1238
- fmt .Println ("PostTransaction() : Inserted item log record successfully " , ar .ItemID )
1228
+ fmt .Println ("PostTransaction() : Inserted item log record Successfully " , ar .ItemID )
1239
1229
1240
1230
// Convert Transaction Object to JSON
1241
1231
buff , err := TrantoJSON (ar ) //
@@ -1252,7 +1242,7 @@ func PostTransaction(stub shim.ChaincodeStubInterface, function string, args []s
1252
1242
return shim .Error (err .Error ())
1253
1243
}
1254
1244
1255
- fmt .Println ("PostTransaction() : Posted Transaction Record successfully \n " )
1245
+ fmt .Println ("PostTransaction() : Posted Transaction Record Successfully \n " )
1256
1246
1257
1247
// Returns New Key. To get Transaction Details, run GetTransaction
1258
1248
@@ -2545,7 +2535,7 @@ func ProcessQueryResult(stub shim.ChaincodeStubInterface, Avalbytes []byte, args
2545
2535
fmt .Println ("ProcessRequestType() : Image decrytion failed " )
2546
2536
return err
2547
2537
}
2548
- fmt .Println ("ProcessRequestType() : Image conversion from byte[] to file successfull " )
2538
+ fmt .Println ("ProcessRequestType() : Image conversion from byte[] to file Successful " )
2549
2539
err = ByteArrayToImage (image , "copy." + ar .ItemPicFN )
2550
2540
if err != nil {
2551
2541
0 commit comments