Skip to content

Commit

Permalink
change function access and panic message
Browse files Browse the repository at this point in the history
  • Loading branch information
janezpodhostnik committed May 22, 2024
1 parent cae8329 commit 698a7fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contracts/DependencyAudit.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ access(all) contract DependencyAudit {
access(all) event PanicOnUnstagedDependenciesChanged(shouldPanic: Bool)

// checkDependencies is called from the FlowServiceAccount contract
access(contract) fun checkDependencies(_ dependenciesAddresses: [Address], _ dependenciesNames: [String], _ authorizers: [Address]) {
access(account) fun checkDependencies(_ dependenciesAddresses: [Address], _ dependenciesNames: [String], _ authorizers: [Address]) {
var unstagedDependencies: [Dependency] = []

var numDependencies = dependenciesAddresses.length
Expand Down Expand Up @@ -57,7 +57,7 @@ access(all) contract DependencyAudit {
}

// the transactions will fail with a message that looks like this: `error: panic: Found unstaged dependencies: A.2ceae959ed1a7e7a.MigrationContractStaging, A.2ceae959ed1a7e7a.DependencyAudit`
panic("Found unstaged dependencies: ".concat(unstagedDependenciesString))
panic("This transaction is using dependencies not staged for Crescendo upgrade coming soon! Learn more: https://bit.ly/FLOWCRESCENDO. Dependencies not staged: ".concat(unstagedDependenciesString))
} else {
emit UnstagedDependencies(dependencies: unstagedDependencies)
}
Expand Down
6 changes: 3 additions & 3 deletions lib/go/contracts/internal/assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/dependency_audit_tests.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,5 @@ access(all) fun testChekDependenciesWithUnstagedEntriesPanics() {
)
Test.expect(commitResult, Test.beFailed())
// not sure how to test this:
// Test.expect(commitResult.error!.message, Test.contain("panic: Found unstaged dependencies: A.0000000000000008.Foo") )
// Test.expect(commitResult.error!.message, Test.contain("panic: This transaction is using dependencies not staged for Crescendo upgrade coming soon! Learn more: https://bit.ly/FLOWCRESCENDO. Dependencies not staged: A.0000000000000008.Foo") )
}

0 comments on commit 698a7fd

Please sign in to comment.