2019-07-19 19:01:41 +02:00
|
|
|
#include <ccan/short_types/short_types.h>
|
2020-05-16 03:29:05 +02:00
|
|
|
#include <common/amount.h>
|
|
|
|
#include <common/bigsize.h>
|
|
|
|
#include <common/utils.h>
|
2019-07-23 22:53:44 +02:00
|
|
|
#include "enum.h"
|
2019-07-19 19:01:41 +02:00
|
|
|
# AUTOGENERATED MOCKS START
|
|
|
|
# AUTOGENERATED MOCKS END
|
|
|
|
|
|
|
|
# omnibus method
|
|
|
|
msgtype,test_msg,16
|
|
|
|
# test array u8 (helper)
|
|
|
|
msgdata,test_msg,test_arr_u8,u8,10
|
|
|
|
# test array assignable
|
|
|
|
msgdata,test_msg,test_arr_assignable,u16,5
|
|
|
|
# test var len u8 (helper)
|
|
|
|
msgdata,test_msg,len_var_u8,u16,
|
|
|
|
msgdata,test_msg,test_var_len_u8_arr,byte,len_var_u8
|
|
|
|
# test variable length assignable
|
|
|
|
msgdata,test_msg,len_var_ass,u16,
|
|
|
|
msgdata,test_msg,test_var_len_ass_arr,u32,len_var_ass
|
|
|
|
# test array struct
|
|
|
|
msgdata,test_msg,test_struct_arr,test_short_id,10
|
|
|
|
# test var-len struct
|
|
|
|
msgdata,test_msg,len_test_struct_varlen,u16,
|
|
|
|
msgdata,test_msg,test_struct_varlen,test_short_id,len_test_struct_varlen
|
|
|
|
# test var-len var-size struct
|
|
|
|
msgdata,test_msg,len_varsize_struct,u16,
|
|
|
|
msgdata,test_msg,test_varsize_struct_varlen,test_features,len_varsize_struct
|
|
|
|
# assignable
|
|
|
|
msgdata,test_msg,test_assignable,u16,
|
2019-07-23 22:53:44 +02:00
|
|
|
# enum
|
2019-07-24 06:20:04 +02:00
|
|
|
msgdata,test_msg,test_enum,enum test_enum,
|
2019-07-19 19:01:41 +02:00
|
|
|
# test struct
|
|
|
|
msgdata,test_msg,test_struct,test_short_id,
|
|
|
|
# test var-size struct
|
|
|
|
msgdata,test_msg,test_varsize_struct,test_features,
|
2019-07-24 01:39:42 +02:00
|
|
|
# test optional assignable
|
|
|
|
msgdata,test_msg,test_optional_assignable,?u32,
|
2019-07-19 19:01:41 +02:00
|
|
|
# test optional struct
|
|
|
|
msgdata,test_msg,test_optional_struct,?test_short_id,
|
|
|
|
# test optional var-size struct
|
|
|
|
msgdata,test_msg,test_optional_varsize_struct,?test_features,
|
|
|
|
msgdata,test_msg,test_sbt_struct_nested,subtype_nested,
|
|
|
|
msgdata,test_msg,test_sbt_varsize_struct,subtype_varsize_struct,
|
|
|
|
msgdata,test_msg,test_sbt_varsize_var_assign,subtype_var_assign,
|
|
|
|
msgdata,test_msg,test_sbt_var_len,subtype_var_len,
|
|
|
|
msgdata,test_msg,test_sbt_varlen_varsize,subtype_varlen_varsize,
|
2019-07-20 01:21:25 +02:00
|
|
|
msgdata,test_msg,test_sbt_arrays,subtype_arrays,
|
2019-07-23 21:38:27 +02:00
|
|
|
# test extension fields
|
|
|
|
msgdata,test_msg,extension_1,test_features,,option_short_id
|
2019-07-23 23:36:55 +02:00
|
|
|
msgdata,test_msg,extension_2,test_short_id,,option_one,option_two
|
2019-07-20 01:21:25 +02:00
|
|
|
|
2019-09-20 19:49:45 +02:00
|
|
|
msgtype,test_ifdef,100
|
|
|
|
#ifdef TEST_IFDEF
|
|
|
|
msgdata,test_ifdef,is_def,u32,
|
|
|
|
|
2019-07-20 01:21:25 +02:00
|
|
|
msgtype,test_tlv1,2
|
|
|
|
msgdata,test_tlv1,test_struct,test_short_id,
|
2019-07-21 05:59:57 +02:00
|
|
|
msgdata,test_tlv1,tlv,test_n1,
|
2019-07-20 01:21:25 +02:00
|
|
|
|
|
|
|
msgtype,test_tlv2,3
|
2019-07-21 05:59:57 +02:00
|
|
|
msgdata,test_tlv2,tlv,test_n2,
|
2019-07-20 01:21:25 +02:00
|
|
|
|
|
|
|
msgtype,test_tlv3,4
|
2019-07-21 05:59:57 +02:00
|
|
|
msgdata,test_tlv3,tlv,test_n3,
|
2019-07-19 19:01:41 +02:00
|
|
|
|
|
|
|
# A subtype with a nested subtype
|
|
|
|
subtype,subtype_nested
|
|
|
|
subtypedata,subtype_nested,field_1,test_short_id,
|
|
|
|
|
|
|
|
# subtype with a nested varsize size struct
|
|
|
|
subtype,subtype_varsize_struct
|
|
|
|
subtypedata,subtype_varsize_struct,field_0,test_features,
|
|
|
|
|
|
|
|
# A subtype to test varsize things of
|
|
|
|
# - A two level subtype comment
|
|
|
|
subtype,subtype_var_assign
|
2019-07-20 01:21:25 +02:00
|
|
|
# variable length set of assignables (helper)
|
2019-07-19 19:01:41 +02:00
|
|
|
subtypedata,subtype_var_assign,len_1,u8,
|
|
|
|
subtypedata,subtype_var_assign,field_1,u16,len_1
|
2019-07-20 01:21:25 +02:00
|
|
|
# variable length set of assignables (helper)
|
|
|
|
|
|
|
|
# Subtype to test arrays of things
|
|
|
|
subtype,subtype_arrays
|
|
|
|
subtypedata,subtype_arrays,field1,u8,2
|
|
|
|
subtypedata,subtype_arrays,field2,u16,2
|
|
|
|
subtypedata,subtype_arrays,field3,test_short_id,2
|
2019-07-19 19:01:41 +02:00
|
|
|
|
|
|
|
# variable length set of structs
|
|
|
|
subtype,subtype_var_len
|
|
|
|
subtypedata,subtype_var_len,len_2,u8,
|
|
|
|
subtypedata,subtype_var_len,field_2,test_short_id,len_2
|
|
|
|
|
|
|
|
subtype,subtype_varlen_varsize
|
|
|
|
# variable length set of variable size structs
|
|
|
|
subtypedata,subtype_varlen_varsize,len,u8,
|
|
|
|
subtypedata,subtype_varlen_varsize,field_1,test_features,len
|
|
|
|
|
|
|
|
# normal struct
|
|
|
|
subtype,test_short_id
|
|
|
|
subtypedata,test_short_id,u64,u64,
|
|
|
|
|
|
|
|
# var-sized struct
|
|
|
|
subtype,test_features
|
|
|
|
subtypedata,test_features,len_lf,u16,
|
|
|
|
subtypedata,test_features,localfeatures,u8,len_lf
|
|
|
|
subtypedata,test_features,len_gf,u16,
|
|
|
|
subtypedata,test_features,globalfeatures,u8,len_gf
|
2019-07-20 01:21:25 +02:00
|
|
|
|
|
|
|
# TLV's!
|
2019-07-21 05:59:57 +02:00
|
|
|
tlvtype,test_n1,tlv1,1
|
2019-07-20 02:18:26 +02:00
|
|
|
# a truncated u64
|
2019-07-21 05:59:57 +02:00
|
|
|
tlvdata,test_n1,tlv1,amount_msat,tu64,
|
|
|
|
tlvtype,test_n1,tlv2,2
|
2019-07-20 01:21:25 +02:00
|
|
|
# neseted subtype
|
2019-07-21 05:59:57 +02:00
|
|
|
tlvdata,test_n1,tlv2,scid,test_short_id,
|
|
|
|
tlvtype,test_n1,tlv3,3
|
|
|
|
tlvdata,test_n1,tlv3,features,test_features,
|
|
|
|
tlvdata,test_n1,tlv3,amount_msat_1,u64,
|
|
|
|
tlvdata,test_n1,tlv3,amount_msat_2,u64,
|
|
|
|
tlvtype,test_n1,tlv4,254
|
|
|
|
tlvdata,test_n1,tlv4,cltv_delta,u16,
|
|
|
|
tlvtype,test_n2,tlv1,0
|
|
|
|
tlvdata,test_n2,tlv1,amount_msat,tu64,
|
|
|
|
tlvtype,test_n2,tlv2,11
|
|
|
|
tlvdata,test_n2,tlv2,cltv_expiry,tu32,
|
|
|
|
# TLV with all varsized atest_nd array structs
|
|
|
|
tlvtype,test_n3,tlv3,1
|
|
|
|
tlvdata,test_n3,tlv3,subtype,test_short_id,
|
|
|
|
tlvdata,test_n3,tlv3,varlen_subtype,subtype_var_len,
|
|
|
|
tlvdata,test_n3,tlv3,varlen_assigned,subtype_var_assign,
|
|
|
|
tlvdata,test_n3,tlv3,test_sbt_varlen_varsize,subtype_varlen_varsize,
|
|
|
|
# array assigtest_nable
|
|
|
|
tlvdata,test_n3,tlv3,arr_assign,u32,2
|
2019-07-20 01:21:25 +02:00
|
|
|
# array structs
|
2019-07-21 05:59:57 +02:00
|
|
|
tlvdata,test_n3,tlv3,arr_struct,test_short_id,2
|
|
|
|
# varletest_n assignable (helper)
|
|
|
|
tlvdata,test_n3,tlv3,len_lf,u16,
|
|
|
|
tlvdata,test_n3,tlv3,localfeatures,u8,len_lf
|
|
|
|
# varletest_n assignable (no-helper)
|
|
|
|
tlvdata,test_n3,tlv3,len_varlen_ass,u16,
|
|
|
|
tlvdata,test_n3,tlv3,varlen_ass,u64,len_varlen_ass
|
|
|
|
# varletest_n structs
|
|
|
|
tlvdata,test_n3,tlv3,len_varlen,u8,
|
|
|
|
tlvdata,test_n3,tlv3,varlen_struct,test_short_id,len_varlen
|
|
|
|
# varletest_n varsized structs
|
|
|
|
tlvdata,test_n3,tlv3,len_varlenvarsize,u8,
|
|
|
|
tlvdata,test_n3,tlv3,varlen_varsize,test_features,len_varlenvarsize
|
2019-07-28 02:54:22 +02:00
|
|
|
# implicit length
|
|
|
|
tlvdata,test_n3,tlv3,remainder,byte,...
|