proto: revert address field name change

This commit is contained in:
Willi Ballenthin
2023-03-22 10:00:12 +01:00
parent cae7c4d0a7
commit 26a8647444
2 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ message APIFeature {
message Address {
AddressType type = 1;
oneof value {
Integer value = 2;
Integer v = 2;
Token_Offset token_offset = 3;
};
}

View File

@@ -79,19 +79,19 @@ def number_to_pb2(v: Union[int, float]) -> capa_pb2.Number:
def addr_to_pb2(addr: frz.Address) -> capa_pb2.Address:
if addr.type is AddressType.ABSOLUTE:
assert isinstance(addr.value, int)
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_ABSOLUTE, value=int_to_pb2(addr.value))
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_ABSOLUTE, v=int_to_pb2(addr.value))
elif addr.type is AddressType.RELATIVE:
assert isinstance(addr.value, int)
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_RELATIVE, value=int_to_pb2(addr.value))
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_RELATIVE, v=int_to_pb2(addr.value))
elif addr.type is AddressType.FILE:
assert isinstance(addr.value, int)
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_FILE, value=int_to_pb2(addr.value))
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_FILE, v=int_to_pb2(addr.value))
elif addr.type is AddressType.DN_TOKEN:
assert isinstance(addr.value, int)
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_DN_TOKEN, value=int_to_pb2(addr.value))
return capa_pb2.Address(type=capa_pb2.AddressType.ADDRESSTYPE_DN_TOKEN, v=int_to_pb2(addr.value))
elif addr.type is AddressType.DN_TOKEN_OFFSET:
assert isinstance(addr.value, tuple)