From 509d0b1bbdc211cc7ca8493a3ca7a19a38f2462f Mon Sep 17 00:00:00 2001 From: Manav Aggarwal Date: Mon, 31 Jul 2023 16:41:32 -0400 Subject: [PATCH] Move libs to libs/celestia-app (#1118) ## Overview Closes: #1119 ## Checklist - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords --- libs/{ => celestia-app}/appconsts/appconsts.go | 0 libs/{ => celestia-app}/appconsts/consensus_consts.go | 0 libs/{ => celestia-app}/namespace/consts.go | 2 +- libs/{ => celestia-app}/namespace/namespace.go | 0 libs/{ => celestia-app}/namespace/namespace_test.go | 0 libs/{ => celestia-app}/namespace/random_blob.go | 0 libs/{ => celestia-app}/namespace/random_namespace.go | 0 libs/{ => celestia-app}/shares/compact_shares_test.go | 6 +++--- libs/{ => celestia-app}/shares/doc.go | 0 libs/{ => celestia-app}/shares/info_byte.go | 2 +- libs/{ => celestia-app}/shares/info_byte_test.go | 0 libs/{ => celestia-app}/shares/parse_compact_shares.go | 0 libs/{ => celestia-app}/shares/reserved_bytes.go | 2 +- libs/{ => celestia-app}/shares/reserved_bytes_test.go | 0 libs/{ => celestia-app}/shares/share_builder.go | 4 ++-- libs/{ => celestia-app}/shares/share_builder_test.go | 4 ++-- libs/{ => celestia-app}/shares/share_sequence.go | 4 ++-- libs/{ => celestia-app}/shares/share_sequence_test.go | 4 ++-- libs/{ => celestia-app}/shares/shares.go | 4 ++-- libs/{ => celestia-app}/shares/shares_test.go | 4 ++-- libs/{ => celestia-app}/shares/split_compact_shares.go | 4 ++-- libs/{ => celestia-app}/shares/split_compact_shares_test.go | 4 ++-- libs/{ => celestia-app}/shares/testdata/sample-block.json | 0 libs/{ => celestia-app}/shares/utils.go | 0 libs/{ => celestia-app}/shares/utils_test.go | 2 +- libs/{ => celestia-app}/testfactory/txs.go | 0 26 files changed, 23 insertions(+), 23 deletions(-) rename libs/{ => celestia-app}/appconsts/appconsts.go (100%) rename libs/{ => celestia-app}/appconsts/consensus_consts.go (100%) rename libs/{ => celestia-app}/namespace/consts.go (97%) rename libs/{ => celestia-app}/namespace/namespace.go (100%) rename libs/{ => celestia-app}/namespace/namespace_test.go (100%) rename libs/{ => celestia-app}/namespace/random_blob.go (100%) rename libs/{ => celestia-app}/namespace/random_namespace.go (100%) rename libs/{ => celestia-app}/shares/compact_shares_test.go (97%) rename libs/{ => celestia-app}/shares/doc.go (100%) rename libs/{ => celestia-app}/shares/info_byte.go (95%) rename libs/{ => celestia-app}/shares/info_byte_test.go (100%) rename libs/{ => celestia-app}/shares/parse_compact_shares.go (100%) rename libs/{ => celestia-app}/shares/reserved_bytes.go (95%) rename libs/{ => celestia-app}/shares/reserved_bytes_test.go (100%) rename libs/{ => celestia-app}/shares/share_builder.go (98%) rename libs/{ => celestia-app}/shares/share_builder_test.go (98%) rename libs/{ => celestia-app}/shares/share_sequence.go (94%) rename libs/{ => celestia-app}/shares/share_sequence_test.go (96%) rename libs/{ => celestia-app}/shares/shares.go (97%) rename libs/{ => celestia-app}/shares/shares_test.go (98%) rename libs/{ => celestia-app}/shares/split_compact_shares.go (98%) rename libs/{ => celestia-app}/shares/split_compact_shares_test.go (98%) rename libs/{ => celestia-app}/shares/testdata/sample-block.json (100%) rename libs/{ => celestia-app}/shares/utils.go (100%) rename libs/{ => celestia-app}/shares/utils_test.go (96%) rename libs/{ => celestia-app}/testfactory/txs.go (100%) diff --git a/libs/appconsts/appconsts.go b/libs/celestia-app/appconsts/appconsts.go similarity index 100% rename from libs/appconsts/appconsts.go rename to libs/celestia-app/appconsts/appconsts.go diff --git a/libs/appconsts/consensus_consts.go b/libs/celestia-app/appconsts/consensus_consts.go similarity index 100% rename from libs/appconsts/consensus_consts.go rename to libs/celestia-app/appconsts/consensus_consts.go diff --git a/libs/namespace/consts.go b/libs/celestia-app/namespace/consts.go similarity index 97% rename from libs/namespace/consts.go rename to libs/celestia-app/namespace/consts.go index c8b320238ac..51795f0f193 100644 --- a/libs/namespace/consts.go +++ b/libs/celestia-app/namespace/consts.go @@ -4,7 +4,7 @@ import ( "bytes" "math" - "github.com/rollkit/rollkit/libs/appconsts" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" ) const ( diff --git a/libs/namespace/namespace.go b/libs/celestia-app/namespace/namespace.go similarity index 100% rename from libs/namespace/namespace.go rename to libs/celestia-app/namespace/namespace.go diff --git a/libs/namespace/namespace_test.go b/libs/celestia-app/namespace/namespace_test.go similarity index 100% rename from libs/namespace/namespace_test.go rename to libs/celestia-app/namespace/namespace_test.go diff --git a/libs/namespace/random_blob.go b/libs/celestia-app/namespace/random_blob.go similarity index 100% rename from libs/namespace/random_blob.go rename to libs/celestia-app/namespace/random_blob.go diff --git a/libs/namespace/random_namespace.go b/libs/celestia-app/namespace/random_namespace.go similarity index 100% rename from libs/namespace/random_namespace.go rename to libs/celestia-app/namespace/random_namespace.go diff --git a/libs/shares/compact_shares_test.go b/libs/celestia-app/shares/compact_shares_test.go similarity index 97% rename from libs/shares/compact_shares_test.go rename to libs/celestia-app/shares/compact_shares_test.go index 4535d35cbae..599b6f042d7 100644 --- a/libs/shares/compact_shares_test.go +++ b/libs/celestia-app/shares/compact_shares_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" - "github.com/rollkit/rollkit/libs/testfactory" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/testfactory" ) func SplitTxs(txs coretypes.Txs) (txShares []Share, err error) { diff --git a/libs/shares/doc.go b/libs/celestia-app/shares/doc.go similarity index 100% rename from libs/shares/doc.go rename to libs/celestia-app/shares/doc.go diff --git a/libs/shares/info_byte.go b/libs/celestia-app/shares/info_byte.go similarity index 95% rename from libs/shares/info_byte.go rename to libs/celestia-app/shares/info_byte.go index a57e295b7cb..ae954e7b029 100644 --- a/libs/shares/info_byte.go +++ b/libs/celestia-app/shares/info_byte.go @@ -3,7 +3,7 @@ package shares import ( "fmt" - "github.com/rollkit/rollkit/libs/appconsts" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" ) // InfoByte is a byte with the following structure: the first 7 bits are diff --git a/libs/shares/info_byte_test.go b/libs/celestia-app/shares/info_byte_test.go similarity index 100% rename from libs/shares/info_byte_test.go rename to libs/celestia-app/shares/info_byte_test.go diff --git a/libs/shares/parse_compact_shares.go b/libs/celestia-app/shares/parse_compact_shares.go similarity index 100% rename from libs/shares/parse_compact_shares.go rename to libs/celestia-app/shares/parse_compact_shares.go diff --git a/libs/shares/reserved_bytes.go b/libs/celestia-app/shares/reserved_bytes.go similarity index 95% rename from libs/shares/reserved_bytes.go rename to libs/celestia-app/shares/reserved_bytes.go index f5b1b0efd11..51a296b526d 100644 --- a/libs/shares/reserved_bytes.go +++ b/libs/celestia-app/shares/reserved_bytes.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "fmt" - "github.com/rollkit/rollkit/libs/appconsts" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" ) // NewReservedBytes returns a byte slice of length diff --git a/libs/shares/reserved_bytes_test.go b/libs/celestia-app/shares/reserved_bytes_test.go similarity index 100% rename from libs/shares/reserved_bytes_test.go rename to libs/celestia-app/shares/reserved_bytes_test.go diff --git a/libs/shares/share_builder.go b/libs/celestia-app/shares/share_builder.go similarity index 98% rename from libs/shares/share_builder.go rename to libs/celestia-app/shares/share_builder.go index 02affdffead..bfa9eeb92a8 100644 --- a/libs/shares/share_builder.go +++ b/libs/celestia-app/shares/share_builder.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "errors" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) type Builder struct { diff --git a/libs/shares/share_builder_test.go b/libs/celestia-app/shares/share_builder_test.go similarity index 98% rename from libs/shares/share_builder_test.go rename to libs/celestia-app/shares/share_builder_test.go index 6187637bdf7..9a0c1292268 100644 --- a/libs/shares/share_builder_test.go +++ b/libs/celestia-app/shares/share_builder_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) func TestShareBuilderIsEmptyShare(t *testing.T) { diff --git a/libs/shares/share_sequence.go b/libs/celestia-app/shares/share_sequence.go similarity index 94% rename from libs/shares/share_sequence.go rename to libs/celestia-app/shares/share_sequence.go index cb9ac2e5009..a79136f8227 100644 --- a/libs/shares/share_sequence.go +++ b/libs/celestia-app/shares/share_sequence.go @@ -3,8 +3,8 @@ package shares import ( "fmt" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) // ShareSequence represents a contiguous sequence of shares that are part of the diff --git a/libs/shares/share_sequence_test.go b/libs/celestia-app/shares/share_sequence_test.go similarity index 96% rename from libs/shares/share_sequence_test.go rename to libs/celestia-app/shares/share_sequence_test.go index 869433f2892..7cb41d876c0 100644 --- a/libs/shares/share_sequence_test.go +++ b/libs/celestia-app/shares/share_sequence_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) func TestShareSequenceRawData(t *testing.T) { diff --git a/libs/shares/shares.go b/libs/celestia-app/shares/shares.go similarity index 97% rename from libs/shares/shares.go rename to libs/celestia-app/shares/shares.go index a8eccc067ae..7fd0f7053ad 100644 --- a/libs/shares/shares.go +++ b/libs/celestia-app/shares/shares.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "fmt" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) // Share contains the raw share data (including namespace ID). diff --git a/libs/shares/shares_test.go b/libs/celestia-app/shares/shares_test.go similarity index 98% rename from libs/shares/shares_test.go rename to libs/celestia-app/shares/shares_test.go index 21651208566..c6a00912a27 100644 --- a/libs/shares/shares_test.go +++ b/libs/celestia-app/shares/shares_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) // // TestPadFirstIndexedBlob ensures that we are adding padding to the first share diff --git a/libs/shares/split_compact_shares.go b/libs/celestia-app/shares/split_compact_shares.go similarity index 98% rename from libs/shares/split_compact_shares.go rename to libs/celestia-app/shares/split_compact_shares.go index 462511ee120..fb989db3729 100644 --- a/libs/shares/split_compact_shares.go +++ b/libs/celestia-app/shares/split_compact_shares.go @@ -6,8 +6,8 @@ import ( coretypes "github.com/cometbft/cometbft/types" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) type ShareRange struct { diff --git a/libs/shares/split_compact_shares_test.go b/libs/celestia-app/shares/split_compact_shares_test.go similarity index 98% rename from libs/shares/split_compact_shares_test.go rename to libs/celestia-app/shares/split_compact_shares_test.go index dd29f9724ad..c613dba008c 100644 --- a/libs/shares/split_compact_shares_test.go +++ b/libs/celestia-app/shares/split_compact_shares_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/appconsts" - appns "github.com/rollkit/rollkit/libs/namespace" + "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" ) // fillShare returns a share filled with filler so that the share length diff --git a/libs/shares/testdata/sample-block.json b/libs/celestia-app/shares/testdata/sample-block.json similarity index 100% rename from libs/shares/testdata/sample-block.json rename to libs/celestia-app/shares/testdata/sample-block.json diff --git a/libs/shares/utils.go b/libs/celestia-app/shares/utils.go similarity index 100% rename from libs/shares/utils.go rename to libs/celestia-app/shares/utils.go diff --git a/libs/shares/utils_test.go b/libs/celestia-app/shares/utils_test.go similarity index 96% rename from libs/shares/utils_test.go rename to libs/celestia-app/shares/utils_test.go index 09eb2a113bc..576a66ce84e 100644 --- a/libs/shares/utils_test.go +++ b/libs/celestia-app/shares/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/testfactory" + "github.com/rollkit/rollkit/libs/celestia-app/testfactory" ) // func FuzzBlobSharesUsed(f *testing.F) { diff --git a/libs/testfactory/txs.go b/libs/celestia-app/testfactory/txs.go similarity index 100% rename from libs/testfactory/txs.go rename to libs/celestia-app/testfactory/txs.go