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

refactor(iota-transactional-test-runner): document run-graphql syntax #4699

Open
wants to merge 11 commits into
base: sc-platform/transactional-tests-syntax
Choose a base branch
from

Conversation

samuel-rufi
Copy link
Member

@samuel-rufi samuel-rufi commented Jan 7, 2025

Description of change

Documents the run-graphql syntax of the iota-transactional-test-runner framework.

Links to any relevant issues

Fixes #4201

Type of change

  • Documentation

@samuel-rufi samuel-rufi self-assigned this Jan 7, 2025
@samuel-rufi samuel-rufi requested review from a team as code owners January 7, 2025 10:38
@samuel-rufi samuel-rufi marked this pull request as draft January 7, 2025 10:38
@iota-ci iota-ci added infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group. labels Jan 7, 2025
@samuel-rufi samuel-rufi changed the base branch from develop to sc-platform/transactional-tests-syntax January 7, 2025 10:39
@samuel-rufi samuel-rufi marked this pull request as ready for review January 13, 2025 15:49
Copy link
Contributor

@tomxey tomxey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked some questions. I think I'm lacking some general informations about how this works.

Copy link

vercel bot commented Jan 14, 2025

Deployment failed with the following error:

Preview deployments are disabled for this project.

Copy link

vercel bot commented Jan 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:42pm
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:42pm
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:42pm
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview Jan 15, 2025 10:42pm

@samuel-rufi samuel-rufi requested a review from tomxey January 15, 2025 15:34
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with a minor refinement suggestion.


1. **Object Placeholders**
- **Syntax**: `@{obj_x_y}` or `@{obj_x_y_opt}`
- Here, `(x, y)` corresponds to the transaction index and the creation index of the object within that transaction. The placeholder will be replaced with the object ID as a string (like `0xABCD...`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the transaction index? I know it captures the order of creation within the test, but I don't recall if it is sequence number of the command that included the transaction (e.g. init) or the absolute sequence number of the transaction. Could elaborate/disambiguate?

Copy link
Member Author

@samuel-rufi samuel-rufi Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it's the task index, therefore it does not necessarily align with the absolute sequence number of the transaction. When the IotaTestAdapter gets initialized, we set the next_fake to (0,0).
For each objectID we create in the same task, we use the very same task index:

    fn enumerate_fake(&mut self, id: ObjectID) -> FakeID {
        if let Some(fake) = self.object_enumeration.get_by_left(&id) {
            return *fake;
        }
        let (task, i) = self.next_fake;
        let fake_id = FakeID::Enumerated(task, i);
        self.object_enumeration.insert(id, fake_id);

        self.next_fake = (task, i + 1);
        fake_id
    }

the next_fake is only ever increased when we switch to the next task:

    fn next_task(&mut self) {
        self.next_fake = (self.next_fake.0 + 1, 0)
    }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored with fe77000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document RunGraphql subcommand.
5 participants