-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: sc-platform/transactional-tests-syntax
Are you sure you want to change the base?
refactor(iota-transactional-test-runner): document run-graphql
syntax
#4699
Conversation
There was a problem hiding this 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.
Deployment failed with the following error:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
There was a problem hiding this 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...`). |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored with fe77000
Description of change
Documents the
run-graphql
syntax of theiota-transactional-test-runner
framework.Links to any relevant issues
Fixes #4201
Type of change