decode static method

List decode(
  1. List<int> data
)

Decode an RLP-encoded list of items.

Implementation

static List<dynamic> decode(List<int> data) {
  try {
    _Decoded decoded = _decode(data, 0);
    if (decoded.consumed != data.length) {
      throw const MessageException("invalid rpl payload bytes");
    }
    return decoded.result;
  } on MessageException {
    rethrow;
  } catch (e) {
    throw const MessageException("cannot decode rpl payload");
  }
}