diff --git a/cairo-contracts/Scarb.lock b/cairo-contracts/Scarb.lock index d1271595..9f69014a 100644 --- a/cairo-contracts/Scarb.lock +++ b/cairo-contracts/Scarb.lock @@ -1,14 +1,6 @@ # Code generated by scarb DO NOT EDIT. version = 1 -[[package]] -name = "cometbft" -version = "0.1.0" -dependencies = [ - "protobuf", - "snforge_std", -] - [[package]] name = "openzeppelin_access" version = "0.16.0" @@ -64,13 +56,6 @@ name = "openzeppelin_utils" version = "0.16.0" source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.16.0#ba00ce76a93dcf25c081ab2698da20690b5a1cfb" -[[package]] -name = "protobuf" -version = "0.1.0" -dependencies = [ - "snforge_std", -] - [[package]] name = "snforge_std" version = "0.27.0" diff --git a/cairo-contracts/Scarb.toml b/cairo-contracts/Scarb.toml index b7b871f7..92fced83 100644 --- a/cairo-contracts/Scarb.toml +++ b/cairo-contracts/Scarb.toml @@ -5,9 +5,6 @@ members = [ "packages/contracts", "packages/core", "packages/utils", - "cairo-libs/protobuf", - "cairo-libs/cometbft", - "cometbft", ] [workspace.package] diff --git a/cairo-libs/README.md b/cairo-libs/README.md new file mode 100644 index 00000000..166387f3 --- /dev/null +++ b/cairo-libs/README.md @@ -0,0 +1,9 @@ +
+

Cairo Libraries

+
+ +This directory contains the Cairo libraries that are used by the Starknet +contracts in the `cairo-contracts`. + +- Protobuf decoding and encoding +- CometBFT light client types diff --git a/cairo-libs/Scarb.lock b/cairo-libs/Scarb.lock new file mode 100644 index 00000000..0d39e87e --- /dev/null +++ b/cairo-libs/Scarb.lock @@ -0,0 +1,22 @@ +# Code generated by scarb DO NOT EDIT. +version = 1 + +[[package]] +name = "cometbft" +version = "0.1.0" +dependencies = [ + "protobuf", + "snforge_std", +] + +[[package]] +name = "protobuf" +version = "0.1.0" +dependencies = [ + "snforge_std", +] + +[[package]] +name = "snforge_std" +version = "0.27.0" +source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de" diff --git a/cairo-libs/Scarb.toml b/cairo-libs/Scarb.toml new file mode 100644 index 00000000..dca2afbe --- /dev/null +++ b/cairo-libs/Scarb.toml @@ -0,0 +1,29 @@ +[workspace] +members = [ + "packages/protobuf", + "packages/cometbft", +] + +[workspace.package] +version = "0.1.0" +edition = "2023_11" +cairo-version = "2.8.0" +scarb-version = "2.8.0" +license = "Apache-2.0" +authors = [ "Informal Systems " ] +repository = "https://github.com/informalsystems/ibc-starknet" +Readme = "README.md" +keywords = [ "protobuf", "cometbft", "ibc" ] +description = "Collection of Cairo libraries for IBC integration with Starknet" + +[workspace.scripts] +test = "snforge test" + +[workspace.dependencies] +# external dependencies +cairo_test = "2.8.0" +starknet = "2.8.0" +snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" } + +[workspace.tool.fmt] +sort-module-level-items = true diff --git a/cairo-contracts/cairo-libs/cometbft/Scarb.toml b/cairo-libs/packages/cometbft/Scarb.toml similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/Scarb.toml rename to cairo-libs/packages/cometbft/Scarb.toml diff --git a/cairo-contracts/cairo-libs/cometbft/src/ibc.cairo b/cairo-libs/packages/cometbft/src/ibc.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/ibc.cairo rename to cairo-libs/packages/cometbft/src/ibc.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/ics23.cairo b/cairo-libs/packages/cometbft/src/ics23.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/ics23.cairo rename to cairo-libs/packages/cometbft/src/ics23.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/lib.cairo b/cairo-libs/packages/cometbft/src/lib.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/lib.cairo rename to cairo-libs/packages/cometbft/src/lib.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/light_client.cairo b/cairo-libs/packages/cometbft/src/light_client.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/light_client.cairo rename to cairo-libs/packages/cometbft/src/light_client.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/tests.cairo b/cairo-libs/packages/cometbft/src/tests.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/tests.cairo rename to cairo-libs/packages/cometbft/src/tests.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/types.cairo b/cairo-libs/packages/cometbft/src/types.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/types.cairo rename to cairo-libs/packages/cometbft/src/types.cairo diff --git a/cairo-contracts/cairo-libs/cometbft/src/utils.cairo b/cairo-libs/packages/cometbft/src/utils.cairo similarity index 100% rename from cairo-contracts/cairo-libs/cometbft/src/utils.cairo rename to cairo-libs/packages/cometbft/src/utils.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/Scarb.toml b/cairo-libs/packages/protobuf/Scarb.toml similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/Scarb.toml rename to cairo-libs/packages/protobuf/Scarb.toml diff --git a/cairo-contracts/cairo-libs/protobuf/src/base64.cairo b/cairo-libs/packages/protobuf/src/base64.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/base64.cairo rename to cairo-libs/packages/protobuf/src/base64.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/hex.cairo b/cairo-libs/packages/protobuf/src/hex.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/hex.cairo rename to cairo-libs/packages/protobuf/src/hex.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/lib.cairo b/cairo-libs/packages/protobuf/src/lib.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/lib.cairo rename to cairo-libs/packages/protobuf/src/lib.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/primitives.cairo b/cairo-libs/packages/protobuf/src/primitives.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/primitives.cairo rename to cairo-libs/packages/protobuf/src/primitives.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/primitives/array.cairo b/cairo-libs/packages/protobuf/src/primitives/array.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/primitives/array.cairo rename to cairo-libs/packages/protobuf/src/primitives/array.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/primitives/numeric.cairo b/cairo-libs/packages/protobuf/src/primitives/numeric.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/primitives/numeric.cairo rename to cairo-libs/packages/protobuf/src/primitives/numeric.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/primitives/utils.cairo b/cairo-libs/packages/protobuf/src/primitives/utils.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/primitives/utils.cairo rename to cairo-libs/packages/protobuf/src/primitives/utils.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/tests.cairo b/cairo-libs/packages/protobuf/src/tests.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/tests.cairo rename to cairo-libs/packages/protobuf/src/tests.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/types.cairo b/cairo-libs/packages/protobuf/src/types.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/types.cairo rename to cairo-libs/packages/protobuf/src/types.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/types/message.cairo b/cairo-libs/packages/protobuf/src/types/message.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/types/message.cairo rename to cairo-libs/packages/protobuf/src/types/message.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/types/tag.cairo b/cairo-libs/packages/protobuf/src/types/tag.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/types/tag.cairo rename to cairo-libs/packages/protobuf/src/types/tag.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/types/wkt.cairo b/cairo-libs/packages/protobuf/src/types/wkt.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/types/wkt.cairo rename to cairo-libs/packages/protobuf/src/types/wkt.cairo diff --git a/cairo-contracts/cairo-libs/protobuf/src/utils.cairo b/cairo-libs/packages/protobuf/src/utils.cairo similarity index 100% rename from cairo-contracts/cairo-libs/protobuf/src/utils.cairo rename to cairo-libs/packages/protobuf/src/utils.cairo