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

Commit 5538ed0

Browse files
committed
Minor cleanups
1 parent 8991538 commit 5538ed0

File tree

7 files changed

+72
-72
lines changed

7 files changed

+72
-72
lines changed

api/restapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def handle_response(resp, contract):
558558
indent=4))
559559
request.finish()
560560
else:
561-
request.write(json.dumps({"success": False, "reason": "seller rejected contract"}, indent=4))
561+
request.write(json.dumps({"success": False, "reason": "vendor rejected contract"}, indent=4))
562562
request.finish()
563563
options = None
564564
if "options" in request.args:
@@ -584,8 +584,8 @@ def get_node(node):
584584
else:
585585
request.write(json.dumps({"success": False, "reason": "unable to reach vendor"}, indent=4))
586586
request.finish()
587-
seller_guid = unhexlify(c.contract["vendor_offer"]["listing"]["id"]["guid"])
588-
self.kserver.resolve(seller_guid).addCallback(get_node)
587+
vendor_guid = unhexlify(c.contract["vendor_offer"]["listing"]["id"]["guid"])
588+
self.kserver.resolve(vendor_guid).addCallback(get_node)
589589
return server.NOT_DONE_YET
590590
except Exception, e:
591591
request.write(json.dumps({"success": False, "reason": e.message}, indent=4))

dht/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def saveStateRegularly(self, fname, frequency=600):
395395
396396
Args:
397397
fname: File name to save retularly to
398-
frequencey: Frequency in seconds that the state should be saved.
398+
frequency: Frequency in seconds that the state should be saved.
399399
By default, 10 minutes.
400400
"""
401401
loop = LoopingCall(self.saveState, fname)

dht/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, node, maxsize):
7171
"""
7272
Constructor.
7373
74-
@param node: The node to measure all distnaces from.
74+
@param node: The node to measure all distances from.
7575
@param maxsize: The maximum size that this heap can grow to.
7676
"""
7777
self.node = node

market/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'chris'
22
"""
33
Package for two way communication between nodes.
4-
Primarily used for buyer-seller communication.
4+
Primarily used for buyer-vendor communication.
55
"""

market/contracts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def add_order_confirmation(self,
501501

502502
def accept_order_confirmation(self, notification_listener, confirmation_json=None):
503503
"""
504-
Validate the order confirmation sent over from the seller and update our node accordingly.
504+
Validate the order confirmation sent over from the vendor and update our node accordingly.
505505
"""
506506
self.notification_listener = notification_listener
507507
try:

protos/message.proto

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,46 @@ import "objects.proto";
1111

1212
//This is the message structure for OpenBazaar messages going over the wire
1313
message Message {
14-
required bytes messageID = 1;
15-
required Node sender = 2;
16-
required Command command = 3;
17-
required uint32 protoVer = 4;
18-
repeated bytes arguments = 5;
19-
optional bool testnet = 6 [default = false];
14+
required bytes messageID = 1;
15+
required Node sender = 2;
16+
required Command command = 3;
17+
required uint32 protoVer = 4;
18+
repeated bytes arguments = 5;
19+
optional bool testnet = 6 [default = false];
2020
}
2121

2222
//A list of commands accepted by nodes
2323
enum Command {
24-
PING = 1;
25-
STUN = 2;
26-
HOLE_PUNCH = 3;
27-
STORE = 4;
28-
DELETE = 5;
29-
INV = 6;
30-
VALUES = 7;
31-
BROADCAST = 8;
32-
MESSAGE = 9;
33-
FOLLOW = 10;
34-
UNFOLLOW = 11;
35-
ORDER = 12;
36-
ORDER_CONFIRMATION = 13;
37-
COMPLETE_ORDER = 14;
38-
FIND_NODE = 15;
39-
FIND_VALUE = 16;
40-
GET_CONTRACT = 17;
41-
GET_IMAGE = 18;
42-
GET_PROFILE = 19;
43-
GET_LISTINGS = 20;
44-
GET_USER_METADATA = 21;
45-
GET_CONTRACT_METADATA = 22;
46-
GET_FOLLOWING = 23;
47-
GET_FOLLOWERS = 24;
48-
DISPUTE_OPEN = 25;
49-
DISPUTE_CLOSE = 26;
24+
PING = 1;
25+
STUN = 2;
26+
HOLE_PUNCH = 3;
27+
STORE = 4;
28+
DELETE = 5;
29+
INV = 6;
30+
VALUES = 7;
31+
BROADCAST = 8;
32+
MESSAGE = 9;
33+
FOLLOW = 10;
34+
UNFOLLOW = 11;
35+
ORDER = 12;
36+
ORDER_CONFIRMATION = 13;
37+
COMPLETE_ORDER = 14;
38+
FIND_NODE = 15;
39+
FIND_VALUE = 16;
40+
GET_CONTRACT = 17;
41+
GET_IMAGE = 18;
42+
GET_PROFILE = 19;
43+
GET_LISTINGS = 20;
44+
GET_USER_METADATA = 21;
45+
GET_CONTRACT_METADATA = 22;
46+
GET_FOLLOWING = 23;
47+
GET_FOLLOWERS = 24;
48+
DISPUTE_OPEN = 25;
49+
DISPUTE_CLOSE = 26;
5050

51-
// Error responses
52-
BAD_REQUEST = 400;
53-
NOT_FOUND = 404;
54-
CALM_DOWN = 420;
55-
UNKNOWN_ERROR = 520;
56-
}
51+
// Error responses
52+
BAD_REQUEST = 400;
53+
NOT_FOUND = 404;
54+
CALM_DOWN = 420;
55+
UNKNOWN_ERROR = 520;
56+
}

protos/objects.proto

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ import "countries.proto";
1313
//Some fields are optional as they aren't needed in all situations.
1414
message Node {
1515
required bytes guid = 1;
16-
required bytes signedPublicKey = 2; // <64 byte signature><32 byte public key>
17-
required NATType natType = 3;
18-
required IPAddress nodeAddress = 4;
19-
optional IPAddress relayAddress = 5;
20-
optional bool vendor = 6 [default = false];
21-
22-
message IPAddress {
23-
required string ip = 1;
24-
required uint32 port = 2;
25-
}
16+
required bytes signedPublicKey = 2; // <64 byte signature><32 byte public key>
17+
required NATType natType = 3;
18+
required IPAddress nodeAddress = 4;
19+
optional IPAddress relayAddress = 5;
20+
optional bool vendor = 6 [default = false];
21+
22+
message IPAddress {
23+
required string ip = 1;
24+
required uint32 port = 2;
25+
}
2626
}
2727

2828
enum NATType {
@@ -36,9 +36,9 @@ enum NATType {
3636
//Typically a list of these will be returned for any given keyword.
3737
message Value {
3838
optional bytes keyword = 1;
39-
required bytes valueKey = 2;
40-
required bytes serializedData = 3;
41-
required uint32 ttl = 4;
39+
required bytes valueKey = 2;
40+
required bytes serializedData = 3;
41+
required uint32 ttl = 4;
4242
}
4343

4444
//A list of these is sent in an INV packet
@@ -73,23 +73,23 @@ message Profile {
7373
optional bytes avatar_hash = 22;
7474
optional bytes header_hash = 23;
7575

76-
// Social media account for the profile
76+
// Social media account for the profile
7777
message SocialAccount {
78-
required SocialType type = 1;
79-
required string username = 2;
80-
optional string proof_url = 3;
81-
82-
enum SocialType {
83-
FACEBOOK = 1;
84-
TWITTER = 2;
85-
INSTAGRAM = 3;
86-
SNAPCHAT = 4;
87-
}
78+
required SocialType type = 1;
79+
required string username = 2;
80+
optional string proof_url = 3;
81+
82+
enum SocialType {
83+
FACEBOOK = 1;
84+
TWITTER = 2;
85+
INSTAGRAM = 3;
86+
SNAPCHAT = 4;
87+
}
8888
}
8989

9090
message PublicKey {
91-
required bytes public_key = 1;
92-
required bytes signature = 2;
91+
required bytes public_key = 1;
92+
required bytes signature = 2;
9393
}
9494
}
9595

@@ -162,4 +162,4 @@ message Plaintext_Message {
162162
ORDER_CONFIRMATION = 3;
163163
RECEIPT = 4;
164164
}
165-
}
165+
}

0 commit comments

Comments
 (0)