dryRun method

Future<Uint8List> dryRun(
  1. Uint8List extrinsic, {
  2. BlockHash? at,
})

Dry run an extrinsic at a given block. Return SCALE encoded ApplyExtrinsicResult.

Implementation

Future<Uint8List> dryRun(Uint8List extrinsic, {BlockHash? at}) async {
  final List<String> params = ['0x${hex.encode(extrinsic)}'];
  if (at != null) {
    params.add('0x${hex.encode(at)}');
  }
  final response = await _provider.send('system_dryRun', params);
  final data = response.result as String;
  return Uint8List.fromList(hex.decode(data.substring(2)));
}