|
| 1 | +'use strict' |
| 2 | + |
| 3 | +import { NightwatchBrowser } from 'nightwatch' |
| 4 | +import init from '../helpers/init' |
| 5 | + |
| 6 | +module.exports = { |
| 7 | + '@disabled': true, |
| 8 | + before: function (browser: NightwatchBrowser, done: VoidFunction) { |
| 9 | + init(browser, done) |
| 10 | + }, |
| 11 | + 'Should activate delegation and make a transaction to the authority address #group1': function (browser: NightwatchBrowser) { |
| 12 | + let addressDelegate |
| 13 | + browser |
| 14 | + .clickLaunchIcon('udapp') |
| 15 | + .switchEnvironment('vm-pectra') |
| 16 | + .addFile('delegate.sol', { content: delegate }) |
| 17 | + .clickLaunchIcon('solidity') |
| 18 | + .setSolidityCompilerVersion('soljson-v0.8.24+commit.e11b9ed9.js') |
| 19 | + .clickLaunchIcon('solidity') |
| 20 | + .verifyContracts(['TestDelegate']) |
| 21 | + .clickLaunchIcon('udapp') |
| 22 | + .selectContract('Simple7702Account') |
| 23 | + .createContract('') |
| 24 | + .perform((done) => { |
| 25 | + browser.getAddressAtPosition(0, (address) => { |
| 26 | + addressDelegate = delegate |
| 27 | + }) |
| 28 | + }) |
| 29 | + .click('*[data-id="create-delegation-authorization"]') |
| 30 | + .setValue('*[data-id="create-delegation-authorization-input"]', addressDelegate) |
| 31 | + .modalFooterOKClick('udapp') |
| 32 | + .waitForElementContainsText('*[data-id="terminalJournal"]', 'This account will be running the code located at') |
| 33 | + .clickInstance(1) |
| 34 | + .clickFunction('entryPoint - call (not payable)') |
| 35 | + .verifyCallReturnValue('0x5B38Da6a701c568545dCfcB03FcB875f56beddC4', ['0:address: 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108']) |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +const delegate = `import "https://github.com/eth-infinitism/account-abstraction/blob/v0.8.0/contracts/accounts/Simple7702Account.sol";` |
0 commit comments