Skip to content

Commit

Permalink
feat: structure as cargo workspace
Browse files Browse the repository at this point in the history
Fixes stellar#328

Undoes stellar#232

Forked from stellar#330

Add top-level `Cargo.toml`, with all project folders as part of this
workspace.

We now encourage everyone to use Cargo workspaces when
building Soroban projects. Let's make it easy to copy-paste these
examples into their projects, rather than requiring special tooling
(like the old `stellar contract init` behavior) to update the contract's
Cargo.toml.

Currently, there are two compilation errors when attempting to run
tests:

```
error[E0433]: failed to resolve: use of undeclared crate or module `__get_allowance`
  --> token/src/contract.rs:67:12
   |
67 |     pub fn get_allowance(e: Env, from: Address, spender: Address) -> Option<AllowanceValue> {
   |            ^^^^^^^^^^^^^ use of undeclared crate or module `__get_allowance`
   |
help: there is a crate or module with a similar name
   |
67 |     pub fn __allowance(e: Env, from: Address, spender: Address) -> Option<AllowanceValue> {
   |            ~~~~~~~~~~~

error[E0223]: ambiguous associated type
  --> bls_signature/src/lib.rs:78:18
   |
78 |         agg_sig: Self::Signature,
   |                  ^^^^^^^^^^^^^^^ help: use fully-qualified syntax: `<IncrementContractArgs as soroban_sdk::testutils::ed25519::Sign>::Signature`
```
  • Loading branch information
chadoh committed Nov 27, 2024
1 parent 1d31580 commit 6735a95
Show file tree
Hide file tree
Showing 78 changed files with 847 additions and 37,163 deletions.
657 changes: 507 additions & 150 deletions eth_abi/Cargo.lock → Cargo.lock

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[workspace]
resolver = "2"
members = [
"./*",
]
exclude = [
".git",
".github",
".vscode",
"cross_contract",
"deployer",
"target",
"test",
"upgradeable_contract",
"webauthn",
"workspace",
]

[workspace.dependencies]
soroban-sdk = "22.0.0-rc.3.2"
soroban-token-sdk = "22.0.0-rc.3.2"

[profile.release]
opt-level = "z"
overflow-checks = true
debug = 0
strip = "symbols"
debug-assertions = false
panic = "abort"
codegen-units = 1
lto = true

# For more information about this profile see https://soroban.stellar.org/docs/basic-tutorials/logging#cargotoml-profile
[profile.release-with-logs]
inherits = "release"
debug-assertions = true
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ to have significant errors and security vulnerabilities. They should not be
relied on for any purpose.

Join us In the [Stellar Developers Discord server](https://discord.gg/stellardev)

# Build & Run Tests

- `soroban contract build` to generate all `.wasm` files, which are needed for cross-contract dependencies
- `cargo test`
Loading

0 comments on commit 6735a95

Please sign in to comment.