resolveAccount method

Future<void> resolveAccount(
  1. dynamic ctx
)

Resolves the nonce and init code for the SimpleAccount contract creation.

Implementation

Future<void> resolveAccount(ctx) async {
  final results = await Future.wait([
    entryPoint.getNonce(
      (
        key: nonceKey,
        sender: EthereumAddress.fromHex(ctx.op.sender),
      ),
    ),
    entryPoint.client.makeRPCCall<String>('eth_getCode', [
      ctx.op.sender,
      'latest',
    ]),
  ]);
  ctx.op.nonce = results[0];
  final code = results[1];
  ctx.op.initCode = code == "0x" ? initCode : "0x";
}