Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the examples for protocol 22 support. #330

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

dmkozh
Copy link
Contributor

@dmkozh dmkozh commented Oct 9, 2024

What

Update the examples for protocol 22 support.

Most of the updates involve using constructors and the new test API. I've also addressed a couple small issues in some examples.

Why

Keeping the examples up to date

Known limitations

This shouldn't be merged until protocol 22 has been voted on in pubnet.

@dmkozh dmkozh marked this pull request as draft October 9, 2024 22:08
@dmkozh dmkozh force-pushed the p22_fixes branch 7 times, most recently from 5b2d970 to be39170 Compare October 10, 2024 18:00
Most of the updates involve using constructors and the new test API. I've also addressed a couple small issues in some examples.
@leighmcculloch
Copy link
Member

I'm going to merge #327 first, before this PR merges as it addresses a few issues for existing v21 examples, then let's rebase this PR and target a merge.

@dmkozh
Copy link
Contributor Author

dmkozh commented Oct 14, 2024

I'm going to merge #327 first, before this PR merges

Sure, this PR shouldn't be merged until 22 is live anyway.

chadoh added a commit to AhaLabs/soroban-examples that referenced this pull request Nov 27, 2024
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`
```
chadoh added a commit to AhaLabs/soroban-examples that referenced this pull request Nov 27, 2024
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> {
   |            ~~~~~~~~~~~
```
@sisuresh sisuresh marked this pull request as ready for review December 5, 2024 23:18
@sisuresh sisuresh enabled auto-merge (squash) December 5, 2024 23:55
@sisuresh sisuresh merged commit f06163d into stellar:main Dec 6, 2024
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants