diff --git a/contracts/DependencyAudit.cdc b/contracts/DependencyAudit.cdc index ed5132b..89a9f58 100644 --- a/contracts/DependencyAudit.cdc +++ b/contracts/DependencyAudit.cdc @@ -19,6 +19,8 @@ access(all) contract DependencyAudit { access(all) event PanicOnUnstagedDependenciesChanged(shouldPanic: Bool) + access(all) event BlockBoundariesChanged(start: UInt64?, end: UInt64?) + // checkDependencies is called from the FlowServiceAccount contract access(account) fun checkDependencies(_ dependenciesAddresses: [Address], _ dependenciesNames: [String], _ authorizers: [Address]) { var unstagedDependencies: [Dependency] = [] @@ -41,27 +43,96 @@ access(all) contract DependencyAudit { } if unstagedDependencies.length > 0 { - if DependencyAudit.panicOnUnstaged { - // If `panicOnUnstaged` is set to true, the transaction will panic if there are any unstaged dependencies - // the panic message will include the unstaged dependencies - var unstagedDependenciesString = "" - var numUnstagedDependencies = unstagedDependencies.length - var j = 0 - while j < numUnstagedDependencies { - if j > 0 { - unstagedDependenciesString = unstagedDependenciesString.concat(", ") - } - unstagedDependenciesString = unstagedDependenciesString.concat(unstagedDependencies[j].toString()) - - j = j + 1 - } - - // the transactions will fail with a message that looks like this: `error: panic: Found unstaged dependencies: A.2ceae959ed1a7e7a.MigrationContractStaging, A.2ceae959ed1a7e7a.DependencyAudit` - 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) + self.maybePanicOnUnstagedDependencies(unstagedDependencies) + + emit UnstagedDependencies(dependencies: unstagedDependencies) + } + } + + access(self) fun maybePanicOnUnstagedDependencies(_ unstagedDependencies: [Dependency]) { + // If `panicOnUnstaged` is set to false, the function will return without panicking + // Then check if we should panic randomly + if !DependencyAudit.panicOnUnstaged || !self.shouldPanicRandomly() { + return + } + + var unstagedDependenciesString = "" + var numUnstagedDependencies = unstagedDependencies.length + var j = 0 + while j < numUnstagedDependencies { + if j > 0 { + unstagedDependenciesString = unstagedDependenciesString.concat(", ") } + unstagedDependenciesString = unstagedDependenciesString.concat(unstagedDependencies[j].toString()) + + j = j + 1 } + + // the transactions will fail with a message that looks like this: `error: panic: Found unstaged dependencies: A.2ceae959ed1a7e7a.MigrationContractStaging, A.2ceae959ed1a7e7a.DependencyAudit` + panic("This transaction is using dependencies not staged for Crescendo upgrade coming soon! Learn more: https://bit.ly/FLOWCRESCENDO. Dependencies not staged: ".concat(unstagedDependenciesString)) + } + + // shouldPanicRandomly is used to randomly panic on unstaged dependencies + // The probability of panicking is based on the current block height and the start and end block heights + // If the start block height is greater than or equal to the end block height, the function will return true + // The function will always return true if the current block is more than the end block height + // The function will always return false if the current block is less than the start block height + // The function will return true if a random number between the start and end block heights is less than the current block height + // This means the probability of panicking increases linearly as the current block height approaches the end block height + access(self) fun shouldPanicRandomly(): Bool { + // get start block height or true + // get end block height or true + // get current block height + // get random number between start and end + // if random number is less than current block return true + // else return false + + let maybeBoundaries = self.getBoundaries() + if maybeBoundaries == nil { + // if settings are invalid use default behaviour: panic true + return true + } + let boundaries = maybeBoundaries! + + let startBlock: UInt64 = boundaries.start + let endBlock: UInt64 = boundaries.end + let currentBlock: UInt64 = getCurrentBlock().height + + if startBlock >= endBlock { + // this should never happen becuse we validate the boundaries when setting them + // if settings are invalid use default behaviour: panic true + return true + } + + let dif = endBlock - startBlock + var rnd = revertibleRandom() % dif + rnd = rnd + startBlock + + // fail if the random number is less than the current block + return rnd < currentBlock + } + + access(all) struct Boundaries { + access(all) let start: UInt64 + access(all) let end: UInt64 + + init(start: UInt64, end: UInt64) { + self.start = start + self.end = end + } + } + + access(self) fun getBoundaries(): Boundaries? { + return self.account.copy(from: /storage/flowDependencyAuditBoundaries) + } + + access(self) fun setBoundaries(boundaries: Boundaries) { + self.account.load(from: /storage/flowDependencyAuditBoundaries) + self.account.save(boundaries, to: /storage/flowDependencyAuditBoundaries) + } + + access(self) fun unsetBoundaries() { + self.account.load(from: /storage/flowDependencyAuditBoundaries) } // The Administrator resorce can be used to add or remove addresses from the excludedAddresses dictionary @@ -87,6 +158,23 @@ access(all) contract DependencyAudit { emit PanicOnUnstagedDependenciesChanged(shouldPanic: shouldPanic) } + // setStartEndBlock sets the start and end block heights for the `shouldPanicRandomly` function + access(all) fun setStartEndBlock(start: UInt64, end: UInt64) { + pre { + start < end: "Start block height must be less than end block height" + } + + let boundaries = Boundaries(start: start, end: end) + DependencyAudit.setBoundaries(boundaries: boundaries) + emit BlockBoundariesChanged(start: start, end: end) + } + + // unsetStartEndBlock unsets the start and end block heights for the `shouldPanicRandomly` function + access(all) fun unsetStartEndBlock() { + DependencyAudit.unsetBoundaries() + emit BlockBoundariesChanged(start: nil, end: nil) + } + // testCheckDependencies is used for testing purposes // It will call the `checkDependencies` function with the provided dependencies // `checkDependencies` is otherwise not callable from the outside diff --git a/lib/go/contracts/internal/assets/assets.go b/lib/go/contracts/internal/assets/assets.go index 2f2abc0..1bfa3e0 100644 --- a/lib/go/contracts/internal/assets/assets.go +++ b/lib/go/contracts/internal/assets/assets.go @@ -1,6 +1,6 @@ // Code generated by go-bindata. DO NOT EDIT. // sources: -// DependencyAudit.cdc (6.09kB) +// DependencyAudit.cdc (9.656kB) // MigrationContractStaging.cdc (19.438kB) package assets @@ -70,7 +70,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _dependencyauditCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x58\x6d\x6f\xdb\xb6\x13\x7f\xef\x4f\x71\xf5\x2b\x0b\x7f\x57\x6e\x0b\xfc\x51\x54\xa8\x57\x64\x69\x0a\x0c\xe8\x13\x96\x6e\x7b\x61\x04\x33\x23\x9d\x6d\x26\x32\x69\x90\x94\x53\x2f\xc8\x77\x1f\x8e\x94\x25\x52\xa2\x9c\x0c\x05\x2a\x04\x81\x64\x1e\xef\x8e\xbf\x7b\xe0\x8f\xe4\xdb\x9d\x54\x06\xc6\x9f\xf8\x5a\x31\xc3\xa5\x38\x97\xc2\x28\x96\x9b\x4b\xc3\xd6\x5c\xac\xc7\xa3\xd1\x6c\x06\xdf\x36\x5c\x43\x5e\x8f\x00\xd7\xf4\x57\x69\x2c\xe0\xfa\x00\x66\x83\xf0\xe1\xcf\x4f\x90\xb3\xb2\xe4\x62\x6d\xbf\x97\xf9\x06\xf3\xdb\xf7\xb8\x43\x51\xa0\xc8\x39\xea\x25\xac\x2a\x91\x93\x01\x58\x29\xb9\x05\xd6\x7e\xcb\x95\x9d\xa3\xd9\x16\x41\xd0\x3f\x26\x0a\xd0\x5c\xac\x05\x33\x95\x42\xe0\xc2\xd9\x28\xe5\xdd\x25\xaa\x3d\xcf\xf1\x2c\xcf\x65\x25\x4c\xe3\xd1\x94\x7c\x64\xc6\x8a\xa1\x28\x48\x23\xee\x51\x1d\xc0\x28\x26\x34\xb3\x66\x52\xb7\x0e\x84\x65\xe1\xb9\x75\x56\x14\x0a\xb5\x26\xff\xc8\x6a\x30\xf6\x99\x6d\xe9\xf7\x3b\x5e\x96\x70\x8d\xc0\xca\xd2\x1a\xf0\x45\x40\x20\x16\x05\x16\x60\x24\xa8\x8a\xfc\x24\x2f\x42\xa3\x8d\xdd\x53\x98\x58\x23\x56\x00\xf8\x0a\x98\x38\x1c\x51\x09\xac\x31\x85\x20\xa4\x01\x6d\xd8\x1a\x8b\x23\x30\x43\xa1\x6b\xe0\xb1\x4b\xff\xed\xa9\x6a\xa7\x56\x20\xf4\x0c\xb7\xdc\x00\x13\x84\xaa\x30\x70\xc7\xcd\xc6\x0a\x55\xa2\xf6\xc4\x57\x37\x05\xa9\x60\xc7\x04\xcf\x69\x29\x4b\xfb\xf6\x45\xfc\x51\x8b\x2e\x29\x75\x34\x1a\x42\xcc\xa8\x0a\xd3\x11\xcb\x73\xd4\x7a\xc2\xca\x32\x69\x53\xac\x81\xe9\x70\x56\x15\xdc\xc0\xfd\x68\x04\x00\xe0\xcb\x96\x68\xe0\xac\xd8\x72\xc1\xb5\x51\xcc\x48\x75\x69\xa4\x62\x6b\xfc\xca\xcc\x26\x03\xef\xc3\x4d\xad\xa3\xa0\x0f\xda\xe0\x16\xd8\x31\xee\xb0\x61\x7b\x6c\xec\x6a\x17\x41\xbb\x66\x42\xe4\x1a\x1d\x28\x1a\xf6\x9c\xd9\x25\x6f\x8f\x60\xb7\xbe\x6a\x09\x77\x08\xf8\x3d\x2f\xab\x02\x49\x68\xeb\x52\x3c\xc0\xf9\x40\xd1\xbd\xcd\xb5\xbf\x0c\x8d\xe5\x2a\x81\x3d\x53\xc7\xc9\x45\x93\x8e\x19\xdc\xd7\xef\x19\xfc\x2a\x65\xf9\xd0\x5f\x3f\xcd\xeb\x80\xeb\x64\xfb\xa2\x2e\x6c\x47\x29\x3f\x05\x27\x7e\xe4\x32\x58\xb4\xb8\x5f\x25\x43\x7a\xbe\x86\x46\x7d\x75\xe7\x1b\x26\xd6\x58\x4c\xf4\x46\x56\x65\x61\x05\x9d\x4f\x49\x13\x84\x5e\x15\x50\x42\x50\xef\xc0\xa2\x85\xed\x44\xad\x07\x4e\xb9\xb1\x84\xb2\xb5\xaf\x78\xf2\x37\x44\x4b\x3d\x83\x45\xfd\x7e\x35\x85\x50\xc6\x96\x7c\x06\x8b\x4b\xa3\xb8\x58\xdb\x61\x56\x99\x8d\x54\xfc\x1f\x54\xfe\xc4\x04\xee\xad\x23\xf4\x50\x20\xaa\x08\x18\x21\x9c\x30\x87\xc5\xd5\x28\x98\x24\xaa\x6d\x00\xc4\x3c\xee\x6f\x5a\xa2\x58\x9b\x4d\x30\x95\xc3\x1c\x5e\x34\xbf\xdc\x6d\x78\x89\xc0\xe1\x6d\x4f\x65\xeb\x25\x3d\x54\x32\x5c\x5f\xd4\xc9\x06\xf3\x6e\x99\xa5\xbd\x3c\x5c\x44\x3d\x5a\xf0\xab\x2b\x78\xf7\x0e\x56\xac\xd4\x18\x58\xe0\x2b\xdf\x40\x68\xdd\x8e\xc3\x1c\x38\xfc\x0f\x5e\xf6\x46\x28\xbe\x5c\x54\xa1\xba\x87\x51\xcf\xff\xba\xe3\xcc\x07\xdb\x5e\xca\xf5\xa5\x95\x99\xb0\x63\x05\x0d\x2d\x62\x6a\xf7\x9b\xac\x9f\x02\x0b\x7e\x95\x74\xd7\xf5\xac\xb6\xdc\x5f\x54\x2c\xf8\x29\xdb\xd1\xc7\xa4\x45\xf8\x07\xdd\x49\x4e\x01\xd3\x87\xd5\x13\xe0\xab\xb8\x87\x2e\xad\xe0\x17\x78\xd1\x59\x13\x5f\xf5\x12\xa3\xd3\x68\x22\x20\xb8\x2d\xe6\xb1\x76\xef\x36\x17\x6f\x87\x74\xbd\xb6\xd9\x2e\xcc\x06\x15\xda\x0d\x89\x36\xab\xe8\xfe\x12\xb3\x4c\x4a\x9d\x8e\x2d\x6a\xcd\xd6\xe8\xd4\x72\xd1\xf4\xe4\x27\xea\x1a\xaa\x65\xd7\x10\x60\x0e\xe3\x71\x74\x8e\xa8\xb6\xb1\x7e\x08\xf3\x53\xd0\x47\x35\xdd\x04\x95\x7d\x7c\x5c\x85\xdf\xb8\x0a\x8f\x5a\xea\x47\xa4\x0e\xe5\x4d\x24\xc2\xfe\x73\x72\xb9\xc3\x83\x69\x2e\x45\xce\xcc\x64\x3c\x85\x71\x12\x55\xfe\x10\xfd\xf5\x07\xcd\xc5\x24\x16\x37\x57\xa9\x91\x4e\x6e\x92\x24\xa3\xa8\x5d\xc2\xf5\x26\xda\x79\x1e\xfa\x13\xea\x94\xf2\xf2\x54\xbb\x8c\x5a\x31\x5e\x3a\xfe\xc3\x9a\x54\xb3\x94\xa1\x94\xf2\x56\x43\xc9\x6f\xe9\x9b\xeb\x0c\x96\xa8\x94\x54\x99\x4b\xcb\x0c\x3e\xc8\x4a\x14\xf1\x24\xcc\xe0\x2c\x7d\x95\x23\xc3\x37\xff\x7f\x83\xc5\x4b\xf6\x1a\x5f\xb3\x74\xa8\xbb\x4d\x63\xc2\x9d\x6a\x5d\xf6\xd6\x63\x9d\x98\x8c\x2d\x8d\xf7\x8b\xcf\xd2\x78\x82\x3e\x24\xb5\x2d\xc5\x5c\x49\x05\xe7\x0a\x75\x8e\xa2\x90\x50\xed\xd6\x8a\x15\x44\x97\xb6\x34\x49\x4b\x29\x9e\xc1\x47\x64\x4a\xc0\x56\x2a\xcc\x60\x63\xcc\x4e\x67\xb3\xd9\x35\x37\x69\x79\x98\x7d\xf8\xf8\xe5\xaf\xf3\xdf\x2f\x2e\xcf\x2f\x3e\xbf\xff\x92\xc2\xfb\xb8\x91\x0c\xc6\xa7\xa2\xeb\xe2\xda\xed\x7f\x80\xa5\xc6\x48\x56\x5b\xa6\xfa\x04\xa6\x13\xb3\xd4\x6d\xb1\xe1\xdb\x43\xc0\x23\x03\xe6\x09\x0a\xb5\x54\x39\x42\xce\x04\x71\x46\x7b\x34\x32\x92\x58\x26\xd8\xd1\xad\xdc\xa3\xc7\x39\x1b\x9e\xd3\xdb\x6f\xa1\xe0\x36\x32\x4c\x1d\x6a\x6b\x3d\x12\x46\xb6\x2a\x32\x16\xba\xd0\x42\x41\x67\xa1\xa2\xb8\xe8\xa9\x26\x6f\xc8\x68\xeb\x07\x35\xe5\xa7\x78\xd1\x75\x81\xe8\x56\xcc\xc4\x84\x45\x38\x56\xd2\x89\x12\xa5\x54\x2d\x47\x27\x98\xd6\x9b\x7e\x30\x1f\xa7\x27\xf5\x6c\x62\x57\xb4\xbd\x0c\x06\xd0\x07\xc7\x85\xa3\x8f\x4f\x1d\xa6\x10\xa2\xa7\x87\x2a\x06\xd2\x80\xa9\x9f\x8e\x53\xea\x1c\x99\xdc\xe2\x21\x3b\x6a\x1a\xce\x76\x1f\x2c\x8d\xe6\x04\xdf\xa7\x61\xed\x4e\xfc\xbd\x8d\x7f\xcf\x14\x67\xd7\x25\x1e\xb3\x6c\xcf\xca\x0a\xe9\xfc\xb9\xf4\x4e\x07\xcb\x41\xe8\x4e\x1b\x8e\x9c\x30\x3a\xb8\x3c\xc6\x60\xe6\xe0\xa9\x08\x66\xda\x16\xf2\x5f\x0f\x39\xde\x47\x32\x00\xa5\x41\x6d\xce\x63\xa7\x1f\xdb\x2e\x28\xdc\x24\x41\x8d\x75\x57\xa9\x9d\xd4\x1e\x3d\x21\x72\x55\x1f\x4b\xf3\xe3\x3d\xc4\x23\xf7\x09\xf5\x11\x7d\xa7\xe4\x9e\x17\x43\xb4\x67\x36\x8b\xaa\xe1\x1a\x24\x31\xb1\x3b\xae\xdd\xcd\x00\x19\xb5\xb1\x6c\xca\x41\x56\x46\xf3\x02\x07\xc3\x17\x5d\xec\xcf\x3a\x91\xd1\xa3\xd0\x54\x4a\xf4\xd2\xa0\x7f\x4a\x8c\x7a\x34\xed\x3b\x31\xf5\x0d\x27\xf1\xcd\xc1\x47\x41\x1b\x55\x05\x37\x19\x9e\x83\xdd\x7b\x8c\xe6\x68\x50\x3b\x30\x28\xe8\x0e\x08\x0e\x0c\x8f\xe1\x0b\x6e\x26\x5d\x1d\xd3\x40\xb8\x0b\x8f\xc6\x72\x95\x1e\xdb\xcb\xfc\xe8\x40\x5f\xc4\x5e\xc8\xcd\xad\xaa\x58\x5a\xf7\xc2\xde\xd0\xb0\xa3\xe1\x8e\x5d\xa2\xb8\xb5\xb1\x86\xf5\xf9\xbe\x78\x44\x2e\x98\xd7\xf4\x6d\x78\xf1\x1d\x76\x0a\x57\xfc\x7b\x30\xde\xd5\x19\x7c\xa7\xba\xe4\x39\x4e\x28\x79\x33\x78\x35\x85\x6a\xf7\x4d\x66\x1d\x11\x47\xc9\x93\x58\x0e\x8d\xcf\xd2\x86\xa1\x04\x93\x92\x86\x04\xa7\xe3\xe6\xbd\x81\x6d\x20\x47\x6a\x02\xc1\x68\xf7\x6e\x37\x73\x3a\x26\xb1\xbd\xa3\x0d\xf6\x36\xd4\xdd\x5f\x81\x96\xf5\xa5\x62\x33\xa5\xe6\x18\x0e\xf9\xf6\x0a\x56\xbb\xeb\x12\xa8\xef\x44\x7c\x53\xcb\xde\x7e\xd0\xde\x6a\x86\xbb\x5d\xd3\x36\xea\x6b\xb2\xe6\x5e\x2c\x1d\x35\x79\x16\xb9\xab\x8a\x16\xa1\xc5\xa1\xbf\x6b\xce\xe1\xfe\x21\x94\xe9\x77\x66\x77\xaf\x10\x4a\x0d\x5d\xf5\xc1\x1c\x66\x35\x58\xb3\x55\x29\xef\x3a\x05\x6f\xa7\xb5\xaa\x3a\x9b\x6a\xdf\xbd\x48\x95\x3c\x9d\x75\x78\x85\xe1\xaa\x9a\xe2\xf5\xf6\x39\xe4\x0a\x99\xe9\x10\x36\x2f\xbf\x5d\xfe\xbb\xb8\xa5\x94\x05\x93\xb7\xcf\xed\xdc\x29\x18\x99\x9d\x5e\x7e\x52\xa7\xd6\xc3\xe8\xdf\x00\x00\x00\xff\xff\xd9\xff\x40\x24\xca\x17\x00\x00" +var _dependencyauditCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x5a\x6d\x6f\x1b\x37\xf2\x7f\xef\x4f\x31\x11\xf0\x07\x24\x54\x59\xa7\xc5\xff\xae\xa8\x60\x25\x70\x9c\x04\x08\xd0\x36\x45\x9d\xde\xbd\x30\x8c\x8a\xda\x1d\x49\x8c\x29\x52\x47\x72\xa5\xe8\x5c\x7f\xf7\x03\x1f\xb4\x4b\x72\xb9\x6b\x07\x6d\x63\x14\x8d\x56\x3b\x9c\x87\xdf\x0c\x87\x33\x43\xd1\xed\x4e\x48\x0d\xa3\x9f\xe8\x5a\x12\x4d\x05\xbf\x12\x5c\x4b\x52\xea\x6b\x4d\xd6\x94\xaf\x47\x67\x67\xe7\xe7\xf0\x71\x43\x15\x94\xfe\x0d\x50\x65\xfe\xab\x15\x56\xb0\x3c\x82\xde\x20\xbc\xfb\xd7\x4f\x50\x12\xc6\x28\x5f\xdb\xe7\x45\xb9\xc1\xf2\xee\x0d\xee\x90\x57\xc8\x4b\x8a\x6a\x01\xab\x9a\x97\x46\x00\xac\xa4\xd8\x02\x69\x9f\xc5\xca\xae\x51\x64\x8b\xc0\xcd\xff\x08\xaf\x40\x51\xbe\xe6\x44\xd7\x12\x81\x72\x27\x83\x89\xc3\x35\xca\x3d\x2d\xf1\xb2\x2c\x45\xcd\x75\xa3\xd1\xd4\xe8\x48\xb4\x25\x43\x5e\x19\x8e\xb8\x47\x79\x04\x2d\x09\x57\xc4\x8a\x29\x9c\x1d\x08\x8b\x2a\x50\xeb\xb2\xaa\x24\x2a\x65\xf4\x33\x52\xa3\x77\x3f\x93\xad\xf9\xfe\x40\x19\x83\x25\x02\x61\xcc\x0a\x08\x49\x80\x23\x56\x15\x56\xa0\x05\xc8\xda\xe8\x69\xb4\x88\x85\x36\x72\x87\x30\xb1\x42\x2c\x01\xd0\x15\x10\x7e\x3c\xa1\x12\x49\x23\x12\x81\x0b\x0d\x4a\x93\x35\x56\x27\x60\xfa\x5c\xd7\xc0\x63\x4d\x7f\xff\x54\xb6\x53\x4b\x10\x6b\x86\x5b\xaa\x81\x70\x83\x2a\xd7\x70\xa0\x7a\x63\x89\x6a\xee\x35\x09\xd9\x4d\x41\x48\xd8\x11\x4e\x4b\x63\xca\xc2\x7e\xfa\xc0\x7f\xf3\xa4\x0b\x13\x3a\x0a\xb5\x41\x4c\xcb\x1a\x8b\x33\x52\x96\xa8\xd4\x98\x30\x36\x69\x43\xac\x81\xe9\x78\x59\x57\x54\xc3\xfd\xd9\x19\x00\x40\x48\xcb\x50\xc3\x65\xb5\xa5\x9c\x2a\x2d\x89\x16\xf2\x5a\x0b\x49\xd6\xf8\x0b\xd1\x9b\x19\x04\x0f\x6e\xa9\xf7\x82\x3a\x2a\x8d\x5b\x20\x27\xbf\xc3\x86\xec\xb1\x91\xab\x9c\x07\xad\xcd\x06\x91\x25\x3a\x50\x14\xec\x29\xb1\x26\x6f\x4f\x60\xb7\xba\x2a\x01\x07\x04\xfc\x5c\xb2\xba\x42\x43\xb4\x75\x21\x1e\xe1\x7c\x34\xde\xbd\x2b\x55\x68\x86\x42\xb6\x9a\xc0\x9e\xc8\xd3\xe2\xaa\x09\xc7\x19\xdc\xfb\xcf\x33\x78\x2d\x04\x7b\xe8\xda\x6f\xd6\x25\xe0\x3a\xda\x2e\xa9\x73\xdb\x89\x2a\x0c\xc1\x71\xe8\xb9\x19\xdc\xb4\xb8\xdf\x4e\xfa\xf8\xfc\x12\x0b\x0d\xd9\x5d\x6d\x08\x5f\x63\x35\x56\x1b\x51\xb3\xca\x12\x3a\x9d\x7a\x99\xbd\x66\xa2\xbc\x7b\x2d\x6a\x5e\x11\x19\x32\xd0\x44\xea\x19\xfc\xf6\x9e\xeb\x7f\xfe\xff\xab\xa9\xd9\xd5\xcd\xd3\xa4\x71\x68\x67\x47\x99\xe0\x32\x79\x08\xab\xd6\x05\x03\x79\x23\xd2\xc9\xbd\x9b\x98\xc8\xef\x32\x1e\xff\x0e\xd9\xb4\x31\x83\x1b\xff\xf9\x76\x0a\x31\x8d\x4d\x1f\x33\xb8\xb9\xd6\x92\xf2\xb5\x7d\x4d\x6a\xbd\x11\x92\xfe\x17\x65\xb8\x70\x02\xf7\x56\x11\xf3\x67\x9c\x5a\x67\x80\x8d\x5d\x03\x73\xb8\xb9\x3d\x8b\x16\xf1\x7a\x1b\x01\x31\xcf\xeb\x5b\x30\xe4\x6b\xbd\x89\x96\x52\x98\xc3\x8b\xe6\x9b\xc3\x86\x32\x04\x0a\x17\x1d\x96\xad\x96\xe6\xcf\x6c\x3f\xaa\xde\xfa\xc0\x85\x79\xba\x65\x8b\x4e\x4c\xdf\x64\x35\xba\xa1\xb7\xb7\xf0\xea\x15\xac\x08\x53\x18\x49\xa0\xab\x50\x40\x2c\xdd\xbe\x87\x39\x50\xf8\x06\xbe\xed\xbc\x31\xfe\xa5\xbc\x8e\xd9\x3d\x9c\x75\xf4\xf7\xd9\x6b\xde\x9b\x42\x0b\xaa\xae\x2d\xcd\x98\x9c\x76\x63\x9f\x11\x53\x7b\x76\xcd\xba\x21\x70\x43\x6f\x27\xa9\x5d\xcf\xbc\xe4\xae\x51\x39\xe7\x17\x64\x67\x1e\xc6\x2d\xc2\x7f\x52\x9d\xc9\x10\x30\x5d\x58\x03\x02\xba\xca\x6b\xe8\xc2\x0a\x5e\xc2\x8b\xc4\x26\x93\xe3\x8a\x2d\x39\x2e\x71\x20\x6d\x8c\x73\x3c\x27\xb1\x5a\xf6\x08\x7a\x42\x0a\xcb\xb3\x6a\x4d\x09\x0c\x8a\xd2\xb0\xd9\xf6\x8f\xea\xf9\xfb\x13\x36\x67\xb8\x9d\xdd\xb9\x3b\x74\x06\xda\xb0\xcf\x1d\xb9\x12\x75\x2d\xb9\x3d\x6b\x45\xad\x5d\xa6\xbf\xa3\x7c\x1d\xf2\xfe\xb8\x41\xde\x56\x0d\x07\x04\x97\x77\xfd\xe9\x2b\x09\xaf\xc4\x96\x1d\x43\xe7\x3d\x4b\x77\x69\xa2\x1a\xfc\xf1\x07\x3c\xb3\x3e\x0b\x52\xf8\xaf\x9e\xd1\x78\x92\x38\xd7\xe9\x98\x8b\x93\xbe\x3c\xe6\x92\x21\xcc\x61\x34\x4a\xd3\x57\x0e\x70\x98\x0f\x85\x5b\xc4\xe1\x53\x26\x8b\x7d\x72\x59\x2c\xcb\xf9\x3e\xdd\x93\x9f\x32\xd1\xdb\xb7\x23\x1b\x33\xfa\x5f\x16\xa5\xe0\x25\xd1\xe3\xd1\x14\x46\xe9\x7e\xfb\x0b\xd9\xe7\x28\x6e\x3e\xdd\x16\x5a\x38\xba\xf1\x24\xd9\x47\x06\xa7\x4f\x7d\xdb\xfb\xfc\xdc\x46\x62\x50\xc1\x2a\x17\x8d\x2b\x42\x99\xab\xfb\x08\x6c\x51\x29\xb2\x46\x57\x2a\x31\x21\xee\x14\x30\x7a\x67\x9e\xa9\x9a\xc1\x02\xa5\x14\x72\xe6\x62\x70\x06\xef\xcc\xd1\x9e\x2f\x14\x67\x70\x59\x7c\x57\x22\xc1\x1f\xfe\xf1\x03\x56\xdf\x92\xef\xf1\x7b\x52\xf4\x65\xe2\x69\x8e\x38\x09\xe6\x45\x63\x87\x15\x3e\x1e\xd9\xb6\x25\x30\xc6\xb5\x2d\x06\xda\xb8\x88\x6f\x4b\xea\x95\x90\x70\x25\x51\x95\xc8\x2b\x01\xf5\x6e\x2d\x49\x65\xca\xc3\xad\x59\xa4\x84\xe0\xcf\xe0\x47\x24\x92\xc3\x56\x48\x9c\xc1\x46\xeb\x9d\x9a\x9d\x9f\x2f\xa9\x2e\xd8\xf1\xfc\xdd\x8f\x1f\xfe\x7d\xf5\xeb\xdb\xeb\xab\xb7\x3f\xbf\xf9\x50\xc0\x9b\xbc\x90\x19\x8c\x86\xbc\xe7\xfc\xe6\x73\xf4\x43\x53\xeb\x64\xf6\x63\xd3\x85\x99\xee\xe3\xf4\x9d\xdb\xfb\x82\xe7\x31\x0f\x4b\xe1\x9d\x14\x4b\xb2\xa4\x8c\x6a\xdb\x16\x34\x19\xc6\xb0\x5d\x12\xc3\x57\xb8\x06\xa3\xac\xa5\x34\xb5\xda\xd2\xd4\x6a\xb0\x41\xba\xde\x68\xdb\x2e\xd9\xb6\xcd\x54\x6a\xf6\xc9\x74\x5e\x21\x49\x23\xec\xfd\x2a\xa0\x8c\x98\x50\x05\x6b\x89\x44\xa3\x34\xd1\xc4\x4d\xe7\x80\xff\xa9\x09\xb3\xdd\x81\x6f\xe6\xc2\x05\x03\x89\xd2\x34\x13\xa1\x75\x31\x11\x61\x07\x72\x54\x21\xad\xd9\xf2\x5d\xe3\xa8\xb2\x9e\x75\xda\xe4\x34\x78\xaa\x08\x9b\xd7\x7b\x65\x30\x54\xaa\x95\xd1\x05\xa6\x5f\x4a\x62\x01\xf1\x8e\x37\x69\x6e\x89\x12\x96\xa8\x0f\x88\xfc\x31\xcf\x74\x75\xc8\xf9\xb8\xd5\xc2\xc0\x82\x84\x2b\x4b\xda\x1f\x37\xbc\x94\x48\x4c\x53\xc5\x28\x47\x22\xd9\x11\x88\x1a\x88\xa0\xdd\x4e\x0a\x52\x6e\x50\xf5\x23\xdd\x39\xa2\xb3\xc7\x92\xeb\x31\xe2\x73\x77\xed\xea\xbb\x34\xe2\x84\x6c\x23\x25\xa0\x4c\x85\xf7\xd1\xf5\xc2\x14\xd0\xe4\x3d\x12\x79\x23\x5c\x42\x57\xc9\x8a\xc8\x37\xb1\xc0\x34\xd6\x3d\x0b\x34\xb1\x16\x06\x5e\x9b\xd1\x4d\x99\x6b\xcb\x9a\xb6\xc7\x82\xb9\xab\xca\xd6\xa8\xdb\x2f\xc7\x93\xb0\x4c\xe8\xac\x98\x03\xa7\x2c\x39\x1c\x9d\xee\x0a\xb5\xa6\x7c\xed\xa6\x08\x94\xef\x09\xa3\x95\xc9\x4a\x50\xe1\x8a\xd4\xcc\xf4\xd0\x1b\xb2\xa7\xa2\x3e\x9d\x09\xb1\xf6\xd0\x94\x11\xf1\xf7\x0f\x91\x05\xcb\x50\xf9\x44\xb9\x67\xb1\xb1\x16\x67\xdb\x55\x9e\x1a\x46\x98\x07\xeb\x0b\xfb\x3e\x5a\x81\xbc\x1a\xa0\x0f\xbd\xc5\xda\x08\x48\x57\xac\x51\x5f\x05\x6f\xc6\x93\xc2\x07\x47\x08\x6b\xab\x1b\xbc\x9c\x37\x72\xbb\xb0\x9a\x93\xf4\x54\xcb\x71\xdc\xa3\x84\x8d\x6d\x01\x60\x89\xa5\x81\xf6\x80\x60\x71\x26\xda\xce\x1b\x42\x78\x0e\xa6\x24\xf4\x3e\xb1\xb3\x88\xaf\xe9\xb2\x08\xa8\x8a\xae\x20\x30\xf2\x79\x60\x7d\x54\xb8\x49\x6e\x3a\x30\x69\xcc\xd4\x74\xc9\xd0\x6d\xeb\xf1\x04\xfe\xcf\xb0\x68\x48\x3d\x19\xaf\xe0\x9b\x90\x53\xb8\x0d\x6c\x91\xe2\x53\xee\xc0\x96\xea\x24\xa4\xb3\xc4\x2a\x23\xe4\x22\x72\x74\xa6\x6b\xb0\x33\x0c\xa5\x65\x5d\x6a\x08\x76\x4a\xeb\xcb\x74\x56\x15\x8d\x34\x7a\xa9\x82\x41\x47\x10\x3a\x9c\xea\x78\x24\x12\x4d\x44\xd2\xb2\xdc\xd5\xef\x36\xdf\xcc\x21\x8e\xf7\xe6\x35\x5a\x38\xc3\xe0\x1e\x6e\x8d\x92\x64\x31\x0b\x6c\x7e\x15\x88\xf7\x08\x5a\x11\x7e\xa2\x52\x94\x62\x77\xbc\x68\xc9\x5f\x8e\x57\x52\x6c\x67\x70\xae\xdc\x88\xee\x7c\xc5\xc4\x21\xa9\xe4\x5a\xea\xc9\xa0\x56\x2a\xd2\xaa\xdd\x06\xa1\x7a\x21\x3a\x91\x5e\x4c\x90\xea\x4f\xea\xd5\xe1\xa9\xc8\x1e\x03\x3d\xa6\xa0\xc5\x5f\x63\x69\xcd\x63\x5b\xff\x4e\xab\x1e\xa2\x89\x69\x34\x63\x05\x89\x4a\xc8\x12\xa1\x24\x26\x1b\x35\xe5\x27\xa9\x2a\xb0\x6f\xb7\x62\x8f\xc1\x74\xb5\x99\xc2\x75\xa6\x41\x50\x51\x5b\xd6\x10\x79\xf4\xd2\x3a\xbb\xcb\xc8\xaa\x8d\xb0\x58\x85\xe8\x98\x27\x55\xf5\xb6\xc3\xda\x68\x63\x84\xb6\x7a\x9c\xea\xc9\xc7\xb4\x48\x55\x30\xd0\xe7\x44\x8c\x49\x66\x02\x98\xee\x43\xd3\x4c\x78\x3a\xa0\x3c\xd0\xa6\xdb\x64\x3e\x3e\x3c\xf3\xab\x6f\x61\xde\xcd\xc6\x0f\x3d\xbd\x9c\x73\x47\x17\x1f\xef\xa6\x18\xa2\xa7\xbb\x2a\x07\x52\x8f\xa8\xaf\x8e\x53\xe1\x14\x19\xdf\xe1\x71\x76\xe2\xd4\xd7\x7e\xc7\x60\x29\xd4\x03\xa3\x1f\xf3\xda\xd5\xa9\xdd\x69\xce\x9e\x48\x4a\x96\x0c\x4f\x51\xb6\x27\xac\x46\x53\x1a\x2f\x82\x6a\x75\xd1\x0b\xdd\xb0\xe0\xcc\x2c\x3d\xc1\xe5\xb1\x91\xce\x3c\x2c\x9a\xbb\x33\xb5\x2f\x1d\xe7\x07\x0f\x93\x7e\x28\xaf\xcd\xb1\xf3\xf6\x74\xf8\x37\xe0\x0d\xf5\x24\x26\x0c\x2c\xc0\x99\x1a\xbf\xbd\x2a\x1b\x82\x31\x12\xfa\x05\x07\xe6\x4e\x62\x26\xd6\x9c\xae\x17\x6e\xe1\xe8\xba\xdb\x4b\x6c\x6b\x65\xaf\x88\xda\xd2\x22\x35\x6a\xf4\xd8\x04\x3a\x2a\x6c\x83\xf4\xee\x75\xb7\xff\x78\xd5\x91\x57\x93\x41\xbf\xf7\x1f\x86\xcb\xcc\xb1\xd5\xf8\x7f\xf8\x06\xa6\x57\x83\xd8\xe3\xf6\x78\x8a\x7d\x6e\xbf\xfa\xdb\xbd\xde\x15\xdc\x99\x52\xa6\x38\x75\x8e\xd2\x2f\xc5\x84\x53\xe6\x11\xe1\x94\xf5\x21\xa2\x51\xe9\xab\xdc\xfd\x94\x3d\x32\xad\xd5\xa8\x6c\x95\xbe\xab\xe5\x4e\x28\x3f\x9b\xf1\xab\xdf\xfb\x4b\xc8\xf2\x74\xeb\xfc\xc8\xed\xb1\xbf\x90\xdd\x49\xb1\xa7\x55\x6e\xe6\xe3\xf9\xe6\xd8\x50\x05\x42\x6f\x50\x1e\xa8\x72\xf7\xc0\x46\xa8\xcd\x67\xcd\x91\x20\x6a\xad\x68\x85\xbd\x5e\xc8\x1a\xfb\xb5\xee\xcc\xa0\xad\x3b\x53\x57\x77\xef\xf1\xb2\x1a\x4d\xbb\x4a\x4c\x43\xc1\xc3\xf7\x07\x61\x27\xd0\x2a\x30\xd0\x09\x34\x97\x37\x5e\x81\x5e\x42\x77\x85\xe3\xc0\x48\xba\x81\x94\xc7\x34\x22\xce\x76\x04\xa7\x23\x76\x7e\x52\xa0\x4b\x62\x7f\x7e\x31\xb7\xac\x72\x61\xdd\x71\x7b\x33\x64\x3e\x09\x4e\xe4\x9a\xfe\xce\x0b\x6b\x66\xda\xa1\x2e\xc1\x98\x3a\xed\x53\x7d\x8d\xf2\xe2\xb3\xc9\xce\x2b\xfa\x39\x7a\x9f\xf2\x8c\x9e\x0b\xc5\x68\x89\xbe\xee\xfd\x6e\x0a\xf5\xee\xa3\x98\x25\x24\xee\x02\x61\x92\x8b\xa1\xd1\x65\xd1\xcc\x67\xa3\x45\x93\x66\xa4\x5f\x8c\x9a\xcf\x0d\x6c\x3d\x31\xe2\x8b\x68\x62\x2a\xd8\xb6\xa0\x35\xed\x3d\xd9\xbb\xd2\xd9\x25\x48\x5b\x9c\x83\x12\xfe\x27\x24\xcd\x12\x5f\x67\x3b\xe4\xdb\x1f\xdc\x28\x77\xa1\x0d\xbe\xea\x0f\x45\x2d\x3a\x35\x51\xfb\x1b\x96\xb8\xe2\x6b\xd2\x86\xff\x51\x44\xf3\x2b\x88\xe2\xac\x89\xb3\xcc\x2f\x13\xb2\x9b\xd0\x35\x95\x9d\xca\x71\x0e\xf7\x0f\x31\x4d\xb7\x3a\x49\x26\x56\x96\xaa\xef\x87\x1d\x30\x1f\xec\x64\xec\xb2\x96\x55\x52\x58\x76\xd5\xcb\xec\x92\xa7\x57\xde\xc9\xbc\xc3\xf9\xeb\xe2\x39\x94\x76\xa2\x1d\x37\x2d\xe3\xa1\x7e\xf1\xe2\xb9\x5d\xeb\x9a\xc5\x41\xf3\x4f\xfd\xd9\xc3\xd9\xff\x02\x00\x00\xff\xff\x49\x78\x3d\x05\xb8\x25\x00\x00" func dependencyauditCdcBytes() ([]byte, error) { return bindataRead( @@ -86,7 +86,7 @@ func dependencyauditCdc() (*asset, error) { } info := bindataFileInfo{name: "DependencyAudit.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9e, 0xcf, 0xd7, 0x43, 0x2a, 0xa5, 0x5d, 0x83, 0x82, 0x97, 0xa4, 0xbe, 0x2e, 0x25, 0xfc, 0x48, 0x92, 0x88, 0xc0, 0x47, 0x21, 0x52, 0x14, 0xc1, 0x62, 0xc4, 0xb7, 0x26, 0xb7, 0x8c, 0xa9, 0x6c}} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2b, 0xd7, 0x6b, 0x7d, 0x26, 0xdd, 0xbc, 0x21, 0x74, 0x11, 0x61, 0x22, 0x24, 0x57, 0xb, 0x15, 0x57, 0xe9, 0xa9, 0xb0, 0x1c, 0x68, 0xd5, 0xad, 0xcf, 0x95, 0x26, 0x0, 0x3c, 0x7f, 0x51, 0x85}} return a, nil } diff --git a/lib/go/templates/internal/assets/assets.go b/lib/go/templates/internal/assets/assets.go index 43c9034..587cd57 100644 --- a/lib/go/templates/internal/assets/assets.go +++ b/lib/go/templates/internal/assets/assets.go @@ -25,8 +25,10 @@ // transactions/delegatee/execute_all_delegated_updates.cdc (687B) // transactions/delegatee/remove_delegated_updaters.cdc (567B) // transactions/dependency-audit/admin/add_excluded_addresses.cdc (341B) +// transactions/dependency-audit/admin/set_start_end_block.cdc (345B) // transactions/dependency-audit/admin/set_unstaged_cause_panic.cdc (352B) // transactions/dependency-audit/admin/test_check_dependencies.cdc (440B) +// transactions/dependency-audit/admin/unset_start_end_block.cdc (299B) // transactions/host/publish_host_capability.cdc (2.303kB) // transactions/migration-contract-staging/admin/commit_migration_results.cdc (809B) // transactions/migration-contract-staging/admin/set_staging_cutoff.cdc (606B) @@ -611,6 +613,26 @@ func transactionsDependencyAuditAdminAdd_excluded_addressesCdc() (*asset, error) return a, nil } +var _transactionsDependencyAuditAdminSet_start_end_blockCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\xcf\xcf\x4a\xc4\x30\x10\x06\xf0\x7b\x9e\x62\xec\x41\x5b\x90\x9e\xc4\x43\x11\x4b\xfd\x73\xf0\x26\x2c\x3e\xc0\x98\x8c\xbb\xc1\xed\x4c\x98\x4c\x10\x91\x7d\x77\xa9\xd9\x7a\xd8\xc3\xe6\x12\x42\x3e\xe6\xfb\x4d\x9c\x93\xa8\x41\xf3\x44\x89\x38\x10\xfb\xef\xa9\x84\x68\x8d\x73\xa6\xc8\x19\xbd\x45\xe1\x36\x1b\xaa\x0d\xf0\xf6\xc2\x76\x7b\x73\x0d\xc4\x61\x7d\x74\xf0\xe3\x00\x00\x92\x52\x42\xa5\x36\xc7\x2d\x93\x0e\x30\x15\xdb\x4d\xde\x4b\x61\x5b\x23\xcb\xa9\xdf\xfd\xbb\xa8\xca\xd7\xdd\xe5\x49\x6b\x3f\x85\x39\x72\xcc\xa6\x68\xa2\xf7\xed\x87\xca\x3c\xc0\xd9\xd0\xc6\x44\x71\x4b\xaf\x68\xbb\x6e\xec\x33\xd9\x66\xa1\x3e\x73\x78\xd8\x8b\xff\x5c\xe1\x7f\xd7\xd1\x4d\x1c\xba\x7f\xcf\x38\x42\x42\x8e\xbe\x6d\x1e\xa5\xec\x03\xb0\x18\x54\xdc\xf9\x5a\x58\x68\xc7\x6d\xae\x32\xe4\xaa\xb8\x68\xea\xe4\x83\x3b\xb8\xdf\x00\x00\x00\xff\xff\x28\xf0\x8b\x80\x59\x01\x00\x00" + +func transactionsDependencyAuditAdminSet_start_end_blockCdcBytes() ([]byte, error) { + return bindataRead( + _transactionsDependencyAuditAdminSet_start_end_blockCdc, + "transactions/dependency-audit/admin/set_start_end_block.cdc", + ) +} + +func transactionsDependencyAuditAdminSet_start_end_blockCdc() (*asset, error) { + bytes, err := transactionsDependencyAuditAdminSet_start_end_blockCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactions/dependency-audit/admin/set_start_end_block.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x35, 0xa0, 0x10, 0x93, 0xe9, 0x18, 0x86, 0xf1, 0x3e, 0xdf, 0x9c, 0xb1, 0x5, 0xbb, 0xa2, 0x9c, 0xe2, 0x4c, 0x4c, 0x80, 0x75, 0xe, 0x9d, 0x9b, 0xb4, 0xf1, 0x64, 0x46, 0x34, 0xa9, 0xff, 0x43}} + return a, nil +} + var _transactionsDependencyAuditAdminSet_unstaged_cause_panicCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\xcf\x41\x4e\xc4\x30\x0c\x05\xd0\x7d\x4e\x61\xba\x80\x76\xd3\x03\x54\x88\xaa\xc0\x9e\x91\x10\x07\x08\x89\x69\x2d\x4d\xed\xc8\x76\x85\x10\x9a\xbb\xa3\x52\x18\xc1\x2c\x9a\x5d\xf2\x7f\x92\x67\x9a\x8b\xa8\x43\xf5\x88\x05\x39\x23\xa7\x8f\x61\xc9\xe4\x55\x08\xae\x91\x2d\x26\x27\xe1\xda\x26\x59\x8e\xf9\x10\x99\x52\x07\xf7\x22\xc7\x06\x3e\x03\x00\x40\x51\x2c\x51\xb1\x36\x1a\x19\xb5\x83\x61\xf1\x69\x48\x49\x16\xf6\xdf\xca\xba\xb6\xb8\x7d\x15\x55\x79\xbf\xbd\xbe\xf8\xac\x1d\xf2\x4c\x4c\xe6\x1a\x5d\xf4\xae\x7e\x53\x99\x3b\xd8\x2d\x3d\xbb\x68\x1c\xf1\x10\x7d\x6a\xfa\xd6\xd0\xbf\x6d\x4f\xfc\xc2\xe6\x71\xc4\x7c\xbe\x4c\x68\xff\xf5\x7f\x36\xcd\xd9\xd7\xf7\x50\xd6\x93\xba\x7a\x58\x53\x60\x71\xd8\xb0\xfb\x0c\x58\xa9\x3f\xd3\xdd\x18\xd8\xa6\xba\xaa\xb6\x97\x4f\xe1\x14\xbe\x02\x00\x00\xff\xff\x63\x20\x68\x33\x60\x01\x00\x00" func transactionsDependencyAuditAdminSet_unstaged_cause_panicCdcBytes() ([]byte, error) { @@ -651,6 +673,26 @@ func transactionsDependencyAuditAdminTest_check_dependenciesCdc() (*asset, error return a, nil } +var _transactionsDependencyAuditAdminUnset_start_end_blockCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8e\x4d\x4e\x03\x31\x0c\x46\xf7\x39\x85\xc9\x02\x32\x9b\x39\x40\x85\x18\x85\x9f\x3d\x52\x4f\x60\x12\xd3\x46\x74\xec\xc8\x71\x84\x10\xea\xdd\x51\x15\x60\xd1\xc5\x78\xeb\x4f\xef\xbd\xb2\x56\x51\x03\xff\x4c\x95\x38\x13\xa7\xaf\xd8\x73\x31\xef\x9c\x29\x72\xc3\x64\x45\x38\x4c\xf0\xed\x00\x00\xaa\x52\x45\xa5\xd0\xca\x81\x49\x77\x10\xbb\x1d\x63\x4a\xd2\xd9\xfe\x26\x97\x1b\xef\xf9\x4d\x54\xe5\xf3\xfe\xf6\x8a\x3d\xc7\xbc\x16\x2e\xcd\x14\x4d\xf4\x21\xbc\xab\xac\x3b\xd8\x1c\xed\x4d\x14\x0f\xf4\x8a\x76\x9c\x96\xb9\x73\x23\xdb\x1b\xaa\xbd\x70\x7e\x3c\x49\xfa\x08\xd3\xbf\x7b\x59\xa0\x22\x97\x14\xfc\x93\xf4\x53\x06\x16\x83\x11\xb2\xad\x80\x4b\xc6\x6f\xf9\x5d\x83\x36\x8c\x37\x7e\x90\xcf\xee\xec\x7e\x02\x00\x00\xff\xff\xbd\x3e\x87\xbb\x2b\x01\x00\x00" + +func transactionsDependencyAuditAdminUnset_start_end_blockCdcBytes() ([]byte, error) { + return bindataRead( + _transactionsDependencyAuditAdminUnset_start_end_blockCdc, + "transactions/dependency-audit/admin/unset_start_end_block.cdc", + ) +} + +func transactionsDependencyAuditAdminUnset_start_end_blockCdc() (*asset, error) { + bytes, err := transactionsDependencyAuditAdminUnset_start_end_blockCdcBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "transactions/dependency-audit/admin/unset_start_end_block.cdc", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa0, 0x7a, 0x3e, 0xba, 0x10, 0xdf, 0x67, 0x91, 0xb6, 0xbe, 0xb5, 0xc2, 0x70, 0x95, 0xd1, 0x6, 0x5d, 0x65, 0xce, 0x1b, 0xa3, 0xa0, 0x45, 0x70, 0x8d, 0x28, 0x94, 0xcd, 0xbb, 0x60, 0x29, 0x81}} + return a, nil +} + var _transactionsHostPublish_host_capabilityCdc = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x55\xef\x6b\xe3\x46\x10\xfd\xae\xbf\x62\xe2\xc2\x55\x06\xd7\xfe\x6e\x2e\x77\x84\x94\xe3\x0a\xe5\x08\xa4\xfd\x5c\xc6\xab\xb1\x34\x64\xbd\xbb\xcc\x8e\xec\x98\x92\xff\xbd\xac\x7e\xd8\x92\x63\xa5\xc9\xe9\x8b\xb1\xbd\xf3\xde\xbc\x37\xf3\xb4\xbf\xa0\xb5\xfe\x70\x67\x8c\xaf\x9d\xfe\xc9\xee\x89\x5d\x99\x65\xbc\x0b\x5e\x14\x66\x8f\x8a\x25\x15\xf7\xde\xa9\xa0\xd1\xbf\x43\x81\x4a\x71\x96\x65\xab\xd5\x0a\xd2\xe1\x08\x5a\x11\x44\x2e\x1d\xc9\xaf\x11\xee\x6a\xad\x3a\x28\x40\x57\x00\x39\x83\x21\xd6\x36\x55\x01\x3b\x40\xf8\xee\xa3\x82\x50\xf4\xb5\x18\x5a\x40\xa8\x37\x96\x63\xc5\xae\xec\xff\xbb\xc7\x80\x1b\xb6\xac\x47\xd8\x7a\x69\xe1\x03\x19\xde\x32\x15\x0d\xad\x90\xe1\xc0\xe4\x74\x09\x7f\x55\x1c\xe1\xe0\x6b\x9b\x98\x70\x63\xa9\x39\x7e\x3a\x00\xea\x81\x9e\xc9\xd4\x4a\x80\xb2\x61\x15\x94\x23\x98\x4e\x0c\xd4\xad\x1a\xf0\x6e\x2c\x62\x43\x15\xda\xed\x32\x91\x65\x2a\xe8\x22\x1a\x65\xef\xf2\xae\xd7\x6f\x5e\xd6\x70\x57\x14\x42\x31\xce\xe1\xdf\x2c\x03\x00\x08\x42\x01\x85\xf2\x16\x64\x3d\x34\xe2\x74\x26\x3d\xab\x15\xfc\x4e\xc2\x7b\x82\x80\x5a\xc5\x46\xe2\xd0\xb4\x4f\x17\x26\x30\xc5\x05\x70\x41\x4e\x79\x7b\x4c\x2e\x8d\x05\x7a\x37\x70\xf0\x44\x62\x49\x01\x5b\xc0\x7b\x0c\x0f\xc2\x7b\x54\x7a\x40\xad\xe0\x16\x06\xdf\xf2\x53\x41\xff\x74\x44\x9c\x14\x5c\x1f\xfd\xdd\x09\xf6\x9f\xd9\xd2\x78\x67\x50\x3b\xcd\x4b\x6c\x2d\x59\xaa\x7f\x54\x61\x57\xe6\xf3\xf9\x88\x60\x7e\x33\x6a\xb0\xf2\x51\xa7\x5b\xfb\xff\x4e\x92\x4f\xe7\x1e\xce\xb3\x19\xf2\xcf\x6f\x46\xce\x3f\x92\xd6\x61\xb8\x60\xde\x41\xed\x0a\x12\xdb\x58\x9b\x74\xa4\xcf\xd4\x59\xef\xdf\xa9\x9c\xb7\x70\xd3\x09\x2d\x49\xcf\x18\x9f\x3f\x0d\xc6\xf7\x25\xbf\x6a\xfb\x7c\x69\x2a\x32\x4f\x79\xda\x84\xa1\x23\x1d\x5e\xed\x2c\xbb\xa7\x89\xd2\x6b\x05\xe9\x78\xc7\xf8\x9e\xaa\xf4\x7c\xfd\x0a\x01\x1d\x9b\x7c\xf6\x20\x7e\x63\x69\x07\xb6\x8d\xfa\x68\xfb\xce\xb2\x66\x67\x88\x97\x89\xbd\x82\x5b\xf8\x69\x43\xce\x63\xc1\x18\x49\x86\x32\x7a\xaf\x16\xb0\xa3\x18\xb1\xa4\x35\xcc\xfe\x70\x7b\xb4\x5c\x4c\xf4\x0a\x42\x2a\x4c\x7b\x2a\x66\xf3\x2b\xf3\xbe\x78\xe3\x1c\x04\x43\xe8\x93\x14\x84\xf6\xec\xeb\x68\x9b\xd7\xc2\x96\xcb\x5a\xa8\xe8\x35\x82\x49\x14\xd8\x70\x0c\xf7\xa0\x53\xad\xc7\x40\x39\xea\x1a\xae\xae\xe7\x32\xd1\x3e\xaa\x17\x2c\x5b\xc9\x70\x7b\x0b\x8e\xed\xf5\x15\x88\xb8\xa7\xd7\x71\xfc\xfc\xdb\x04\xb6\x11\x42\xa5\x1f\x74\x48\x24\x03\xef\xd6\x83\xf1\xcc\x17\xaf\xf0\xd4\xbf\xb3\xd9\x71\x6e\xaf\x6c\xc2\x74\x1a\xa6\xf1\xbf\xe4\x17\x91\x7f\x5f\x2c\x2e\x8b\xa6\x02\xf1\x21\xea\x05\x28\x4a\x49\xef\x1e\xde\x44\x18\x12\xea\x5b\x49\xf8\x88\x19\xaf\x22\xd1\x81\xbf\x95\x87\xcb\x0b\x73\x2a\x08\xdf\xd8\xa1\xb5\xc7\xfe\xae\x68\x56\xff\xb2\x56\x7d\xf3\x73\xbf\xfb\x5a\xa1\xc2\x81\xad\x85\xa8\x5e\xda\x8b\xb5\x15\x20\xd9\x85\xfb\xec\x36\xfe\x79\xd9\x61\x8f\xb7\xb8\xd3\x30\x5e\x45\x87\x3b\x9a\x32\xbe\xc1\xfa\xde\x56\x75\x9d\xfd\xc0\x1d\x3d\x08\x6d\xf9\xf9\xed\x97\xfd\x98\xe4\x74\x47\xae\xe1\x7c\x3c\x1b\xef\xf4\x4b\xf6\x92\xfd\x17\x00\x00\xff\xff\x61\x05\xe9\x2d\xff\x08\x00\x00" func transactionsHostPublish_host_capabilityCdcBytes() ([]byte, error) { @@ -1067,8 +1109,10 @@ var _bindata = map[string]func() (*asset, error){ "transactions/delegatee/execute_all_delegated_updates.cdc": transactionsDelegateeExecute_all_delegated_updatesCdc, "transactions/delegatee/remove_delegated_updaters.cdc": transactionsDelegateeRemove_delegated_updatersCdc, "transactions/dependency-audit/admin/add_excluded_addresses.cdc": transactionsDependencyAuditAdminAdd_excluded_addressesCdc, + "transactions/dependency-audit/admin/set_start_end_block.cdc": transactionsDependencyAuditAdminSet_start_end_blockCdc, "transactions/dependency-audit/admin/set_unstaged_cause_panic.cdc": transactionsDependencyAuditAdminSet_unstaged_cause_panicCdc, "transactions/dependency-audit/admin/test_check_dependencies.cdc": transactionsDependencyAuditAdminTest_check_dependenciesCdc, + "transactions/dependency-audit/admin/unset_start_end_block.cdc": transactionsDependencyAuditAdminUnset_start_end_blockCdc, "transactions/host/publish_host_capability.cdc": transactionsHostPublish_host_capabilityCdc, "transactions/migration-contract-staging/admin/commit_migration_results.cdc": transactionsMigrationContractStagingAdminCommit_migration_resultsCdc, "transactions/migration-contract-staging/admin/set_staging_cutoff.cdc": transactionsMigrationContractStagingAdminSet_staging_cutoffCdc, @@ -1174,8 +1218,10 @@ var _bintree = &bintree{nil, map[string]*bintree{ "dependency-audit": {nil, map[string]*bintree{ "admin": {nil, map[string]*bintree{ "add_excluded_addresses.cdc": {transactionsDependencyAuditAdminAdd_excluded_addressesCdc, map[string]*bintree{}}, + "set_start_end_block.cdc": {transactionsDependencyAuditAdminSet_start_end_blockCdc, map[string]*bintree{}}, "set_unstaged_cause_panic.cdc": {transactionsDependencyAuditAdminSet_unstaged_cause_panicCdc, map[string]*bintree{}}, "test_check_dependencies.cdc": {transactionsDependencyAuditAdminTest_check_dependenciesCdc, map[string]*bintree{}}, + "unset_start_end_block.cdc": {transactionsDependencyAuditAdminUnset_start_end_blockCdc, map[string]*bintree{}}, }}, }}, "host": {nil, map[string]*bintree{ diff --git a/tests/dependency_audit_tests.cdc b/tests/dependency_audit_tests.cdc index 43c3555..638bc97 100644 --- a/tests/dependency_audit_tests.cdc +++ b/tests/dependency_audit_tests.cdc @@ -246,3 +246,92 @@ access(all) fun testChekDependenciesWithUnstagedEntriesPanics() { // not sure how to test this: // 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") ) } + +access(all) fun testBoundaries() { + var commitResult = executeTransaction( + "../transactions/dependency-audit/admin/set_start_end_block.cdc", + [100 as UInt64, 200 as UInt64], + adminAccount + ) + Test.expect(commitResult, Test.beSucceeded()) + + var addresses: [Address] = [fooAccount.address] + var names: [String] = ["Foo"] + var authorizers: [Address] = [] + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/test_check_dependencies.cdc", + [addresses, names, authorizers], + adminAccount + ) + Test.expect(commitResult, Test.beSucceeded()) + + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/set_start_end_block.cdc", + [2 as UInt64, 1 as UInt64], + adminAccount + ) + Test.expect(commitResult, Test.beFailed()) + + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/set_start_end_block.cdc", + [1 as UInt64, 2 as UInt64], + adminAccount + ) + Test.expect(commitResult, Test.beSucceeded()) + + var events = Test.eventsOfType(Type()) + Test.assertEqual(2, events.length) + var evt = events[1] as! DependencyAudit.BlockBoundariesChanged + Test.assertEqual(1 as UInt64, evt.start!) + Test.assertEqual(2 as UInt64, evt.end!) + + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/unset_start_end_block.cdc", + [], + adminAccount + ) + Test.expect(commitResult, Test.beSucceeded()) + + events = Test.eventsOfType(Type()) + Test.assertEqual(3, events.length) + evt = events[2] as! DependencyAudit.BlockBoundariesChanged + Test.assertEqual(nil, evt.start) + Test.assertEqual(nil, evt.end) + + addresses = [fooAccount.address] + names = ["Foo"] + authorizers = [] + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/test_check_dependencies.cdc", + [addresses, names, authorizers], + adminAccount + ) + Test.expect(commitResult, Test.beFailed()) + + // The block height is 42 at this point + + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/set_start_end_block.cdc", + [0 as UInt64, 100 as UInt64], + adminAccount + ) + Test.expect(commitResult, Test.beSucceeded()) + + var i = 0 + var failCount = 0 + while i < 10 { + commitResult = executeTransaction( + "../transactions/dependency-audit/admin/test_check_dependencies.cdc", + [addresses, names, authorizers], + adminAccount + ) + if commitResult.error != nil { + failCount = failCount + 1 + } + i = i + 1 + } + + // expect 1-9 failures in 10 attempts + Test.expect(failCount, Test.beGreaterThan(0)) + Test.expect(failCount, Test.beLessThan(10)) +} diff --git a/transactions/dependency-audit/admin/set_start_end_block.cdc b/transactions/dependency-audit/admin/set_start_end_block.cdc new file mode 100644 index 0000000..262a243 --- /dev/null +++ b/transactions/dependency-audit/admin/set_start_end_block.cdc @@ -0,0 +1,8 @@ +import "DependencyAudit" + +transaction(start: UInt64, end: UInt64) { + prepare(signer: AuthAccount) { + signer.borrow<&DependencyAudit.Administrator>(from: DependencyAudit.AdministratorStoragePath)?.setStartEndBlock(start: start, end: end) + ?? panic("Could not borrow DependencyAudit.Administrator from signer's storage!") + } +} diff --git a/transactions/dependency-audit/admin/unset_start_end_block.cdc b/transactions/dependency-audit/admin/unset_start_end_block.cdc new file mode 100644 index 0000000..15ff5dd --- /dev/null +++ b/transactions/dependency-audit/admin/unset_start_end_block.cdc @@ -0,0 +1,8 @@ +import "DependencyAudit" + +transaction() { + prepare(signer: AuthAccount) { + signer.borrow<&DependencyAudit.Administrator>(from: DependencyAudit.AdministratorStoragePath)?.unsetStartEndBlock() + ?? panic("Could not borrow DependencyAudit.Administrator from signer's storage!") + } +}