From 6e39116b5d9158c77f214caf42849ce131bcc299 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 29 Aug 2023 19:21:21 +0200 Subject: [PATCH 1/2] refactor(pb/proof.go)converting pb definition to use snake_case --- pb/proof.pb.go | 39 ++++++++++++++++++++------------------- pb/proof.proto | 8 ++++---- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/pb/proof.pb.go b/pb/proof.pb.go index ad2e097..b1f3fcf 100644 --- a/pb/proof.pb.go +++ b/pb/proof.pb.go @@ -30,13 +30,13 @@ type Proof struct { End int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"` // Nodes hold the tree nodes necessary for the Merkle range proof. Nodes [][]byte `protobuf:"bytes,3,rep,name=nodes,proto3" json:"nodes,omitempty"` - // LeafHash contains the namespace.ID if NMT does not have it and + // leaf_hash contains the namespace.ID if NMT does not have it and // it should be proven. LeafHash is necessary to prove the Absence Proof. // This field will be empty in case of Inclusion Proof. - LeafHash []byte `protobuf:"bytes,4,opt,name=leafHash,proto3" json:"leafHash,omitempty"` - // The isMaxNamespaceIgnored flag influences the calculation of the + LeafHash []byte `protobuf:"bytes,4,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"` + // The is_max_namespace_ignored flag influences the calculation of the // namespace ID range for intermediate nodes in the tree. - IsMaxNamespaceIgnored bool `protobuf:"varint,5,opt,name=isMaxNamespaceIgnored,proto3" json:"isMaxNamespaceIgnored,omitempty"` + IsMaxNamespaceIgnored bool `protobuf:"varint,5,opt,name=is_max_namespace_ignored,json=isMaxNamespaceIgnored,proto3" json:"is_max_namespace_ignored,omitempty"` } func (m *Proof) Reset() { *m = Proof{} } @@ -114,21 +114,22 @@ func init() { func init() { proto.RegisterFile("pb/proof.proto", fileDescriptor_2e2daa763cd7daf3) } var fileDescriptor_2e2daa763cd7daf3 = []byte{ - // 217 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0x48, 0xd2, 0x2f, - 0x28, 0xca, 0xcf, 0x4f, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0x72, 0x92, 0x94, - 0xa6, 0x33, 0x72, 0xb1, 0x06, 0x80, 0x38, 0x42, 0x22, 0x5c, 0xac, 0xc5, 0x25, 0x89, 0x45, 0x25, - 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x10, 0x8e, 0x90, 0x00, 0x17, 0x73, 0x6a, 0x5e, 0x8a, - 0x04, 0x13, 0x58, 0x0c, 0xc4, 0x04, 0xa9, 0xcb, 0xcb, 0x4f, 0x49, 0x2d, 0x96, 0x60, 0x56, 0x60, - 0xd6, 0xe0, 0x09, 0x82, 0x70, 0x84, 0xa4, 0xb8, 0x38, 0x72, 0x52, 0x13, 0xd3, 0x3c, 0x12, 0x8b, - 0x33, 0x24, 0x58, 0x14, 0x18, 0x35, 0x78, 0x82, 0xe0, 0x7c, 0x21, 0x13, 0x2e, 0xd1, 0xcc, 0x62, - 0xdf, 0xc4, 0x0a, 0xbf, 0xc4, 0xdc, 0xd4, 0xe2, 0x82, 0xc4, 0xe4, 0x54, 0xcf, 0xf4, 0xbc, 0xfc, - 0xa2, 0xd4, 0x14, 0x09, 0x56, 0x05, 0x46, 0x0d, 0x8e, 0x20, 0xec, 0x92, 0x4e, 0xe6, 0x27, 0x1e, - 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, - 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x25, 0x9b, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9c, 0x9a, 0x93, 0x5a, 0x5c, 0x92, 0x99, 0x98, 0x5f, 0x94, 0xae, - 0x9f, 0x97, 0x5b, 0xa2, 0x5f, 0x90, 0x94, 0xc4, 0x06, 0xf6, 0xa3, 0x31, 0x20, 0x00, 0x00, 0xff, - 0xff, 0x64, 0x62, 0x02, 0x2f, 0xf5, 0x00, 0x00, 0x00, + // 236 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0xcf, 0x31, 0x4b, 0xc4, 0x30, + 0x14, 0x07, 0xf0, 0xc6, 0x5a, 0xa9, 0xe1, 0x10, 0x09, 0x0a, 0x01, 0x31, 0x14, 0xa7, 0x4e, 0xd7, + 0xc1, 0xe1, 0x76, 0x27, 0x1d, 0x14, 0xe9, 0xe8, 0x52, 0x5e, 0xda, 0x5c, 0x1b, 0xb8, 0x26, 0x21, + 0x2f, 0xc2, 0x7d, 0x0c, 0x77, 0xbf, 0x90, 0xe3, 0x8d, 0x8e, 0xd2, 0x7e, 0x11, 0xc9, 0x55, 0xb7, + 0xf7, 0xfb, 0xff, 0xdf, 0xf2, 0xa7, 0x17, 0x4e, 0x56, 0xce, 0x5b, 0xbb, 0x5d, 0x3b, 0x6f, 0x83, + 0x65, 0xf9, 0x1f, 0xe4, 0xdd, 0x27, 0xa1, 0xd9, 0x6b, 0x04, 0xbb, 0xa2, 0x19, 0x06, 0xf0, 0x81, + 0x93, 0x82, 0x94, 0x69, 0xbd, 0x80, 0x5d, 0xd2, 0x54, 0x99, 0x8e, 0x9f, 0x1c, 0xb3, 0x78, 0xc6, + 0x3f, 0x63, 0x3b, 0x85, 0x3c, 0x2d, 0xd2, 0x72, 0x55, 0x2f, 0x60, 0x37, 0xf4, 0x7c, 0xa7, 0x60, + 0xdb, 0x0c, 0x80, 0x03, 0x3f, 0x2d, 0x48, 0xb9, 0xaa, 0xf3, 0x18, 0x3c, 0x02, 0x0e, 0x6c, 0x43, + 0xb9, 0xc6, 0x66, 0x84, 0x7d, 0x63, 0x60, 0x54, 0xe8, 0xa0, 0x55, 0x8d, 0xee, 0x8d, 0xf5, 0xaa, + 0xe3, 0x59, 0x41, 0xca, 0xbc, 0xbe, 0xd6, 0xf8, 0x0c, 0xfb, 0x97, 0xff, 0xf6, 0x69, 0x29, 0x1f, + 0x36, 0x5f, 0x93, 0x20, 0x87, 0x49, 0x90, 0x9f, 0x49, 0x90, 0x8f, 0x59, 0x24, 0x87, 0x59, 0x24, + 0xdf, 0xb3, 0x48, 0xde, 0x6e, 0x7b, 0x1d, 0x86, 0x77, 0xb9, 0x6e, 0xed, 0x58, 0xb5, 0x6a, 0xa7, + 0x30, 0x68, 0xb0, 0xbe, 0xaf, 0xcc, 0x18, 0x2a, 0x27, 0xe5, 0xd9, 0x71, 0xe7, 0xfd, 0x6f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x9a, 0x8c, 0xe3, 0x46, 0xf9, 0x00, 0x00, 0x00, } func (m *Proof) Marshal() (dAtA []byte, err error) { diff --git a/pb/proof.proto b/pb/proof.proto index 45bd337..f71a7db 100644 --- a/pb/proof.proto +++ b/pb/proof.proto @@ -12,11 +12,11 @@ message Proof { int64 end = 2; // Nodes hold the tree nodes necessary for the Merkle range proof. repeated bytes nodes = 3; - // LeafHash contains the namespace.ID if NMT does not have it and + // leaf_hash contains the namespace.ID if NMT does not have it and // it should be proven. LeafHash is necessary to prove the Absence Proof. // This field will be empty in case of Inclusion Proof. - bytes leafHash = 4; - // The isMaxNamespaceIgnored flag influences the calculation of the + bytes leaf_hash = 4; + // The is_max_namespace_ignored flag influences the calculation of the // namespace ID range for intermediate nodes in the tree. - bool isMaxNamespaceIgnored=5; + bool is_max_namespace_ignored=5; } \ No newline at end of file From f71917d5f50bf5aa241e7c2b1e54b4f65e7f2c90 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 31 Aug 2023 10:32:24 +0200 Subject: [PATCH 2/2] Update pb/proof.proto Co-authored-by: Rootul P --- pb/proof.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pb/proof.proto b/pb/proof.proto index f71a7db..431685a 100644 --- a/pb/proof.proto +++ b/pb/proof.proto @@ -13,7 +13,7 @@ message Proof { // Nodes hold the tree nodes necessary for the Merkle range proof. repeated bytes nodes = 3; // leaf_hash contains the namespace.ID if NMT does not have it and - // it should be proven. LeafHash is necessary to prove the Absence Proof. + // it should be proven. leaf_hash is necessary to prove the Absence Proof. // This field will be empty in case of Inclusion Proof. bytes leaf_hash = 4; // The is_max_namespace_ignored flag influences the calculation of the