SEP-51 discusses snake_caseing multiple kinds of identifiers, but the specific algorithm is a little unclear. Consider the following
enum IPAddrType
{
IPv4 = 0,
IPv6 = 1
};
struct PeerAddress
{
union switch (IPAddrType type)
{
case IPv4:
opaque ipv4[4];
case IPv6:
opaque ipv6[16];
}
ip;
uint32 port;
uint32 numFailures;
};
$ echo 'AAAAAAAAAAA=' | stellar xdr decode --type PeerAddressIp
{"i_pv4":[0,0,0,0]}
$ echo 'AAAAAAAAAAAAAAAAAAAAAA==' | stellar xdr decode --type PeerAddress
{"ip":{"i_pv4":[0,0,0,0]},"port":0,"num_failures":0}
Note the suboptimal IPv4 to i_pv4 conversion.
SEP-51 discusses
snake_caseing multiple kinds of identifiers, but the specific algorithm is a little unclear. Consider the followingNote the suboptimal
IPv4toi_pv4conversion.