Skip to content

Commit

Permalink
feat: 🎨 add update argo bridge constraints check
Browse files Browse the repository at this point in the history
  • Loading branch information
ignazio-bovo committed Jun 10, 2024
1 parent 9f50b35 commit f543a08
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,45 @@ export class CreateProposalsFixture extends StandardizedFixture {
assert.isNotNull(qProposal.details.bloatBond)
assert.isDefined(qProposal.details.bloatBond)
assert.equal(qProposal.details.bloatBond!.toString(), details.bloatBond.unwrap().toString())
break
}
break
}
case 'UpdateArgoBridgeConstraints': {
Utils.assert(qProposal.details.__typename === 'UpdateArgoBridgeConstraintsProposalDetails')
const details = proposalDetails.asUpdateArgoBridgeConstraints
if (details.bridgingFee.isSome) {
assert.isNotNull(qProposal.details.bridgingFee)
assert.isDefined(qProposal.details.bridgingFee)
assert.equal(qProposal.details.bridgingFee!.toString(), details.bridgingFee.unwrap().toString())
}
// repeat the same if case with details: operatorAccount, pauserAccounts, thawnDuration, remoteChains
if (details.operatorAccount.isSome) {
assert.isNotNull(qProposal.details.operatorAccount)
assert.isDefined(qProposal.details.operatorAccount)
assert.equal(qProposal.details.operatorAccount!.toString(), details.operatorAccount.unwrap().toString())
}
if (details.pauserAccounts.isSome) {
assert.isNotNull(qProposal.details.pauserAccounts)
assert.isDefined(qProposal.details.pauserAccounts)
assert.sameDeepMembers(
qProposal.details.pauserAccounts!,
details.pauserAccounts.unwrap().map((a) => a.toString())
)
}
if (details.thawnDuration.isSome) {
assert.isNotNull(qProposal.details.thawnDuration)
assert.isDefined(qProposal.details.thawnDuration)
assert.equal(qProposal.details.thawnDuration!.toString(), details.thawnDuration.unwrap().toString())
}
if (details.remoteChains.isSome) {
assert.isNotNull(qProposal.details.remoteChains)
assert.isDefined(qProposal.details.remoteChains)
assert.sameDeepMembers(
qProposal.details.remoteChains!.map((a) => a.toString()),
details.remoteChains.unwrap().map((a) => a.toString())
)
}
break
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions tests/network-tests/src/graphql/queries/proposals.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ fragment ProposalDetailsFields on ProposalDetails {
ammSellTxFees
bloatBond
}

... on UpdateArgoBridgeConstraintsProposalDetails {
operatorAccount
pauserAccounts
bridgingFee
thawnDuration
remoteChains
}
}

fragment ProposalFields on Proposal {
Expand Down

0 comments on commit f543a08

Please sign in to comment.