Skip to content

Commit

Permalink
change network rpc url
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-guo-s committed Oct 30, 2023
1 parent 59e25f8 commit df3fe5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/views/projects/projectsDeploymentDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ const execDeploy = async () => {
if (execStatus) {
const { data } = await apiGetProjectsContract({ id: projectId, version: route.query.version});
const contractMap = formatContractList(data)
const networkData = await apiGetNetworkByName(res.data.network)
let deployParams = {
projectId:projectId,
execId: executeId,
version: route.query.version,
network: res.data.network,
rpcUrl: networkData.data.rpcUrl
}
newEngine.start(contractMap,execJson,deployParams)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export interface DeployParams {
execId: number
version:string
network:string
rpcUrl:string
}

export const ERC1967_ABI = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {callContract, deployContract, deployProxyContract, getTransaction, upgra
import {apiUpdateExecuteInfo} from "@/apis/contractOrchestrationDeploy";
import {apiProjectsContractDeploy} from "@/apis/projects";
import {message} from "ant-design-vue";
import {apiGetNetworkByName} from "@/apis/network";



Expand Down Expand Up @@ -65,7 +66,19 @@ export default class NewEngine {
}
if (step.status == "RUNNING") {
if (step.transactionHash != "" || step.transactionHash != undefined) {
const receipt = await getTransaction(step.transactionHash,deployParams.rpcUrl)
let network = ""
try {
const networkData = await apiGetNetworkByName(deployParams.network)
network = networkData.data.rpcUrl
} catch (e) {
step.status = "FAILED"
deployStep.status = "FAILED"
this.isRunning = false
// save exec status
await saveDeployExec(deployParams.projectId,deployParams.execId,JSON.stringify(deployInfo))
return
}
const receipt = await getTransaction(step.transactionHash,network)
if (receipt.status == 0 || receipt.status == undefined ) {
step.status = "FAILED"
deployStep.status = "FAILED"
Expand Down

0 comments on commit df3fe5b

Please sign in to comment.