c_backwards function

List<CandidType> c_backwards(
  1. Uint8List candidbytes
)

De-serialize bytes into a List of CandidTypes.

Implementation

List<CandidType> c_backwards(Uint8List candidbytes) {
    try {
        if (candidbytes.length < 6) { throw Exception('candidbytes are a minimum of 6 bytes.'); }
        if (!(aresamebytes(candidbytes.sublist(0, 4), magic_bytes))) { throw Exception(':void: magic-bytes.'); }
        CandidBytes_i param_count_i = crawl_type_table(candidbytes);
        List<CandidType> candids = crawl_memory_bytes(candidbytes, param_count_i);
        return candids;
    } catch(e) {
        print('candid: $candidbytes');
        throw e;
    }
}