ITPeople-Blockchain / auction

ITPeople Blockchain - Art Auction Demo
162 stars 183 forks source link

chaincode new features and corresponding JS changes #43

Closed ratnakar-asara closed 8 years ago

ratnakar-asara commented 8 years ago
  1. Does not accept bids if
    • Auction is not Open
    • Item on Bid does not match Item on Auction
    • Owner on Auction and Bid do not match
    • Bid receipt time is > auction.CloseDate
    • Bid Price is <= Reserve Price2.
  2. Transfer will not work if the Item is on auction where auction status is "INIT" or "OPEN"
  3. Same Item can be put on auction again provided it is not on auction (A new function has been added that checks both the AucInitTable and AucOpenTable)

    // Let us make sure that the Item is not on Auction
    err = VerifyIfItemIsOnAuction(stub, ar.ItemID)
    if err != nil {
           fmt.Println("PostAuctionRequest() : Failed Item is either initiated or opened for Auction ", args[0])
           return nil, err
    }
  4. The Go routine that automatically closes auctions is removed. Instead, a periodic call to close all open auctions can be issued (see the log file) ./peer chaincode invoke -l golang -n mycc -c '{"Function": "CloseOpenAuctions", "Args": ["2016", "CLAUC"]}'
  5. The Item History table has a 4th key - i.e. date and time.
  6. Some new functions added include
CloseOpenAuctions, 
tCompare(time1, time2), 
VerifyIfItemIsOnAuction(...)