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 61% rename from pkg/blob/blob.pb.go rename to blob/blob.pb.go index f3c53fe..34b8551 100644 --- a/pkg/blob/blob.pb.go +++ b/blob/blob.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.32.0 // protoc (unknown) -// source: pkg/blob/blob.proto +// source: blob/blob.proto package blob @@ -38,7 +38,7 @@ type Blob struct { func (x *Blob) Reset() { *x = Blob{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_blob_blob_proto_msgTypes[0] + mi := &file_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_pkg_blob_blob_proto_msgTypes[0] + mi := &file_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_pkg_blob_blob_proto_rawDescGZIP(), []int{0} + return file_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_pkg_blob_blob_proto_msgTypes[1] + mi := &file_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_pkg_blob_blob_proto_msgTypes[1] + mi := &file_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_pkg_blob_blob_proto_rawDescGZIP(), []int{1} + return file_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_pkg_blob_blob_proto_msgTypes[2] + mi := &file_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_pkg_blob_blob_proto_msgTypes[2] + mi := &file_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_pkg_blob_blob_proto_rawDescGZIP(), []int{2} + return file_blob_blob_proto_rawDescGZIP(), []int{2} } func (x *IndexWrapper) GetTx() []byte { @@ -226,56 +226,56 @@ func (x *IndexWrapper) GetTypeId() string { return "" } -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, 0x08, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 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, 0x57, 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, 0x24, 0x0a, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x62, 0x6c, 0x6f, 0x62, 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_blob_blob_proto protoreflect.FileDescriptor + +var file_blob_blob_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x08, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 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, 0x57, 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, 0x24, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 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, 0x27, 0x5a, 0x25, 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, 0x62, 0x6c, 0x6f, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_pkg_blob_blob_proto_rawDescOnce sync.Once - file_pkg_blob_blob_proto_rawDescData = file_pkg_blob_blob_proto_rawDesc + file_blob_blob_proto_rawDescOnce sync.Once + file_blob_blob_proto_rawDescData = file_blob_blob_proto_rawDesc ) -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) +func file_blob_blob_proto_rawDescGZIP() []byte { + file_blob_blob_proto_rawDescOnce.Do(func() { + file_blob_blob_proto_rawDescData = protoimpl.X.CompressGZIP(file_blob_blob_proto_rawDescData) }) - return file_pkg_blob_blob_proto_rawDescData + return file_blob_blob_proto_rawDescData } -var file_pkg_blob_blob_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_pkg_blob_blob_proto_goTypes = []interface{}{ +var file_blob_blob_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_blob_blob_proto_goTypes = []interface{}{ (*Blob)(nil), // 0: pkg.blob.Blob (*BlobTx)(nil), // 1: pkg.blob.BlobTx (*IndexWrapper)(nil), // 2: pkg.blob.IndexWrapper } -var file_pkg_blob_blob_proto_depIdxs = []int32{ +var file_blob_blob_proto_depIdxs = []int32{ 0, // 0: pkg.blob.BlobTx.blobs:type_name -> pkg.blob.Blob 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type @@ -284,13 +284,13 @@ var file_pkg_blob_blob_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_pkg_blob_blob_proto_init() } -func file_pkg_blob_blob_proto_init() { - if File_pkg_blob_blob_proto != nil { +func init() { file_blob_blob_proto_init() } +func file_blob_blob_proto_init() { + if File_blob_blob_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_pkg_blob_blob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_blob_blob_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Blob); i { case 0: return &v.state @@ -302,7 +302,7 @@ func file_pkg_blob_blob_proto_init() { return nil } } - file_pkg_blob_blob_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_blob_blob_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlobTx); i { case 0: return &v.state @@ -314,7 +314,7 @@ func file_pkg_blob_blob_proto_init() { return nil } } - file_pkg_blob_blob_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_blob_blob_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IndexWrapper); i { case 0: return &v.state @@ -331,18 +331,18 @@ func file_pkg_blob_blob_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pkg_blob_blob_proto_rawDesc, + RawDescriptor: file_blob_blob_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_pkg_blob_blob_proto_goTypes, - DependencyIndexes: file_pkg_blob_blob_proto_depIdxs, - MessageInfos: file_pkg_blob_blob_proto_msgTypes, + GoTypes: file_blob_blob_proto_goTypes, + DependencyIndexes: file_blob_blob_proto_depIdxs, + MessageInfos: file_blob_blob_proto_msgTypes, }.Build() - 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 + File_blob_blob_proto = out.File + file_blob_blob_proto_rawDesc = nil + file_blob_blob_proto_goTypes = nil + file_blob_blob_proto_depIdxs = nil } 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" )