Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 7efb992

Browse files
committed
Add last_modified to get_listings and contracts
1 parent 7d52027 commit 7efb992

File tree

4 files changed

+40
-29
lines changed

4 files changed

+40
-29
lines changed

api/restapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ def parse_listings(listings):
230230
"currency_code": l.currency_code,
231231
"nsfw": l.nsfw,
232232
"origin": str(CountryCode.Name(l.origin)),
233-
"ships_to": []
233+
"ships_to": [],
234+
"last_modified": l.last_modified
234235
}
235236
if l.contract_type != 0:
236237
listing_json["contract_type"] = str(objects.Listings.ContractType.Name(l.contract_type))

market/contracts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def create(self,
149149
"metadata": {
150150
"version": "1",
151151
"category": metadata_category.lower(),
152-
"category_sub": "fixed price"
152+
"category_sub": "fixed price",
153+
"last_modified": int(time.time())
153154
},
154155
"id": {
155156
"guid": self.keychain.guid.encode("hex"),
@@ -1056,6 +1057,7 @@ def save(self):
10561057
data.contract_type = listings.DIGITAL_GOOD
10571058
elif self.contract["vendor_offer"]["listing"]["metadata"]["category"].lower() == "service":
10581059
data.contract_type = listings.SERVICE
1060+
data.last_modified = int(time.time())
10591061

10601062
# save the mapping of the contract file path and contract hash in the database
10611063
self.db.filemap.insert(data.contract_hash.encode("hex"), file_path[len(DATA_FOLDER):])

protos/objects.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ message Listings {
121121
bytes avatar_hash = 10;
122122
string handle = 11;
123123
ContractType contract_type = 12;
124+
uint64 last_modified = 13;
124125
}
125126

126127
enum ContractType {

protos/objects.py

Lines changed: 34 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)