Skip to content

Commit

Permalink
script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsingh33 committed Feb 2, 2024
1 parent 67fc42c commit 12e4388
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/comdex_local_setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def ExecuteWasmGovernanceProposal(contractAddress, proposalID):
"proposal_id":proposalID
}
}
time.sleep(3)
command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(execute)}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y --output json"""
output = subprocess.getstatusoutput(command)[1]
output = json.loads(output)
Expand All @@ -277,7 +278,7 @@ def AddAssetRates(assetName, jsonData):
with open(fileName, "w") as jsonFile:
json.dump(jsonData, jsonFile)

command = f"""comdex tx gov submit-legacy-proposal add-asset-rates-params --add-asset-rates-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y"""
command = f"""comdex tx gov submit-legacy-proposal add-asset-rates-params --add-asset-rates-params-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 9000000 -y"""
output = subprocess.getstatusoutput(command)[1]
if "code: 0" in output:
print("success")
Expand All @@ -292,7 +293,7 @@ def AddLendPool(jsonData):
with open(fileName, "w") as jsonFile:
json.dump(jsonData, jsonFile)

command = f"""comdex tx gov submit-legacy-proposal add-lend-pool --add-lend-pool-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 5000000 -y"""
command = f"""comdex tx gov submit-legacy-proposal add-lend-pool --add-lend-pool-file '{fileName}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --keyring-backend test --gas 9000000 -y"""
output = subprocess.getstatusoutput(command)[1]
if "code: 0" in output:
print("success")
Expand Down Expand Up @@ -382,28 +383,28 @@ def CreateState():
exit("Invalid liquidity pair configs")
CreateLiquidityPair(liquidityPair[0], liquidityPair[1], liquidityPair[2])
Vote("yes")

time.sleep(20)
for liquidityPool in LIQUIDITY_POOLS:
if len(liquidityPool) != 3:
exit("Invalid liquidity pool configs")
CreateLiquidityPool(liquidityPool[0], liquidityPool[1], liquidityPool[2])

time.sleep(20)
for assetRate in ADD_ASSET_RATES:
if len(assetRate) != 2:
exit("Invalid add asset rate configs")
AddAssetRates(assetRate[0], assetRate[1])
Vote("yes")

time.sleep(20)
for lenPoolData in ADD_LEND_POOL:
AddLendPool(lenPoolData)
Vote("yes")

time.sleep(20)
for lendPair in ADD_LEND_PAIR:
if len(lendPair) != 2:
exit("Invalid lend pair configs")
AddLendPair(lendPair[0], lendPair[1])
Vote("yes")

time.sleep(20)
for lenAssetPairMap in LEND_ASSET_PAIR_MAPPING:
if len(lenAssetPairMap) != 3:
exit("Invalid lend asset pair map configs")
Expand Down

0 comments on commit 12e4388

Please sign in to comment.