Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Aug 9, 2024
1 parent 6bd4666 commit 4e98a82
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
3 changes: 3 additions & 0 deletions cadence/tests/flow_evm_bridge_handler_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ fun setup() {
bridgeAccount
)
Test.expect(updateBaseFeeResult, Test.beSucceeded())

// Unpause Bridge
updateBridgePauseStatus(signer: bridgeAccount, pause: false)
}

/* --- ASSET & ACCOUNT SETUP - Configure test accounts with assets to bridge --- */
Expand Down
20 changes: 8 additions & 12 deletions cadence/tests/flow_evm_bridge_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ fun setup() {

/* --- CONFIG TEST --- */

access(all)
fun testUnpauseBridgeSucceeds() {
updateBridgePauseStatus(signer: bridgeAccount, pause: false)
}

access(all)
fun testSetGasLimitSucceeds() {

Expand Down Expand Up @@ -984,12 +989,8 @@ fun testBatchOnboardByEVMAddressSucceeds() {
access(all)
fun testPauseBridgeSucceeds() {
// Pause the bridge
let pauseResult = executeTransaction(
"../transactions/bridge/admin/pause/update_bridge_pause_status.cdc",
[true],
bridgeAccount
)
Test.expect(pauseResult, Test.beSucceeded())
updateBridgePauseStatus(signer: bridgeAccount, pause: true)

var isPausedResult = executeScript(
"../scripts/bridge/is_paused.cdc",
[]
Expand All @@ -1012,12 +1013,7 @@ fun testPauseBridgeSucceeds() {
)

// Unpause bridging
let unpauseResult = executeTransaction(
"../transactions/bridge/admin/pause/update_bridge_pause_status.cdc",
[false],
bridgeAccount
)
Test.expect(unpauseResult, Test.beSucceeded())
updateBridgePauseStatus(signer: bridgeAccount, pause: false)

isPausedResult = executeScript(
"../scripts/bridge/is_paused.cdc",
Expand Down
10 changes: 10 additions & 0 deletions cadence/tests/test_helpers.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,16 @@ fun evmAddressRequiresOnboarding(_ addressHex: String): Bool? {

/* --- Transaction Helpers --- */

access(all)
fun updateBridgePauseStatus(signer: Test.TestAccount, pause: Bool) {
let pauseResult = _executeTransaction(
"../transactions/bridge/admin/pause/update_bridge_pause_status.cdc",
[pause],
signer
)
Test.expect(pauseResult, Test.beSucceeded())
}

access(all)
fun transferFlow(signer: Test.TestAccount, recipient: Address, amount: UFix64) {
let transferResult = _executeTransaction(
Expand Down

0 comments on commit 4e98a82

Please sign in to comment.