Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 commands #262

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/integration-tests/smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ do
fi
fi

checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id)
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .checkpoint.id)

if [ "$checkpointID" != "null" ]; then
if [ $checkpointFound != "true" ]; then
Expand Down
14 changes: 6 additions & 8 deletions src/express/commands/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ async function checkCheckpoint(ip) {
const url = `http://${ip}:1317/checkpoints/count`
const response = await fetch(url)
const responseJson = await response.json()
if (responseJson.result) {
if (responseJson.result.result) {
return responseJson.result.result
}
if (responseJson.ack_count) {
return responseJson.ack_count
}

return 0
Expand All @@ -74,8 +72,8 @@ async function checkStateSyncTx(ip, id) {
if (responseJson.error) {
return undefined
} else {
if (responseJson.result) {
return responseJson.result
if (responseJson.record) {
return responseJson.record
}
}

Expand All @@ -89,8 +87,8 @@ async function getStateSyncTxList(ip, startTime, endTime) {
if (responseJson.error) {
return undefined
} else {
if (responseJson.result) {
return responseJson.result
if (responseJson.record) {
return responseJson.record
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/express/commands/send-signer-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ async function getValidatorSigner(doc, machine0, validatorID) {
maxRetries
)
const outObj = JSON.parse(out)
return outObj.result.signer
return outObj.validator.signer
}
2 changes: 1 addition & 1 deletion src/express/commands/send-stake-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ async function getValidatorPower(doc, machine0, validatorID) {
maxRetries
)
const outObj = JSON.parse(out)
return outObj.result.power
return outObj.validator.voting_power
}
2 changes: 1 addition & 1 deletion src/express/commands/send-staked-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ export async function checkValidatorsLength(doc, machine0) {
maxRetries
)
const outObj = JSON.parse(out)
return outObj.result.validators.length
return outObj.validator_set.validators.length
}
4 changes: 2 additions & 2 deletions src/express/commands/send-topupfee.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ export async function sendTopUpFeeEvent(validatorID) {
}

async function getValidatorBalance(doc, machine0, valAddr) {
const command = `curl http://localhost:1317/bank/balances/${valAddr}`
const command = `curl http://localhost:1317/cosmos/bank/v1beta1/balances/${valAddr}`
const out = await runSshCommandWithReturn(
`${doc.ethHostUser}@${machine0}`,
command,
maxRetries
)
const outObj = JSON.parse(out)
return outObj.result[0].amount
return outObj.balances[0].amount
}
8 changes: 4 additions & 4 deletions src/express/common/milestone-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,11 @@ export async function fetchLatestMilestone(
}

milestone = await checkLatestMilestone(host)
if (milestone.result) {
if (milestone.milestone) {
// Check against last milestone (if present) if it's immediate next one or not
if (lastMilestone) {
if (
Number(milestone.result.start_block) ===
Number(milestone.milestone.start_block) ===
Number(lastMilestone.end_block) + 1
) {
break
Expand All @@ -434,13 +434,13 @@ export async function fetchLatestMilestone(
} else {
console.log(
`📍Invalid milestone received. Response: ${JSON.stringify(
milestone.result
milestone.milestone
)}, count: ${count}`
)
}
}

const latestMilestone = milestone.result
const latestMilestone = milestone.milestone
console.log(
`📍Got milestone from heimdall. Start block: ${Number(
latestMilestone.start_block
Expand Down
1 change: 0 additions & 1 deletion src/setup/devnet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,6 @@ export class Devnet {
{ stdio: getRemoteStdio() }
)


let nodeDir = `${this.testnetDir}/node${i}/`
if (i >= this.config.numOfBorValidators) {
nodeDir = `${this.testnetDir}/node${i + this.config.numOfErigonValidators}/`
Expand Down
Loading