toBlockParam method

String toBlockParam()

Generates the block parameter as it is accepted by the Ethereum client.

Implementation

String toBlockParam() {
  if (useAbsolute) return '0x${blockNum.toRadixString(16)}';

  switch (blockNum) {
    case 0:
      return 'earliest';
    case 1:
      return 'latest';
    case 2:
      return 'pending';
    default:
      return 'latest'; //Can't happen, though
  }
}