5
5
LOG = logging .getLogger (__name__ )
6
6
7
7
class weidentityClient (Base ):
8
- def __init__ (self , host , port = None , version = "1 .0.0" ):
8
+ def __init__ (self , host , port = None , version = "2 .0.0" ):
9
9
super (weidentityClient , self ).__init__ (host , port , version )
10
10
11
11
def create_weidentity_did_first (self , publicKey , nonce ):
12
- # 创建WeIdentity DID
12
+ # First Create WeIdentity DID
13
13
data_dict = {
14
14
"functionArg" : {
15
15
"publicKey" : publicKey
@@ -23,7 +23,7 @@ def create_weidentity_did_first(self, publicKey, nonce):
23
23
return self .post ("/weid/api/encode" , data = data_dict )
24
24
25
25
def create_weidentity_did_second (self , nonce , data , signedMessage , blockLimit , signType = "1" ):
26
- # 创建WeIdentity DID
26
+ # Second Create WeIdentity DID
27
27
data_dict = {
28
28
"functionArg" : {},
29
29
"transactionArg" : {
@@ -38,7 +38,7 @@ def create_weidentity_did_second(self, nonce, data, signedMessage, blockLimit, s
38
38
}
39
39
return self .post ("/weid/api/transact" , data = data_dict )
40
40
41
- def create_weidentity_did (self , privKey , nonce , signType = "1" ):
41
+ def create_weidentity_did (self , privKey , nonce = 1 , signType = "1" ):
42
42
publicKey = self .priv_to_public (privKey )
43
43
respBody = self .create_weidentity_did_first (publicKey , nonce )
44
44
encode_transaction = respBody ['respBody' ]['encodedTransaction' ]
@@ -83,7 +83,7 @@ def register_authority_issuer_second(self, nonce, data, signedMessage, blockLimi
83
83
}
84
84
return self .post ("/weid/api/transact" , data = data_dict )
85
85
86
- def register_authority_issuer (self , privKey , name , weId , nonce , signType = "1" ):
86
+ def register_authority_issuer (self , privKey , name , weId , nonce = 1 , signType = "1" ):
87
87
88
88
respBody = self .register_authority_issuer_first (name , weId , nonce )
89
89
@@ -131,7 +131,7 @@ def create_cpt_second(self, nonce, data, signedMessage, blockLimit, signType="1"
131
131
}
132
132
return self .post ("/weid/api/transact" , data = data_dict )
133
133
134
- def create_cpt (self , privKey , weId , cptJsonSchema , cptSignature , nonce , signType = "1" ):
134
+ def create_cpt (self , privKey , weId , cptJsonSchema , cptSignature , nonce = 1 , signType = "1" ):
135
135
136
136
respBody = self .create_cpt_first (weId , cptJsonSchema , cptSignature , nonce )
137
137
0 commit comments