예제 #1
0
파일: Roles.py 프로젝트: riicker/metaverse
 def create_asset_with_symbol(self,
                              symbol,
                              is_issue=True,
                              secondary=0,
                              did_symbol=None):
     if did_symbol == None:
         did_symbol = self.did_symbol
     result, message = mvs_rpc.create_asset(self.name,
                                            self.password,
                                            symbol,
                                            300000,
                                            did_symbol,
                                            description="%s's Asset" %
                                            self.name,
                                            rate=secondary)
     if (result):
         print("#ERROR#: failed to create asset: {}".format(message))
     assert (result == 0)
     if is_issue:
         result, message = mvs_rpc.issue_asset(self.name, self.password,
                                               symbol)
         if (result):
             print("#ERROR#: failed to issue asset: {}".format(message))
         assert (result == 0)
     return result, message
예제 #2
0
파일: Roles.py 프로젝트: riicker/metaverse
 def create_asset(self, is_issue=True, secondary=0):
     '''
     issue asset to the main address.
     secondary:   The rate of secondaryissue. Default to 0, means the
                  asset is not allowed to secondary issue forever;
                  otherwise, -1 means the asset can be secondary issue
                  freely; otherwise, the valid rate is in range of 1
                  to 100, means the asset can be secondary issue when
                  own percentage greater than or equal to the rate
                  value.
     '''
     self.domain_symbol = (self.name + common.get_random_str()).upper()
     self.asset_symbol = (self.domain_symbol + ".AST." +
                          common.get_random_str()).upper()
     result, message = mvs_rpc.create_asset(self.name,
                                            self.password,
                                            self.asset_symbol,
                                            300000,
                                            self.did_symbol,
                                            description="%s's Asset" %
                                            self.name,
                                            rate=secondary)
     assert (result == 0)
     if is_issue:
         result, message = mvs_rpc.issue_asset(self.name, self.password,
                                               self.asset_symbol)
         assert (result == 0)