示例#1
0
 def MoneyTransfer(self):
     data = {"Recipient": "0005-2070-2000-0006-0200", "Amount": "2"}
     sign = utils.prepare_tx(url, prKey, "MoneyTransfer", token, data)
     dataContract = {"time": sign['time'], "signature": sign["signature"]}
     self.client.post("/contract/" + sign["reqID"],
                      dataContract,
                      headers={"Authorization": token},
                      name="MoneyTransfer")
示例#2
0
 def NewContract(self):
     code, name = utils.generate_name_and_code("")
     data = {"Value": code, "ApplicationId": 1, "Conditions": "true"}
     sign = utils.prepare_tx(url, prKey, "NewContract", token, data)
     dataContract = {"time": sign['time'], "signature": sign["signature"]}
     self.client.post("/contract/" + sign["reqID"],
                      dataContract,
                      headers={"Authorization": token},
                      name="NewContract")
示例#3
0
 def NewLang(self):
     data = {
         "AppID": 1,
         "Name": "Lang_" + utils.generate_random_name(),
         "Trans": "{\"en\": \"false\", \"ru\" : \"true\"}",
         "ApplicationId": 1
     }
     sign = utils.prepare_tx(url, prKey, "NewLang", token, data)
     dataContract = {"time": sign['time'], "signature": sign["signature"]}
     self.client.post("/contract/" + sign["reqID"],
                      dataContract,
                      headers={"Authorization": token},
                      name="NewLang")
示例#4
0
 def NewBlock(self):
     name = "Block_" + utils.generate_random_name()
     data = {
         "Name": name,
         "Value": "Hello page!",
         "ApplicationId": 1,
         "Conditions": "true"
     }
     sign = utils.prepare_tx(url, prKey, "NewBlock", token, data)
     dataContract = {"time": sign['time'], "signature": sign["signature"]}
     self.client.post("/contract/" + sign["reqID"],
                      dataContract,
                      headers={"Authorization": token},
                      name="NewBlock")
示例#5
0
 def NewTable(self):
     column = """[{"name":"MyName","type":"varchar",
     "index": "1",  "conditions":"true"}]"""
     permission = """{"insert": "false",
     "update" : "true","new_column": "true"}"""
     data = {
         "Name": "Tab_" + utils.generate_random_name(),
         "Columns": column,
         "ApplicationId": 1,
         "Permissions": permission
     }
     sign = utils.prepare_tx(url, prKey, "NewTable", token, data)
     dataContract = {"time": sign['time'], "signature": sign["signature"]}
     self.client.post("/contract/" + sign["reqID"],
                      dataContract,
                      headers={"Authorization": token},
                      name="NewTable")