Skip to content

Commit

Permalink
script modified
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsingh33 committed Feb 1, 2024
1 parent 5c4344c commit 67fc42c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions scripts/comdex_local_setup/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def StoreAndIntantiateWasmContract():
contractAddresses = {}
for index, contractData in enumerate(WASM_CONTRACTS):
print(f"fetching test {contractData['name']} ....")
# wget.download(contractData['contractLink'], contractData['contractPath'])
wget.download(contractData['contractLink'], contractData['contractPath'])
time.sleep(6)
command = f"comdex tx wasm store {contractData['contractPath']} --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --gas-adjustment 1.3 --keyring-backend test -y --output json"
output = subprocess.getstatusoutput(command)[1]
Expand Down Expand Up @@ -255,20 +255,20 @@ def ExecuteWasmGovernanceProposal(contractAddress, proposalID):
"proposal_id":proposalID
}
}
command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(execute)}' --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y"""
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]
if "code: 0" in output:
print("success")
else:
output = json.loads(output)
if int(output["code"]) != 0:
print(output)
exit(f"error while executing wasm prop with id {proposalID} ")
print(f"Proposal with ID {proposalID} executed successfully ✔️")

def ProposeWasmProposal(contractAddress, proposal, proposlID):
command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(proposal)}' --amount 100000000uharbor --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y"""
command = f"""comdex tx wasm execute {contractAddress} '{json.dumps(proposal)}' --amount 100000000uharbor --from {GENESIS_ACCOUNT_NAME} --chain-id {CHAIN_ID} --gas 5000000 --keyring-backend test -y --output json"""
output = subprocess.getstatusoutput(command)[1]
if "code: 0" in output:
print("success")
else:
output = json.loads(output)
if int(output["code"]) != 0:
print(output)
exit(f"error while proposing prop {proposlID} ")
print(f"Proposal {proposlID} raised successfully ✔️")

Expand Down Expand Up @@ -375,6 +375,7 @@ def CreateState():
Vote("yes")

AddAssetInAppsAndVote(1, 9)
time.sleep(6)

for liquidityPair in LIQUIDITY_PAIRS:
if len(liquidityPair) != 3:
Expand Down

0 comments on commit 67fc42c

Please sign in to comment.