From 1ec603be6981180577f04f9f7ddb55125ce2b2b2 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 10 Jan 2024 19:38:43 +1300 Subject: [PATCH 1/2] fix: add commands for generating go types --- Makefile | 20 +++ merkle/proto/buf.gen.yaml => buf.gen.yaml | 2 +- buf.yaml | 6 +- merkle/proof.go | 2 +- merkle/proof_op.go | 2 +- merkle/proof_test.go | 2 +- merkle/proof_value.go | 2 +- merkle/proto/{gen/merkle/v1 => }/proof.pb.go | 164 +++++++++--------- merkle/proto/{merkle/v1 => }/proof.proto | 2 +- pkg/blob/blob.pb.go | 129 +++++++------- .../celestia/core/v1 => pkg}/blob/blob.proto | 2 +- proto/buf.gen.yaml | 6 - 12 files changed, 176 insertions(+), 163 deletions(-) create mode 100644 Makefile rename merkle/proto/buf.gen.yaml => buf.gen.yaml (88%) rename merkle/proto/{gen/merkle/v1 => }/proof.pb.go (58%) rename merkle/proto/{merkle/v1 => }/proof.proto (97%) rename {proto/celestia/core/v1 => pkg}/blob/blob.proto (97%) delete mode 100644 proto/buf.gen.yaml diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89dbedb --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +DOCKER := $(shell which docker) +DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf + +## proto-gen-docker: Generate protobuf files. Requires docker. +proto-gen-docker: + @echo "--> Generating Protobuf files" + $(DOCKER_BUF) generate +.PHONY: proto-gen-docker + +## proto-gen: Generate protobuf files. Requires buf. +proto-gen: + @echo "--> Generating Protobuf files" + @buf generate +.PHONY: proto-gen + +## proto-lint-docker: Lint protobuf files. Requires docker. +proto-lint-docker: + @echo "--> Linting Protobuf files" + @$(DOCKER_BUF) lint +.PHONY: proto-lint diff --git a/merkle/proto/buf.gen.yaml b/buf.gen.yaml similarity index 88% rename from merkle/proto/buf.gen.yaml rename to buf.gen.yaml index 55de0af..e832b60 100644 --- a/merkle/proto/buf.gen.yaml +++ b/buf.gen.yaml @@ -1,6 +1,6 @@ version: v1 plugins: - plugin: buf.build/protocolbuffers/go - out: gen + out: . opt: - paths=source_relative diff --git a/buf.yaml b/buf.yaml index 98656e2..38572f0 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,9 +1,9 @@ version: v1 -roots: - -proto +name: buf.build/celestiaorg/go-square breaking: use: - FILE lint: use: - - DEFAULT + - BASIC + diff --git a/merkle/proof.go b/merkle/proof.go index 2491b47..4c070f6 100644 --- a/merkle/proof.go +++ b/merkle/proof.go @@ -6,7 +6,7 @@ import ( "errors" "fmt" - wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1" + wire "github.com/celestiaorg/go-square/merkle/proto" ) const ( diff --git a/merkle/proof_op.go b/merkle/proof_op.go index 122b600..9066301 100644 --- a/merkle/proof_op.go +++ b/merkle/proof_op.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1" + wire "github.com/celestiaorg/go-square/merkle/proto" ) //---------------------------------------- diff --git a/merkle/proof_test.go b/merkle/proof_test.go index 033f085..dce7380 100644 --- a/merkle/proof_test.go +++ b/merkle/proof_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1" + wire "github.com/celestiaorg/go-square/merkle/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" diff --git a/merkle/proof_value.go b/merkle/proof_value.go index 5ef8933..9b670d6 100644 --- a/merkle/proof_value.go +++ b/merkle/proof_value.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "fmt" - wire "github.com/celestiaorg/go-square/merkle/proto/gen/merkle/v1" + wire "github.com/celestiaorg/go-square/merkle/proto" "google.golang.org/protobuf/proto" ) diff --git a/merkle/proto/gen/merkle/v1/proof.pb.go b/merkle/proto/proof.pb.go similarity index 58% rename from merkle/proto/gen/merkle/v1/proof.pb.go rename to merkle/proto/proof.pb.go index f26aa80..98ccb84 100644 --- a/merkle/proto/gen/merkle/v1/proof.pb.go +++ b/merkle/proto/proof.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) -// source: merkle/v1/proof.proto +// source: merkle/proto/proof.proto package merkle @@ -34,7 +34,7 @@ type Proof struct { func (x *Proof) Reset() { *x = Proof{} if protoimpl.UnsafeEnabled { - mi := &file_merkle_v1_proof_proto_msgTypes[0] + mi := &file_merkle_proto_proof_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +47,7 @@ func (x *Proof) String() string { func (*Proof) ProtoMessage() {} func (x *Proof) ProtoReflect() protoreflect.Message { - mi := &file_merkle_v1_proof_proto_msgTypes[0] + mi := &file_merkle_proto_proof_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +60,7 @@ func (x *Proof) ProtoReflect() protoreflect.Message { // Deprecated: Use Proof.ProtoReflect.Descriptor instead. func (*Proof) Descriptor() ([]byte, []int) { - return file_merkle_v1_proof_proto_rawDescGZIP(), []int{0} + return file_merkle_proto_proof_proto_rawDescGZIP(), []int{0} } func (x *Proof) GetTotal() int64 { @@ -105,7 +105,7 @@ type ValueOp struct { func (x *ValueOp) Reset() { *x = ValueOp{} if protoimpl.UnsafeEnabled { - mi := &file_merkle_v1_proof_proto_msgTypes[1] + mi := &file_merkle_proto_proof_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -118,7 +118,7 @@ func (x *ValueOp) String() string { func (*ValueOp) ProtoMessage() {} func (x *ValueOp) ProtoReflect() protoreflect.Message { - mi := &file_merkle_v1_proof_proto_msgTypes[1] + mi := &file_merkle_proto_proof_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -131,7 +131,7 @@ func (x *ValueOp) ProtoReflect() protoreflect.Message { // Deprecated: Use ValueOp.ProtoReflect.Descriptor instead. func (*ValueOp) Descriptor() ([]byte, []int) { - return file_merkle_v1_proof_proto_rawDescGZIP(), []int{1} + return file_merkle_proto_proof_proto_rawDescGZIP(), []int{1} } func (x *ValueOp) GetKey() []byte { @@ -161,7 +161,7 @@ type DominoOp struct { func (x *DominoOp) Reset() { *x = DominoOp{} if protoimpl.UnsafeEnabled { - mi := &file_merkle_v1_proof_proto_msgTypes[2] + mi := &file_merkle_proto_proof_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -174,7 +174,7 @@ func (x *DominoOp) String() string { func (*DominoOp) ProtoMessage() {} func (x *DominoOp) ProtoReflect() protoreflect.Message { - mi := &file_merkle_v1_proof_proto_msgTypes[2] + mi := &file_merkle_proto_proof_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -187,7 +187,7 @@ func (x *DominoOp) ProtoReflect() protoreflect.Message { // Deprecated: Use DominoOp.ProtoReflect.Descriptor instead. func (*DominoOp) Descriptor() ([]byte, []int) { - return file_merkle_v1_proof_proto_rawDescGZIP(), []int{2} + return file_merkle_proto_proof_proto_rawDescGZIP(), []int{2} } func (x *DominoOp) GetKey() string { @@ -227,7 +227,7 @@ type ProofOp struct { func (x *ProofOp) Reset() { *x = ProofOp{} if protoimpl.UnsafeEnabled { - mi := &file_merkle_v1_proof_proto_msgTypes[3] + mi := &file_merkle_proto_proof_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -240,7 +240,7 @@ func (x *ProofOp) String() string { func (*ProofOp) ProtoMessage() {} func (x *ProofOp) ProtoReflect() protoreflect.Message { - mi := &file_merkle_v1_proof_proto_msgTypes[3] + mi := &file_merkle_proto_proof_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -253,7 +253,7 @@ func (x *ProofOp) ProtoReflect() protoreflect.Message { // Deprecated: Use ProofOp.ProtoReflect.Descriptor instead. func (*ProofOp) Descriptor() ([]byte, []int) { - return file_merkle_v1_proof_proto_rawDescGZIP(), []int{3} + return file_merkle_proto_proof_proto_rawDescGZIP(), []int{3} } func (x *ProofOp) GetType() string { @@ -289,7 +289,7 @@ type ProofOps struct { func (x *ProofOps) Reset() { *x = ProofOps{} if protoimpl.UnsafeEnabled { - mi := &file_merkle_v1_proof_proto_msgTypes[4] + mi := &file_merkle_proto_proof_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -302,7 +302,7 @@ func (x *ProofOps) String() string { func (*ProofOps) ProtoMessage() {} func (x *ProofOps) ProtoReflect() protoreflect.Message { - mi := &file_merkle_v1_proof_proto_msgTypes[4] + mi := &file_merkle_proto_proof_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -315,7 +315,7 @@ func (x *ProofOps) ProtoReflect() protoreflect.Message { // Deprecated: Use ProofOps.ProtoReflect.Descriptor instead. func (*ProofOps) Descriptor() ([]byte, []int) { - return file_merkle_v1_proof_proto_rawDescGZIP(), []int{4} + return file_merkle_proto_proof_proto_rawDescGZIP(), []int{4} } func (x *ProofOps) GetOps() []*ProofOp { @@ -325,64 +325,64 @@ func (x *ProofOps) GetOps() []*ProofOp { return nil } -var File_merkle_v1_proof_proto protoreflect.FileDescriptor - -var file_merkle_v1_proof_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, - 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x22, 0x66, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6c, - 0x65, 0x61, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, - 0x6c, 0x65, 0x61, 0x66, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x75, 0x6e, 0x74, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x61, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x47, - 0x0a, 0x07, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x71, 0x75, - 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x4a, 0x0a, 0x08, 0x44, 0x6f, 0x6d, 0x69, 0x6e, - 0x6f, 0x4f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x22, 0x43, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x34, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x4f, 0x70, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x6f, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x6b, 0x6c, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x42, 0x29, - 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, - 0x65, 0x73, 0x74, 0x69, 0x61, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x6f, 0x2d, 0x73, 0x71, 0x75, 0x61, - 0x72, 0x65, 0x2f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, +var File_merkle_proto_proof_proto protoreflect.FileDescriptor + +var file_merkle_proto_proof_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x73, 0x71, 0x75, 0x61, + 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x22, 0x66, 0x0a, 0x05, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x66, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, + 0x0a, 0x05, 0x61, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x61, + 0x75, 0x6e, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x07, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x22, 0x4a, 0x0a, 0x08, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x6f, 0x4f, 0x70, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x43, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x37, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x73, 0x12, 0x2b, 0x0a, + 0x03, 0x6f, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x71, 0x75, + 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x4f, 0x70, 0x52, 0x03, 0x6f, 0x70, 0x73, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x69, + 0x61, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x6f, 0x2d, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2f, 0x6d, + 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_merkle_v1_proof_proto_rawDescOnce sync.Once - file_merkle_v1_proof_proto_rawDescData = file_merkle_v1_proof_proto_rawDesc + file_merkle_proto_proof_proto_rawDescOnce sync.Once + file_merkle_proto_proof_proto_rawDescData = file_merkle_proto_proof_proto_rawDesc ) -func file_merkle_v1_proof_proto_rawDescGZIP() []byte { - file_merkle_v1_proof_proto_rawDescOnce.Do(func() { - file_merkle_v1_proof_proto_rawDescData = protoimpl.X.CompressGZIP(file_merkle_v1_proof_proto_rawDescData) +func file_merkle_proto_proof_proto_rawDescGZIP() []byte { + file_merkle_proto_proof_proto_rawDescOnce.Do(func() { + file_merkle_proto_proof_proto_rawDescData = protoimpl.X.CompressGZIP(file_merkle_proto_proof_proto_rawDescData) }) - return file_merkle_v1_proof_proto_rawDescData + return file_merkle_proto_proof_proto_rawDescData } -var file_merkle_v1_proof_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_merkle_v1_proof_proto_goTypes = []interface{}{ - (*Proof)(nil), // 0: square.merkle.Proof - (*ValueOp)(nil), // 1: square.merkle.ValueOp - (*DominoOp)(nil), // 2: square.merkle.DominoOp - (*ProofOp)(nil), // 3: square.merkle.ProofOp - (*ProofOps)(nil), // 4: square.merkle.ProofOps +var file_merkle_proto_proof_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_merkle_proto_proof_proto_goTypes = []interface{}{ + (*Proof)(nil), // 0: square.merkle.v1.Proof + (*ValueOp)(nil), // 1: square.merkle.v1.ValueOp + (*DominoOp)(nil), // 2: square.merkle.v1.DominoOp + (*ProofOp)(nil), // 3: square.merkle.v1.ProofOp + (*ProofOps)(nil), // 4: square.merkle.v1.ProofOps } -var file_merkle_v1_proof_proto_depIdxs = []int32{ - 0, // 0: square.merkle.ValueOp.proof:type_name -> square.merkle.Proof - 3, // 1: square.merkle.ProofOps.ops:type_name -> square.merkle.ProofOp +var file_merkle_proto_proof_proto_depIdxs = []int32{ + 0, // 0: square.merkle.v1.ValueOp.proof:type_name -> square.merkle.v1.Proof + 3, // 1: square.merkle.v1.ProofOps.ops:type_name -> square.merkle.v1.ProofOp 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -390,13 +390,13 @@ var file_merkle_v1_proof_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_merkle_v1_proof_proto_init() } -func file_merkle_v1_proof_proto_init() { - if File_merkle_v1_proof_proto != nil { +func init() { file_merkle_proto_proof_proto_init() } +func file_merkle_proto_proof_proto_init() { + if File_merkle_proto_proof_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_merkle_v1_proof_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_merkle_proto_proof_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Proof); i { case 0: return &v.state @@ -408,7 +408,7 @@ func file_merkle_v1_proof_proto_init() { return nil } } - file_merkle_v1_proof_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_merkle_proto_proof_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValueOp); i { case 0: return &v.state @@ -420,7 +420,7 @@ func file_merkle_v1_proof_proto_init() { return nil } } - file_merkle_v1_proof_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_merkle_proto_proof_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DominoOp); i { case 0: return &v.state @@ -432,7 +432,7 @@ func file_merkle_v1_proof_proto_init() { return nil } } - file_merkle_v1_proof_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_merkle_proto_proof_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProofOp); i { case 0: return &v.state @@ -444,7 +444,7 @@ func file_merkle_v1_proof_proto_init() { return nil } } - file_merkle_v1_proof_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_merkle_proto_proof_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProofOps); i { case 0: return &v.state @@ -461,18 +461,18 @@ func file_merkle_v1_proof_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_merkle_v1_proof_proto_rawDesc, + RawDescriptor: file_merkle_proto_proof_proto_rawDesc, NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_merkle_v1_proof_proto_goTypes, - DependencyIndexes: file_merkle_v1_proof_proto_depIdxs, - MessageInfos: file_merkle_v1_proof_proto_msgTypes, + GoTypes: file_merkle_proto_proof_proto_goTypes, + DependencyIndexes: file_merkle_proto_proof_proto_depIdxs, + MessageInfos: file_merkle_proto_proof_proto_msgTypes, }.Build() - File_merkle_v1_proof_proto = out.File - file_merkle_v1_proof_proto_rawDesc = nil - file_merkle_v1_proof_proto_goTypes = nil - file_merkle_v1_proof_proto_depIdxs = nil + File_merkle_proto_proof_proto = out.File + file_merkle_proto_proof_proto_rawDesc = nil + file_merkle_proto_proof_proto_goTypes = nil + file_merkle_proto_proof_proto_depIdxs = nil } diff --git a/merkle/proto/merkle/v1/proof.proto b/merkle/proto/proof.proto similarity index 97% rename from merkle/proto/merkle/v1/proof.proto rename to merkle/proto/proof.proto index 47fe221..7f60cdb 100644 --- a/merkle/proto/merkle/v1/proof.proto +++ b/merkle/proto/proof.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package square.merkle; +package merkle.proto; option go_package = "github.com/celestiaorg/go-square/merkle"; diff --git a/pkg/blob/blob.pb.go b/pkg/blob/blob.pb.go index 8eceb38..3d05bcb 100644 --- a/pkg/blob/blob.pb.go +++ b/pkg/blob/blob.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) -// source: celestia/core/v1/blob/blob.proto +// source: pkg/blob/blob.proto package blob @@ -38,7 +38,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[0] + mi := &file_pkg_blob_blob_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +51,7 @@ func (x *Blob) String() string { func (*Blob) ProtoMessage() {} func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[0] + mi := &file_pkg_blob_blob_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -64,7 +64,7 @@ func (x *Blob) ProtoReflect() protoreflect.Message { // Deprecated: Use Blob.ProtoReflect.Descriptor instead. func (*Blob) Descriptor() ([]byte, []int) { - return file_celestia_core_v1_blob_blob_proto_rawDescGZIP(), []int{0} + return file_pkg_blob_blob_proto_rawDescGZIP(), []int{0} } func (x *Blob) GetNamespaceId() []byte { @@ -111,7 +111,7 @@ type BlobTx struct { func (x *BlobTx) Reset() { *x = BlobTx{} if protoimpl.UnsafeEnabled { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[1] + mi := &file_pkg_blob_blob_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -124,7 +124,7 @@ func (x *BlobTx) String() string { func (*BlobTx) ProtoMessage() {} func (x *BlobTx) ProtoReflect() protoreflect.Message { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[1] + mi := &file_pkg_blob_blob_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -137,7 +137,7 @@ func (x *BlobTx) ProtoReflect() protoreflect.Message { // Deprecated: Use BlobTx.ProtoReflect.Descriptor instead. func (*BlobTx) Descriptor() ([]byte, []int) { - return file_celestia_core_v1_blob_blob_proto_rawDescGZIP(), []int{1} + return file_pkg_blob_blob_proto_rawDescGZIP(), []int{1} } func (x *BlobTx) GetTx() []byte { @@ -176,7 +176,7 @@ type IndexWrapper struct { func (x *IndexWrapper) Reset() { *x = IndexWrapper{} if protoimpl.UnsafeEnabled { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[2] + mi := &file_pkg_blob_blob_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -189,7 +189,7 @@ func (x *IndexWrapper) String() string { func (*IndexWrapper) ProtoMessage() {} func (x *IndexWrapper) ProtoReflect() protoreflect.Message { - mi := &file_celestia_core_v1_blob_blob_proto_msgTypes[2] + mi := &file_pkg_blob_blob_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -202,7 +202,7 @@ func (x *IndexWrapper) ProtoReflect() protoreflect.Message { // Deprecated: Use IndexWrapper.ProtoReflect.Descriptor instead. func (*IndexWrapper) Descriptor() ([]byte, []int) { - return file_celestia_core_v1_blob_blob_proto_rawDescGZIP(), []int{2} + return file_pkg_blob_blob_proto_rawDescGZIP(), []int{2} } func (x *IndexWrapper) GetTx() []byte { @@ -226,58 +226,57 @@ func (x *IndexWrapper) GetTypeId() string { return "" } -var File_celestia_core_v1_blob_blob_proto protoreflect.FileDescriptor - -var file_celestia_core_v1_blob_blob_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x69, 0x61, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0e, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, - 0x76, 0x31, 0x22, 0x8f, 0x01, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x21, 0x0a, 0x0c, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x6e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x10, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x06, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x78, 0x12, 0x0e, - 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, 0x78, 0x12, 0x2a, - 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x79, - 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x79, 0x70, - 0x65, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x57, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x02, 0x74, 0x78, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x72, - 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x79, 0x70, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x79, 0x70, 0x65, 0x49, - 0x64, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x69, 0x61, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x6f, 0x2d, 0x73, - 0x71, 0x75, 0x61, 0x72, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_pkg_blob_blob_proto protoreflect.FileDescriptor + +var file_pkg_blob_blob_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x22, 0x8f, 0x01, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x21, + 0x0a, 0x0c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x06, 0x42, 0x6c, 0x6f, 0x62, 0x54, + 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x74, + 0x78, 0x12, 0x2a, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x17, 0x0a, + 0x07, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x74, 0x79, 0x70, 0x65, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x57, + 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x02, 0x74, 0x78, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0c, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x74, + 0x79, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x79, + 0x70, 0x65, 0x49, 0x64, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x65, 0x6c, 0x65, 0x73, 0x74, 0x69, 0x61, 0x6f, 0x72, 0x67, 0x2f, 0x67, + 0x6f, 0x2d, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x6c, 0x6f, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_celestia_core_v1_blob_blob_proto_rawDescOnce sync.Once - file_celestia_core_v1_blob_blob_proto_rawDescData = file_celestia_core_v1_blob_blob_proto_rawDesc + file_pkg_blob_blob_proto_rawDescOnce sync.Once + file_pkg_blob_blob_proto_rawDescData = file_pkg_blob_blob_proto_rawDesc ) -func file_celestia_core_v1_blob_blob_proto_rawDescGZIP() []byte { - file_celestia_core_v1_blob_blob_proto_rawDescOnce.Do(func() { - file_celestia_core_v1_blob_blob_proto_rawDescData = protoimpl.X.CompressGZIP(file_celestia_core_v1_blob_blob_proto_rawDescData) +func file_pkg_blob_blob_proto_rawDescGZIP() []byte { + file_pkg_blob_blob_proto_rawDescOnce.Do(func() { + file_pkg_blob_blob_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_blob_blob_proto_rawDescData) }) - return file_celestia_core_v1_blob_blob_proto_rawDescData + return file_pkg_blob_blob_proto_rawDescData } -var file_celestia_core_v1_blob_blob_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_celestia_core_v1_blob_blob_proto_goTypes = []interface{}{ +var file_pkg_blob_blob_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_pkg_blob_blob_proto_goTypes = []interface{}{ (*Blob)(nil), // 0: square.blob.v1.Blob (*BlobTx)(nil), // 1: square.blob.v1.BlobTx (*IndexWrapper)(nil), // 2: square.blob.v1.IndexWrapper } -var file_celestia_core_v1_blob_blob_proto_depIdxs = []int32{ +var file_pkg_blob_blob_proto_depIdxs = []int32{ 0, // 0: square.blob.v1.BlobTx.blobs:type_name -> square.blob.v1.Blob 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type @@ -286,13 +285,13 @@ var file_celestia_core_v1_blob_blob_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_celestia_core_v1_blob_blob_proto_init() } -func file_celestia_core_v1_blob_blob_proto_init() { - if File_celestia_core_v1_blob_blob_proto != nil { +func init() { file_pkg_blob_blob_proto_init() } +func file_pkg_blob_blob_proto_init() { + if File_pkg_blob_blob_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_celestia_core_v1_blob_blob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_blob_blob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Blob); i { case 0: return &v.state @@ -304,7 +303,7 @@ func file_celestia_core_v1_blob_blob_proto_init() { return nil } } - file_celestia_core_v1_blob_blob_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pkg_blob_blob_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobTx); i { case 0: return &v.state @@ -316,7 +315,7 @@ func file_celestia_core_v1_blob_blob_proto_init() { return nil } } - file_celestia_core_v1_blob_blob_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pkg_blob_blob_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IndexWrapper); i { case 0: return &v.state @@ -333,18 +332,18 @@ func file_celestia_core_v1_blob_blob_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_celestia_core_v1_blob_blob_proto_rawDesc, + RawDescriptor: file_pkg_blob_blob_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_celestia_core_v1_blob_blob_proto_goTypes, - DependencyIndexes: file_celestia_core_v1_blob_blob_proto_depIdxs, - MessageInfos: file_celestia_core_v1_blob_blob_proto_msgTypes, + GoTypes: file_pkg_blob_blob_proto_goTypes, + DependencyIndexes: file_pkg_blob_blob_proto_depIdxs, + MessageInfos: file_pkg_blob_blob_proto_msgTypes, }.Build() - File_celestia_core_v1_blob_blob_proto = out.File - file_celestia_core_v1_blob_blob_proto_rawDesc = nil - file_celestia_core_v1_blob_blob_proto_goTypes = nil - file_celestia_core_v1_blob_blob_proto_depIdxs = nil + File_pkg_blob_blob_proto = out.File + file_pkg_blob_blob_proto_rawDesc = nil + file_pkg_blob_blob_proto_goTypes = nil + file_pkg_blob_blob_proto_depIdxs = nil } diff --git a/proto/celestia/core/v1/blob/blob.proto b/pkg/blob/blob.proto similarity index 97% rename from proto/celestia/core/v1/blob/blob.proto rename to pkg/blob/blob.proto index 1f3e7f5..1ccdcb0 100644 --- a/proto/celestia/core/v1/blob/blob.proto +++ b/pkg/blob/blob.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package square.blob.v1; +package pkg.blob; option go_package = "github.com/celestiaorg/go-square/pkg/blob"; diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml deleted file mode 100644 index 7e4cca4..0000000 --- a/proto/buf.gen.yaml +++ /dev/null @@ -1,6 +0,0 @@ -version: v1 -plugins: - - plugin: buf.build/protocolbuffers/go - out: ../pkg/blob - opt: - - paths=source_relative From 56579823867071a2c38d28ae0bfe3333d64a6441 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Mon, 15 Jan 2024 15:19:51 +1300 Subject: [PATCH 2/2] checkpoint --- {pkg/blob => blob}/blob.go | 2 +- {pkg/blob => blob}/blob.pb.go | 0 {pkg/blob => blob}/blob.proto | 2 +- .../blob_share_commitment_rules.go | 2 +- .../blob_share_commitment_rules_test.go | 4 ++-- {pkg/inclusion => inclusion}/commitment.go | 6 +++--- {pkg/inclusion => inclusion}/commitment_test.go | 8 ++++---- internal/test/factory.go | 6 +++--- {pkg/namespace => namespace}/README.md | 0 {pkg/namespace => namespace}/consts.go | 0 {pkg/namespace => namespace}/namespace.go | 0 {pkg/namespace => namespace}/namespace_test.go | 0 {pkg/namespace => namespace}/random_blob.go | 0 {pkg/namespace => namespace}/random_namespace.go | 0 {pkg/shares => shares}/README.md | 0 {pkg/shares => shares}/compact_shares_test.go | 2 +- {pkg/shares => shares}/consts.go | 2 +- {pkg/shares => shares}/counter.go | 0 {pkg/shares => shares}/counter_test.go | 4 ++-- {pkg/shares => shares}/info_byte.go | 0 {pkg/shares => shares}/info_byte_test.go | 0 {pkg/shares => shares}/namespace.go | 2 +- {pkg/shares => shares}/padding.go | 2 +- {pkg/shares => shares}/padding_test.go | 2 +- {pkg/shares => shares}/parse.go | 2 +- {pkg/shares => shares}/parse_compact_shares.go | 0 {pkg/shares => shares}/parse_sparse_shares.go | 2 +- {pkg/shares => shares}/parse_sparse_shares_test.go | 4 ++-- {pkg/shares => shares}/parse_test.go | 2 +- {pkg/shares => shares}/powers_of_two.go | 0 {pkg/shares => shares}/powers_of_two_test.go | 0 {pkg/shares => shares}/range.go | 0 {pkg/shares => shares}/reserved_bytes.go | 0 {pkg/shares => shares}/reserved_bytes_test.go | 0 {pkg/shares => shares}/share_builder.go | 2 +- {pkg/shares => shares}/share_builder_test.go | 2 +- {pkg/shares => shares}/share_sequence.go | 2 +- {pkg/shares => shares}/share_sequence_test.go | 2 +- {pkg/shares => shares}/share_splitting.go | 4 ++-- {pkg/shares => shares}/share_splitting_test.go | 4 ++-- {pkg/shares => shares}/shares.go | 2 +- {pkg/shares => shares}/shares_test.go | 2 +- {pkg/shares => shares}/sparse_shares_test.go | 2 +- {pkg/shares => shares}/split_compact_shares.go | 2 +- {pkg/shares => shares}/split_compact_shares_test.go | 2 +- {pkg/shares => shares}/split_sparse_shares.go | 2 +- {pkg/shares => shares}/split_sparse_shares_test.go | 4 ++-- {pkg/shares => shares}/utils.go | 0 {pkg/shares => shares}/utils_test.go | 0 {pkg/square => square}/builder.go | 8 ++++---- {pkg/square => square}/builder_test.go | 8 ++++---- {pkg/square => square}/square.go | 6 +++--- {pkg/square => square}/square_benchmark_test.go | 2 +- {pkg/square => square}/square_test.go | 6 +++--- 54 files changed, 58 insertions(+), 58 deletions(-) rename {pkg/blob => blob}/blob.go (98%) rename {pkg/blob => blob}/blob.pb.go (100%) rename {pkg/blob => blob}/blob.proto (94%) rename {pkg/inclusion => inclusion}/blob_share_commitment_rules.go (98%) rename {pkg/inclusion => inclusion}/blob_share_commitment_rules_test.go (98%) rename {pkg/inclusion => inclusion}/commitment.go (96%) rename {pkg/inclusion => inclusion}/commitment_test.go (94%) rename {pkg/namespace => namespace}/README.md (100%) rename {pkg/namespace => namespace}/consts.go (100%) rename {pkg/namespace => namespace}/namespace.go (100%) rename {pkg/namespace => namespace}/namespace_test.go (100%) rename {pkg/namespace => namespace}/random_blob.go (100%) rename {pkg/namespace => namespace}/random_namespace.go (100%) rename {pkg/shares => shares}/README.md (100%) rename {pkg/shares => shares}/compact_shares_test.go (99%) rename {pkg/shares => shares}/consts.go (97%) rename {pkg/shares => shares}/counter.go (100%) rename {pkg/shares => shares}/counter_test.go (95%) rename {pkg/shares => shares}/info_byte.go (100%) rename {pkg/shares => shares}/info_byte_test.go (100%) rename {pkg/shares => shares}/namespace.go (95%) rename {pkg/shares => shares}/padding.go (98%) rename {pkg/shares => shares}/padding_test.go (97%) rename {pkg/shares => shares}/parse.go (97%) rename {pkg/shares => shares}/parse_compact_shares.go (100%) rename {pkg/shares => shares}/parse_sparse_shares.go (97%) rename {pkg/shares => shares}/parse_sparse_shares_test.go (97%) rename {pkg/shares => shares}/parse_test.go (99%) rename {pkg/shares => shares}/powers_of_two.go (100%) rename {pkg/shares => shares}/powers_of_two_test.go (100%) rename {pkg/shares => shares}/range.go (100%) rename {pkg/shares => shares}/reserved_bytes.go (100%) rename {pkg/shares => shares}/reserved_bytes_test.go (100%) rename {pkg/shares => shares}/share_builder.go (99%) rename {pkg/shares => shares}/share_builder_test.go (99%) rename {pkg/shares => shares}/share_sequence.go (98%) rename {pkg/shares => shares}/share_sequence_test.go (99%) rename {pkg/shares => shares}/share_splitting.go (96%) rename {pkg/shares => shares}/share_splitting_test.go (99%) rename {pkg/shares => shares}/shares.go (99%) rename {pkg/shares => shares}/shares_test.go (99%) rename {pkg/shares => shares}/sparse_shares_test.go (98%) rename {pkg/shares => shares}/split_compact_shares.go (99%) rename {pkg/shares => shares}/split_compact_shares_test.go (99%) rename {pkg/shares => shares}/split_sparse_shares.go (98%) rename {pkg/shares => shares}/split_sparse_shares_test.go (94%) rename {pkg/shares => shares}/utils.go (100%) rename {pkg/shares => shares}/utils_test.go (100%) rename {pkg/square => square}/builder.go (98%) rename {pkg/square => square}/builder_test.go (98%) rename {pkg/square => square}/square.go (98%) rename {pkg/square => square}/square_benchmark_test.go (96%) rename {pkg/square => square}/square_test.go (97%) diff --git a/pkg/blob/blob.go b/blob/blob.go similarity index 98% rename from pkg/blob/blob.go rename to blob/blob.go index eaa3fd3..3ef52ed 100644 --- a/pkg/blob/blob.go +++ b/blob/blob.go @@ -7,7 +7,7 @@ import ( math "math" "sort" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "google.golang.org/protobuf/proto" ) diff --git a/pkg/blob/blob.pb.go b/blob/blob.pb.go similarity index 100% rename from pkg/blob/blob.pb.go rename to blob/blob.pb.go diff --git a/pkg/blob/blob.proto b/blob/blob.proto similarity index 94% rename from pkg/blob/blob.proto rename to blob/blob.proto index 1ccdcb0..4d82692 100644 --- a/pkg/blob/blob.proto +++ b/blob/blob.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package pkg.blob; -option go_package = "github.com/celestiaorg/go-square/pkg/blob"; +option go_package = "github.com/celestiaorg/go-square/blob"; // Blob (named after binary large object) is a chunk of data submitted by a user // to be published to the Celestia blockchain. The data of a Blob is published diff --git a/pkg/inclusion/blob_share_commitment_rules.go b/inclusion/blob_share_commitment_rules.go similarity index 98% rename from pkg/inclusion/blob_share_commitment_rules.go rename to inclusion/blob_share_commitment_rules.go index 9647bad..2a0a205 100644 --- a/pkg/inclusion/blob_share_commitment_rules.go +++ b/inclusion/blob_share_commitment_rules.go @@ -3,7 +3,7 @@ package inclusion import ( "math" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/shares" "golang.org/x/exp/constraints" ) diff --git a/pkg/inclusion/blob_share_commitment_rules_test.go b/inclusion/blob_share_commitment_rules_test.go similarity index 98% rename from pkg/inclusion/blob_share_commitment_rules_test.go rename to inclusion/blob_share_commitment_rules_test.go index 1405814..cdf299b 100644 --- a/pkg/inclusion/blob_share_commitment_rules_test.go +++ b/inclusion/blob_share_commitment_rules_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/celestiaorg/go-square/pkg/inclusion" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/inclusion" + "github.com/celestiaorg/go-square/shares" "github.com/stretchr/testify/assert" ) diff --git a/pkg/inclusion/commitment.go b/inclusion/commitment.go similarity index 96% rename from pkg/inclusion/commitment.go rename to inclusion/commitment.go index a00b788..c06f3e0 100644 --- a/pkg/inclusion/commitment.go +++ b/inclusion/commitment.go @@ -3,9 +3,9 @@ package inclusion import ( "crypto/sha256" - "github.com/celestiaorg/go-square/pkg/blob" - ns "github.com/celestiaorg/go-square/pkg/namespace" - sh "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/blob" + ns "github.com/celestiaorg/go-square/namespace" + sh "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/nmt" ) diff --git a/pkg/inclusion/commitment_test.go b/inclusion/commitment_test.go similarity index 94% rename from pkg/inclusion/commitment_test.go rename to inclusion/commitment_test.go index 2f8bd63..61a9b08 100644 --- a/pkg/inclusion/commitment_test.go +++ b/inclusion/commitment_test.go @@ -5,10 +5,10 @@ import ( "crypto/sha256" "testing" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/inclusion" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/inclusion" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/internal/test/factory.go b/internal/test/factory.go index 4272d82..d0f1a7a 100644 --- a/internal/test/factory.go +++ b/internal/test/factory.go @@ -6,9 +6,9 @@ import ( "fmt" "math/rand" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" ) var DefaultTestNamespace = namespace.MustNewV0([]byte("test")) diff --git a/pkg/namespace/README.md b/namespace/README.md similarity index 100% rename from pkg/namespace/README.md rename to namespace/README.md diff --git a/pkg/namespace/consts.go b/namespace/consts.go similarity index 100% rename from pkg/namespace/consts.go rename to namespace/consts.go diff --git a/pkg/namespace/namespace.go b/namespace/namespace.go similarity index 100% rename from pkg/namespace/namespace.go rename to namespace/namespace.go diff --git a/pkg/namespace/namespace_test.go b/namespace/namespace_test.go similarity index 100% rename from pkg/namespace/namespace_test.go rename to namespace/namespace_test.go diff --git a/pkg/namespace/random_blob.go b/namespace/random_blob.go similarity index 100% rename from pkg/namespace/random_blob.go rename to namespace/random_blob.go diff --git a/pkg/namespace/random_namespace.go b/namespace/random_namespace.go similarity index 100% rename from pkg/namespace/random_namespace.go rename to namespace/random_namespace.go diff --git a/pkg/shares/README.md b/shares/README.md similarity index 100% rename from pkg/shares/README.md rename to shares/README.md diff --git a/pkg/shares/compact_shares_test.go b/shares/compact_shares_test.go similarity index 99% rename from pkg/shares/compact_shares_test.go rename to shares/compact_shares_test.go index 664a0da..c5dabbd 100644 --- a/pkg/shares/compact_shares_test.go +++ b/shares/compact_shares_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/consts.go b/shares/consts.go similarity index 97% rename from pkg/shares/consts.go rename to shares/consts.go index b9b8070..6ed2814 100644 --- a/pkg/shares/consts.go +++ b/shares/consts.go @@ -1,7 +1,7 @@ package shares import ( - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) const ( diff --git a/pkg/shares/counter.go b/shares/counter.go similarity index 100% rename from pkg/shares/counter.go rename to shares/counter.go diff --git a/pkg/shares/counter_test.go b/shares/counter_test.go similarity index 95% rename from pkg/shares/counter_test.go rename to shares/counter_test.go index 698f524..eb82917 100644 --- a/pkg/shares/counter_test.go +++ b/shares/counter_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/info_byte.go b/shares/info_byte.go similarity index 100% rename from pkg/shares/info_byte.go rename to shares/info_byte.go diff --git a/pkg/shares/info_byte_test.go b/shares/info_byte_test.go similarity index 100% rename from pkg/shares/info_byte_test.go rename to shares/info_byte_test.go diff --git a/pkg/shares/namespace.go b/shares/namespace.go similarity index 95% rename from pkg/shares/namespace.go rename to shares/namespace.go index 2dd55d5..47aa57d 100644 --- a/pkg/shares/namespace.go +++ b/shares/namespace.go @@ -3,7 +3,7 @@ package shares import ( "fmt" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) // GetShareRangeForNamespace returns all shares that belong to a given diff --git a/pkg/shares/padding.go b/shares/padding.go similarity index 98% rename from pkg/shares/padding.go rename to shares/padding.go index 0000e7b..020dafc 100644 --- a/pkg/shares/padding.go +++ b/shares/padding.go @@ -4,7 +4,7 @@ import ( "bytes" "errors" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) // NamespacePaddingShare returns a share that acts as padding. Namespace padding diff --git a/pkg/shares/padding_test.go b/shares/padding_test.go similarity index 97% rename from pkg/shares/padding_test.go rename to shares/padding_test.go index fab42c1..8b77165 100644 --- a/pkg/shares/padding_test.go +++ b/shares/padding_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/parse.go b/shares/parse.go similarity index 97% rename from pkg/shares/parse.go rename to shares/parse.go index 5a86d9e..6f37ec1 100644 --- a/pkg/shares/parse.go +++ b/shares/parse.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/celestiaorg/go-square/pkg/blob" + "github.com/celestiaorg/go-square/blob" ) // ParseTxs collects all of the transactions from the shares provided diff --git a/pkg/shares/parse_compact_shares.go b/shares/parse_compact_shares.go similarity index 100% rename from pkg/shares/parse_compact_shares.go rename to shares/parse_compact_shares.go diff --git a/pkg/shares/parse_sparse_shares.go b/shares/parse_sparse_shares.go similarity index 97% rename from pkg/shares/parse_sparse_shares.go rename to shares/parse_sparse_shares.go index 704673c..7927f0a 100644 --- a/pkg/shares/parse_sparse_shares.go +++ b/shares/parse_sparse_shares.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/celestiaorg/go-square/pkg/blob" + "github.com/celestiaorg/go-square/blob" ) type sequence struct { diff --git a/pkg/shares/parse_sparse_shares_test.go b/shares/parse_sparse_shares_test.go similarity index 97% rename from pkg/shares/parse_sparse_shares_test.go rename to shares/parse_sparse_shares_test.go index 577d82c..d334723 100644 --- a/pkg/shares/parse_sparse_shares_test.go +++ b/shares/parse_sparse_shares_test.go @@ -7,8 +7,8 @@ import ( "math/rand" "testing" - "github.com/celestiaorg/go-square/pkg/blob" - ns "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/blob" + ns "github.com/celestiaorg/go-square/namespace" "github.com/celestiaorg/nmt/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/shares/parse_test.go b/shares/parse_test.go similarity index 99% rename from pkg/shares/parse_test.go rename to shares/parse_test.go index ee02b55..079611a 100644 --- a/pkg/shares/parse_test.go +++ b/shares/parse_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/powers_of_two.go b/shares/powers_of_two.go similarity index 100% rename from pkg/shares/powers_of_two.go rename to shares/powers_of_two.go diff --git a/pkg/shares/powers_of_two_test.go b/shares/powers_of_two_test.go similarity index 100% rename from pkg/shares/powers_of_two_test.go rename to shares/powers_of_two_test.go diff --git a/pkg/shares/range.go b/shares/range.go similarity index 100% rename from pkg/shares/range.go rename to shares/range.go diff --git a/pkg/shares/reserved_bytes.go b/shares/reserved_bytes.go similarity index 100% rename from pkg/shares/reserved_bytes.go rename to shares/reserved_bytes.go diff --git a/pkg/shares/reserved_bytes_test.go b/shares/reserved_bytes_test.go similarity index 100% rename from pkg/shares/reserved_bytes_test.go rename to shares/reserved_bytes_test.go diff --git a/pkg/shares/share_builder.go b/shares/share_builder.go similarity index 99% rename from pkg/shares/share_builder.go rename to shares/share_builder.go index ef6f1aa..eaaa4e9 100644 --- a/pkg/shares/share_builder.go +++ b/shares/share_builder.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "errors" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) type Builder struct { diff --git a/pkg/shares/share_builder_test.go b/shares/share_builder_test.go similarity index 99% rename from pkg/shares/share_builder_test.go rename to shares/share_builder_test.go index 94700bf..93e6bd6 100644 --- a/pkg/shares/share_builder_test.go +++ b/shares/share_builder_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/share_sequence.go b/shares/share_sequence.go similarity index 98% rename from pkg/shares/share_sequence.go rename to shares/share_sequence.go index 278c54f..c8a0c21 100644 --- a/pkg/shares/share_sequence.go +++ b/shares/share_sequence.go @@ -3,7 +3,7 @@ package shares import ( "fmt" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) // ShareSequence represents a contiguous sequence of shares that are part of the diff --git a/pkg/shares/share_sequence_test.go b/shares/share_sequence_test.go similarity index 99% rename from pkg/shares/share_sequence_test.go rename to shares/share_sequence_test.go index 0169b31..957f373 100644 --- a/pkg/shares/share_sequence_test.go +++ b/shares/share_sequence_test.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/share_splitting.go b/shares/share_splitting.go similarity index 96% rename from pkg/shares/share_splitting.go rename to shares/share_splitting.go index c123c8a..175f8ec 100644 --- a/pkg/shares/share_splitting.go +++ b/shares/share_splitting.go @@ -4,8 +4,8 @@ import ( "crypto/sha256" "errors" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" ) var ( diff --git a/pkg/shares/share_splitting_test.go b/shares/share_splitting_test.go similarity index 99% rename from pkg/shares/share_splitting_test.go rename to shares/share_splitting_test.go index 146261b..53aa4e1 100644 --- a/pkg/shares/share_splitting_test.go +++ b/shares/share_splitting_test.go @@ -6,8 +6,8 @@ import ( "reflect" "testing" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/shares.go b/shares/shares.go similarity index 99% rename from pkg/shares/shares.go rename to shares/shares.go index 5c026e8..3e31fc2 100644 --- a/pkg/shares/shares.go +++ b/shares/shares.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "fmt" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) // Share contains the raw share data (including namespace ID). diff --git a/pkg/shares/shares_test.go b/shares/shares_test.go similarity index 99% rename from pkg/shares/shares_test.go rename to shares/shares_test.go index fb671de..fde77d2 100644 --- a/pkg/shares/shares_test.go +++ b/shares/shares_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/sparse_shares_test.go b/shares/sparse_shares_test.go similarity index 98% rename from pkg/shares/sparse_shares_test.go rename to shares/sparse_shares_test.go index a29da67..7d22886 100644 --- a/pkg/shares/sparse_shares_test.go +++ b/shares/sparse_shares_test.go @@ -3,7 +3,7 @@ package shares import ( "testing" - "github.com/celestiaorg/go-square/pkg/blob" + "github.com/celestiaorg/go-square/blob" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/split_compact_shares.go b/shares/split_compact_shares.go similarity index 99% rename from pkg/shares/split_compact_shares.go rename to shares/split_compact_shares.go index 3ede39f..0c21be2 100644 --- a/pkg/shares/split_compact_shares.go +++ b/shares/split_compact_shares.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "fmt" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" ) // CompactShareSplitter will write raw data compactly across a progressively diff --git a/pkg/shares/split_compact_shares_test.go b/shares/split_compact_shares_test.go similarity index 99% rename from pkg/shares/split_compact_shares_test.go rename to shares/split_compact_shares_test.go index 3e1b12a..2284991 100644 --- a/pkg/shares/split_compact_shares_test.go +++ b/shares/split_compact_shares_test.go @@ -5,7 +5,7 @@ import ( "crypto/sha256" "testing" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/shares/split_sparse_shares.go b/shares/split_sparse_shares.go similarity index 98% rename from pkg/shares/split_sparse_shares.go rename to shares/split_sparse_shares.go index 0f59221..a84707a 100644 --- a/pkg/shares/split_sparse_shares.go +++ b/shares/split_sparse_shares.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/celestiaorg/go-square/pkg/blob" + "github.com/celestiaorg/go-square/blob" "golang.org/x/exp/slices" ) diff --git a/pkg/shares/split_sparse_shares_test.go b/shares/split_sparse_shares_test.go similarity index 94% rename from pkg/shares/split_sparse_shares_test.go rename to shares/split_sparse_shares_test.go index eaedf22..197adb6 100644 --- a/pkg/shares/split_sparse_shares_test.go +++ b/shares/split_sparse_shares_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" "github.com/stretchr/testify/assert" ) diff --git a/pkg/shares/utils.go b/shares/utils.go similarity index 100% rename from pkg/shares/utils.go rename to shares/utils.go diff --git a/pkg/shares/utils_test.go b/shares/utils_test.go similarity index 100% rename from pkg/shares/utils_test.go rename to shares/utils_test.go diff --git a/pkg/square/builder.go b/square/builder.go similarity index 98% rename from pkg/square/builder.go rename to square/builder.go index 8512e75..bd701e5 100644 --- a/pkg/square/builder.go +++ b/square/builder.go @@ -6,10 +6,10 @@ import ( "fmt" "sort" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/inclusion" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/inclusion" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "google.golang.org/protobuf/proto" ) diff --git a/pkg/square/builder_test.go b/square/builder_test.go similarity index 98% rename from pkg/square/builder_test.go rename to square/builder_test.go index e986f17..26a3e36 100644 --- a/pkg/square/builder_test.go +++ b/square/builder_test.go @@ -6,11 +6,11 @@ import ( "math/rand" "testing" + "github.com/celestiaorg/go-square/blob" "github.com/celestiaorg/go-square/internal/test" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" - "github.com/celestiaorg/go-square/pkg/square" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" + "github.com/celestiaorg/go-square/square" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/square/square.go b/square/square.go similarity index 98% rename from pkg/square/square.go rename to square/square.go index 89727ea..376853c 100644 --- a/pkg/square/square.go +++ b/square/square.go @@ -5,9 +5,9 @@ import ( "fmt" "math" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/namespace" - "github.com/celestiaorg/go-square/pkg/shares" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" ) // Build takes an arbitrary long list of (prioritized) transactions and builds a square that is never diff --git a/pkg/square/square_benchmark_test.go b/square/square_benchmark_test.go similarity index 96% rename from pkg/square/square_benchmark_test.go rename to square/square_benchmark_test.go index 0545d9d..55fe41e 100644 --- a/pkg/square/square_benchmark_test.go +++ b/square/square_benchmark_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/celestiaorg/go-square/pkg/square" + "github.com/celestiaorg/go-square/square" "github.com/stretchr/testify/require" ) diff --git a/pkg/square/square_test.go b/square/square_test.go similarity index 97% rename from pkg/square/square_test.go rename to square/square_test.go index c328609..50d596e 100644 --- a/pkg/square/square_test.go +++ b/square/square_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" + "github.com/celestiaorg/go-square/blob" "github.com/celestiaorg/go-square/internal/test" - "github.com/celestiaorg/go-square/pkg/blob" - "github.com/celestiaorg/go-square/pkg/shares" - "github.com/celestiaorg/go-square/pkg/square" + "github.com/celestiaorg/go-square/shares" + "github.com/celestiaorg/go-square/square" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" )