55LOG = logging .getLogger (__name__ )
66
77class weidentityClient (Base ):
8- def __init__ (self , host , port = None , version = "1 .0.0" ):
8+ def __init__ (self , host , port = None , version = "2 .0.0" ):
99 super (weidentityClient , self ).__init__ (host , port , version )
1010
1111 def create_weidentity_did_first (self , publicKey , nonce ):
12- # 创建WeIdentity DID
12+ # First Create WeIdentity DID
1313 data_dict = {
1414 "functionArg" : {
1515 "publicKey" : publicKey
@@ -23,7 +23,7 @@ def create_weidentity_did_first(self, publicKey, nonce):
2323 return self .post ("/weid/api/encode" , data = data_dict )
2424
2525 def create_weidentity_did_second (self , nonce , data , signedMessage , blockLimit , signType = "1" ):
26- # 创建WeIdentity DID
26+ # Second Create WeIdentity DID
2727 data_dict = {
2828 "functionArg" : {},
2929 "transactionArg" : {
@@ -38,7 +38,7 @@ def create_weidentity_did_second(self, nonce, data, signedMessage, blockLimit, s
3838 }
3939 return self .post ("/weid/api/transact" , data = data_dict )
4040
41- def create_weidentity_did (self , privKey , nonce , signType = "1" ):
41+ def create_weidentity_did (self , privKey , nonce = 1 , signType = "1" ):
4242 publicKey = self .priv_to_public (privKey )
4343 respBody = self .create_weidentity_did_first (publicKey , nonce )
4444 encode_transaction = respBody ['respBody' ]['encodedTransaction' ]
@@ -83,7 +83,7 @@ def register_authority_issuer_second(self, nonce, data, signedMessage, blockLimi
8383 }
8484 return self .post ("/weid/api/transact" , data = data_dict )
8585
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" ):
8787
8888 respBody = self .register_authority_issuer_first (name , weId , nonce )
8989
@@ -131,7 +131,7 @@ def create_cpt_second(self, nonce, data, signedMessage, blockLimit, signType="1"
131131 }
132132 return self .post ("/weid/api/transact" , data = data_dict )
133133
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" ):
135135
136136 respBody = self .create_cpt_first (weId , cptJsonSchema , cptSignature , nonce )
137137
0 commit comments