Skip to content

Commit

Permalink
Merge pull request #5170 from ignazio-bovo/fix/graphql-codegen
Browse files Browse the repository at this point in the history
Petra integration tests final additions
  • Loading branch information
kdembler committed Jun 12, 2024
2 parents 87e2e24 + a26e092 commit ed52b91
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1,047 deletions.
2 changes: 1 addition & 1 deletion tests/network-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"uuid": "^7.0.3"
},
"devDependencies": {
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/cli": "^1.21.4",
"@graphql-codegen/import-types-preset": "^1.18.1",
"@graphql-codegen/typescript": "^1.22.0",
"@graphql-codegen/typescript-document-nodes": "^1.17.11",
Expand Down
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
Loading

0 comments on commit ed52b91

Please sign in to comment.