@Test
  public void shouldTransferAllEthOfAuthorizerToSponsor() throws IOException {

    // 7702 transaction
    final CodeDelegation codeDelegation =
        org.hyperledger.besu.ethereum.core.CodeDelegation.builder()
            .chainId(BigInteger.valueOf(20211))
            .address(SEND_ALL_ETH_CONTRACT_ADDRESS)
            .nonce(0)
            .signAndBuild(
                secp256k1.createKeyPair(
                    secp256k1.createPrivateKey(AUTHORIZER_PRIVATE_KEY.toUnsignedBigInteger())));

    final Transaction tx =
        Transaction.builder()
            .type(TransactionType.DELEGATE_CODE)
            .chainId(BigInteger.valueOf(20211))
            .nonce(0)
            .maxPriorityFeePerGas(Wei.of(1000000000))
            .maxFeePerGas(Wei.fromHexString("0x02540BE400"))
            .gasLimit(1000000)
            .to(Address.fromHexStringStrict(authorizer.getAddress()))
            .value(Wei.ZERO)
            .payload(Bytes32.leftPad(Bytes.fromHexString(transactionSponsor.getAddress())))
            .accessList(List.of())
            .codeDelegations(List.of(codeDelegation))
            .signAndBuild(
                secp256k1.createKeyPair(
                    secp256k1.createPrivateKey(
                        TRANSACTION_SPONSOR_PRIVATE_KEY.toUnsignedBigInteger())));

    final String txHash =
        besuNode.execute(ethTransactions.sendRawTransaction(tx.encoded().toHexString()));
    testHelper.buildNewBlock();

    Optional<TransactionReceipt> maybeTransactionReceipt =
        besuNode.execute(ethTransactions.getTransactionReceipt(txHash));
    assertThat(maybeTransactionReceipt).isPresent();

    cluster.verify(authorizer.balanceEquals(0));

    final String gasPriceWithout0x =
        maybeTransactionReceipt.get().getEffectiveGasPrice().substring(2);
    final BigInteger txCost =
        maybeTransactionReceipt.get().getGasUsed().multiply(new BigInteger(gasPriceWithout0x, 16));
    BigInteger expectedSponsorBalance = new BigInteger("180000000000000000000000").subtract(txCost);
    cluster.verify(transactionSponsor.balanceEquals(Amount.wei(expectedSponsorBalance)));
  }
At the beginning of the test both the authorizer and the transaction sponsor have a balance of
90000 ETH. The authorizer creates an authorization for a contract that send all its ETH to any
given address. The transaction sponsor sponsors the 7702 transaction and sends all the ETH from
the authorizer to itself. The authorizer balance should be 0 and the transaction sponsor's
balance should be 180000 ETH minus the transaction costs.
acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/ethereum/CodeDelegationTransactionAcceptanceTest.java