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

[Soroban] Storage example documentation inconsistecy #1176

Open
lijamie98 opened this issue Jan 13, 2025 · 1 comment
Open

[Soroban] Storage example documentation inconsistecy #1176

lijamie98 opened this issue Jan 13, 2025 · 1 comment
Assignees
Labels
bug Something isn't working dev-rel

Comments

@lijamie98
Copy link
Contributor

What version are you using?

Stellar CLI 22.1.0

What did you do?

In this page: https://developers.stellar.org/docs/build/smart-contracts/getting-started/storing-data

The stellar contract init ./ --with-example increment is no longer available.

error: invalid value 'increment' for '--with-example <WITH_EXAMPLE>': This argument has been removed and will be not be recognized by the future versions of CLI: Adding examples via cli is no longer supported. You can still clone examples from the repo https://github.com/stellar/soroban-examples

For more information, try '--help'.

The documents code: env.storage().instance().extend_ttl(100, 100); is inconsistent with the example.

// The contract instance will be bumped to have a lifetime of at least 100 ledgers if the current expiration lifetime at most 50.
// If the lifetime is already more than 100 ledgers, this is a no-op. Otherwise,
// the lifetime is extended to 100 ledgers. This lifetime bump includes the contract
// instance itself and all entries in storage().instance(), i.e, COUNTER.
env.storage().instance().extend_ttl(50, 100);

What did you expect to see?

Consistency

What did you see instead?

Inconsistency

@lijamie98 lijamie98 added the bug Something isn't working label Jan 13, 2025
@github-project-automation github-project-automation bot moved this to Ideas in Dev Docs Jan 13, 2025
@briwylde08 briwylde08 moved this to To Do in Dev Docs Jan 21, 2025
@ElliotFriend
Copy link
Contributor

  1. We should remove all instances of --with-example from the stellar contract init ... command examples/snippets. I don't know for sure how frequent the occurrences are, or where they are, we should search through the /docs folder to look for any to fix.
  2. The contract's code is here: https://github.com/stellar/soroban-examples/blob/main/increment/src/lib.rs. imo, we don't necessarily need to copy the whole contents of the file (specifically the long comment above the extend ttl function), but we should make sure the actual code (the arguments to the extend ttl function) reflect what's in the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev-rel
Projects
Status: To Do
Development

No branches or pull requests

4 participants