def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.upload('solidity_test_helpers/ControllerUser.sol') fixture.uploadAugur() decentralizedController = fixture.upload('../source/contracts/Controller.sol', 'decentralizedController') decentralizedController.switchModeSoOnlyEmergencyStopsAndEscapeHatchesCanBeUsed(sender = tester.k0) return fixture.createSnapshot()
def localSnapshot(fixture, baseSnapshot): fixture.resetToSnapshot(baseSnapshot) controller = fixture.upload('../source/contracts/Controller.sol') assert fixture.contracts['Controller'].owner() == bytesToHexString(tester.a0) fixture.upload('solidity_test_helpers/ControllerUser.sol') fixture.uploadAugur() return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.uploadAugur() # Upload a token fixture.uploadAndAddToController( "solidity_test_helpers/StandardTokenHelper.sol") # Upload Cash cash = fixture.uploadAndAddToController( "../source/contracts/trading/Cash.sol") cash.setController(fixture.contracts['Controller'].address) # Upload the mailbox name = "Mailbox" targetName = "MailboxTarget" fixture.uploadAndAddToController( "../source/contracts/reporting/Mailbox.sol", targetName, name) fixture.uploadAndAddToController( "../source/contracts/libraries/Delegator.sol", name, "delegator", constructorArgs=[ fixture.contracts['Controller'].address, stringToBytes(targetName) ]) fixture.contracts[name] = fixture.applySignature( name, fixture.contracts[name].address) fixture.contracts[name].initialize(tester.a0) return fixture.createSnapshot()
def localSnapshot(fixture, baseSnapshot): fixture.resetToSnapshot(baseSnapshot) controller = fixture.upload('../source/contracts/Controller.sol') assert fixture.contracts['Controller'].owner() == bytesToHexString( tester.a0) fixture.upload('solidity_test_helpers/ControllerUser.sol') fixture.uploadAugur() return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.upload('solidity_test_helpers/ControllerUser.sol') fixture.uploadAugur() decentralizedController = fixture.upload( '../source/contracts/Controller.sol', 'decentralizedController') decentralizedController.switchOffDevMode(sender=tester.k0) return fixture.createSnapshot()
def localSnapshot(fixture, baseSnapshot): fixture.resetToSnapshot(baseSnapshot) fixture.uploadAugur() fixture.uploadAndAddToAugur("solidity_test_helpers/DelegatorHelper.sol") delegatorHelperFactory = fixture.uploadAndAddToAugur("solidity_test_helpers/DelegatorHelperFactory.sol") delegatorHelperAddress = delegatorHelperFactory.createDelegatorHelper(fixture.contracts['Augur'].address) fixture.contracts["Clone"] = fixture.applySignature("DelegatorHelper", delegatorHelperAddress) return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.uploadAugur() name = "DelegatorHelper" targetName = "DelegatorHelperTarget" fixture.uploadAndAddToController("solidity_test_helpers/DelegatorHelper.sol", targetName, name) fixture.uploadAndAddToController("../source/contracts/libraries/Delegator.sol", name, "delegator", constructorArgs=[fixture.contracts['Controller'].address, stringToBytes(targetName)]) fixture.contracts[name] = fixture.applySignature(name, fixture.contracts[name].address) return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.uploadAugur() name = "DelegatorHelper" targetName = "DelegatorHelperTarget" fixture.uploadAndAddToController( "solidity_test_helpers/DelegatorHelper.sol", targetName, name) fixture.uploadAndAddToController( "../source/contracts/libraries/Delegator.sol", name, "delegator", constructorArgs=[ fixture.contracts['Controller'].address, stringToBytes(targetName) ]) fixture.contracts[name] = fixture.applySignature( name, fixture.contracts[name].address) return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.uploadAugur() # Upload a token fixture.uploadAndAddToController("solidity_test_helpers/StandardTokenHelper.sol") # Upload Cash cash = fixture.uploadAndAddToController("../source/contracts/trading/Cash.sol") cash.setController(fixture.contracts['Controller'].address) # Upload the mailbox name = "Mailbox" targetName = "MailboxTarget" fixture.uploadAndAddToController("../source/contracts/reporting/Mailbox.sol", targetName, name) fixture.uploadAndAddToController("../source/contracts/libraries/Delegator.sol", name, "delegator", constructorArgs=[fixture.contracts['Controller'].address, stringToBytes(targetName)]) fixture.contracts[name] = fixture.applySignature(name, fixture.contracts[name].address) fixture.contracts[name].initialize(tester.a0) return fixture.createSnapshot()
def localSnapshot(fixture, controllerSnapshot): fixture.resetToSnapshot(controllerSnapshot) fixture.uploadAugur() # Upload a token fixture.uploadAndAddToController( "solidity_test_helpers/StandardTokenHelper.sol") # Upload Cash cash = fixture.uploadAndAddToController( "../source/contracts/trading/Cash.sol") cash.setController(fixture.contracts['Controller'].address) # Upload the mailbox fixture.uploadAndAddToController( "../source/contracts/reporting/Mailbox.sol") mailboxFactory = fixture.uploadAndAddToController( "../source/contracts/factories/MailboxFactory.sol") mailboxAddress = mailboxFactory.createMailbox( fixture.contracts["Controller"].address, tester.a0, 0) fixture.contracts["Mailbox"] = fixture.applySignature( "Mailbox", mailboxAddress) return fixture.createSnapshot()