Skip to content

Commit

Permalink
bolt-gen: use 'enum' instead of 'e:' prefix for enums
Browse files Browse the repository at this point in the history
use 'enum ' in wirespec instead of 'e:' as an indicator
that a field is an enum.
  • Loading branch information
niftynei authored and rustyrussell committed Jul 24, 2019
1 parent b6d4c37 commit 46cbca9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions channeld/channel_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ msgdata,channel_init,remote_fundingkey,pubkey,
msgdata,channel_init,remote_basepoints,basepoints,
msgdata,channel_init,remote_per_commit,pubkey,
msgdata,channel_init,old_remote_per_commit,pubkey,
msgdata,channel_init,funder,e:side,
msgdata,channel_init,funder,enum side,
msgdata,channel_init,fee_base,u32,
msgdata,channel_init,fee_proportional,u32,
msgdata,channel_init,local_msatoshi,amount_msat,
Expand All @@ -41,13 +41,13 @@ msgdata,channel_init,revocations_received,u64,
msgdata,channel_init,next_htlc_id,u64,
msgdata,channel_init,num_htlcs,u16,
msgdata,channel_init,htlcs,added_htlc,num_htlcs
msgdata,channel_init,htlc_states,e:htlc_state,num_htlcs
msgdata,channel_init,htlc_states,enum htlc_state,num_htlcs
msgdata,channel_init,num_fulfilled,u16,
msgdata,channel_init,fulfilled,fulfilled_htlc,num_fulfilled
msgdata,channel_init,fulfilled_sides,e:side,num_fulfilled
msgdata,channel_init,fulfilled_sides,enum side,num_fulfilled
msgdata,channel_init,num_failed,u16,
msgdata,channel_init,failed,failed_htlc,num_failed
msgdata,channel_init,failed_sides,e:side,num_failed
msgdata,channel_init,failed_sides,enum side,num_failed
msgdata,channel_init,local_funding_locked,bool,
msgdata,channel_init,remote_funding_locked,bool,
msgdata,channel_init,funding_short_id,short_channel_id,
Expand Down
2 changes: 1 addition & 1 deletion closingd/closing_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgdata,closing_init,funding_txout,u16,
msgdata,closing_init,funding_satoshi,amount_sat,
msgdata,closing_init,local_fundingkey,pubkey,
msgdata,closing_init,remote_fundingkey,pubkey,
msgdata,closing_init,funder,e:side,
msgdata,closing_init,funder,enum side,
msgdata,closing_init,local_sat,amount_sat,
msgdata,closing_init,remote_sat,amount_sat,
msgdata,closing_init,our_dust_limit,amount_sat,
Expand Down
6 changes: 3 additions & 3 deletions common/status_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#include <common/status_wire.h>

msgtype,status_log,0xFFF0
msgdata,status_log,level,e:log_level,
msgdata,status_log,level,enum log_level,
msgdata,status_log,entry,wirestring,

msgtype,status_io,0xFFF1
msgdata,status_io,iodir,e:log_level,
msgdata,status_io,iodir,enum log_level,
msgdata,status_io,who,wirestring,
msgdata,status_io,len,u16,
msgdata,status_io,data,u8,len

msgtype,status_fail,0xFFF2
msgdata,status_fail,failreason,e:status_failreason,
msgdata,status_fail,failreason,enum status_failreason,
msgdata,status_fail,desc,wirestring,

msgtype,status_peer_connection_lost,0xFFF3
Expand Down
2 changes: 1 addition & 1 deletion connectd/connect_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgtype,connectctl_init,2000
msgdata,connectctl_init,id,node_id,
msgdata,connectctl_init,num_wireaddrs,u16,
msgdata,connectctl_init,wireaddrs,wireaddr_internal,num_wireaddrs
msgdata,connectctl_init,listen_announce,e:addr_listen_announce,num_wireaddrs
msgdata,connectctl_init,listen_announce,enum addr_listen_announce,num_wireaddrs
msgdata,connectctl_init,tor_proxyaddr,?wireaddr,
msgdata,connectctl_init,use_tor_proxy_always,bool,
msgdata,connectctl_init,dev_allow_localhost,bool,
Expand Down
6 changes: 3 additions & 3 deletions onchaind/onchain_wire.csv
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ msgdata,onchain_init,remote_scriptpubkey_len,u16,
msgdata,onchain_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
msgdata,onchain_init,ourwallet_pubkey,pubkey,
# We need these two for commit number obscurer
msgdata,onchain_init,funder,e:side,
msgdata,onchain_init,funder,enum side,
msgdata,onchain_init,local_basepoints,basepoints,
msgdata,onchain_init,remote_basepoints,basepoints,
msgdata,onchain_init,tx,bitcoin_tx,
Expand All @@ -49,7 +49,7 @@ msgtype,onchain_init_reply,5101
# onchaind->master: Send out a tx.
msgtype,onchain_broadcast_tx,5003
msgdata,onchain_broadcast_tx,tx,bitcoin_tx,
msgdata,onchain_broadcast_tx,type,e:wallet_tx_type,
msgdata,onchain_broadcast_tx,type,enum wallet_tx_type,

# master->onchaind: Notifier that an output has been spent by input_num of tx.
msgtype,onchain_spent,5004
Expand Down Expand Up @@ -106,4 +106,4 @@ msgdata,onchain_dev_memleak_reply,leak,bool,
# transactions.
msgtype,onchain_transaction_annotate,5034
msgdata,onchain_transaction_annotate,txid,bitcoin_txid,
msgdata,onchain_transaction_annotate,type,e:wallet_tx_type,
msgdata,onchain_transaction_annotate,type,enum wallet_tx_type,
4 changes: 2 additions & 2 deletions tools/generate-wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def __init__(self, name):
self.tlv = False

def parse_name(self, name):
if name.startswith('e:'):
return name[2:], True
if name.startswith('enum '):
return name[5:], True
return name, False

def add_data_field(self, field_name, type_obj, count=1,
Expand Down
2 changes: 1 addition & 1 deletion tools/test/test_cases
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ msgdata,test_msg,test_varsize_struct_varlen,test_features,len_varsize_struct
# assignable
msgdata,test_msg,test_assignable,u16,
# enum
msgdata,test_msg,test_enum,e:test_enum,
msgdata,test_msg,test_enum,enum test_enum,
# test struct
msgdata,test_msg,test_struct,test_short_id,
# test var-size struct
Expand Down

0 comments on commit 46cbca9

Please sign in to comment.