Skip to content

Commit

Permalink
add check for new subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Aug 5, 2024
1 parent 5eb7297 commit 504bf85
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cicd/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,21 @@ async function getGapSubnet(config) {
params: ["latest"],
id: 1,
};
await axios.post(config.subnetURL, data).then((response) => {
await axios.post(config.subnetURL, data, {timeout: 2000}).then((response) => {
console.log(response)
if (response.status == 200) {
epochBlockNum = response.data.result.EpochBlockNumber;
gapBlockNum = epochBlockNum-450+1
} else {
return gapBlockNum
}
if (response.status == -32601){
return 0
}
console.log("response.status", response.status);
// console.log("response.data", response.data);
throw Error("could not get gapblock in subnet");
}

});
return gapBlockNum
}

async function getEpochParentnet(config) {
Expand Down

0 comments on commit 504bf85

Please sign in to comment.