Skip to content

Commit 1025075

Browse files
authored
Merge pull request #97 from movementlabsxyz/l-monninger/cleanup-type-uses
chore: cleanup type uses
2 parents 931508c + 1002a31 commit 1025075

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Checks that both `movement` and `movement-aptos` balances for the native token a
240240

241241
## Organization
242242

243-
There are five subdirectories which progressively build on one another for node logic.
243+
There are three subdirectories which progressively build on one another for node logic.
244244

245245
1. [`util`](./util): contains utility logic mainly reused in [`migration`](./migration).
246246
2. [`migration`](./migration): contains the implementation of the migration.

checks/README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
# Checks
22

3-
- [`e2e`](./e2e/README.md) covers logic for end-to-end validation of the migration.
4-
- [`e2e`](./executor/README.md) covers logic for validating the
3+
1. [`migrator`](./migration/README.md) covers logic for end-to-end validation of the migration.
4+
2. [`node`](./node/README.md) covers logic for validating the executor-only portions of the migration.
55

6-
All tests rely on clearly stated criteria APIs which are pulled up under a `Criterion` type. Before evaluating each `Criterion` a `Scenario` is run. Hence tests are formed:
6+
All tests rely on clearly stated criteria APIs which are pulled up under a `Criterion` type. Before evaluating each `Criterion` a `Prelude` is run. Hence tests are formed:
77

88
```rust
9-
test(
10-
Scenario,
11-
[
12-
CriterionA,
13-
CriterionB,
14-
CriterionC
15-
]
16-
)
9+
checked_migration(&mut movement_migrator, &prelude, &migration, vec![criterion_a, criterion_b, criterion_c])
10+
.await?;
1711
```
1812

1913
The rigidity of this structure is to make it clear what the migration is accomplishing from the testing entrypoint. More standard and flexible assertions should be performed at lower levels in this repository.
2014

2115
## `Criterion`
2216
Tests are split into separate subdirectories which use their own `Criterion` types:
2317

24-
- `e2e` wherein a `Criterion` is evaluated against a `MovementRestClient` and a `MovementAptosRestClient` respectively.
25-
- `executor` wherein a `Criterion` is evaluated against a `MovementExecutor` and a `MovementAptosExecutor` respectively.
18+
- `migrator` wherein a `Criterion` is evaluated against a `MovementMigrator` and a `MovementAptosMigrator` respectively.
19+
- `node` wherein a `Criterion` is evaluated against a `MovementNode` and a `MovementAptosNode` respectively.
2620

migration/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# `migration`
2+
Migration contains the logic for the migration itself. It is broken into three subdirectories:
3+
4+
1. [`cli`](./cli): CLIs for running parts of the migration. These CLIs are also indexed from the projected root at [`docs/cli/README.md`](/docs/cli/README.md).
5+
2. [`core`](./core/): the core APIs used in migrations. CLIs are effectively the frontends, these are the underlying programmatic APIs.
6+
3. [`util`](./util/): types and similar that are used across migration implementations and in [`checks`](../checks/).
7+
8+
> [!NOTE]
9+
> Currently, migration CLIs containsparts of [`checks`](../checks/) because we run checked migrations. This may be refactored in forthcoming commits.

migration/core/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `core`
2+
`core` contains the `-core` APIs for which migration. It contains the following subdirectories.
3+
4+
1. [`node`](./node/): refers to the parts of the migration which run with privileged access to the node itself--including file-based state and
5+
2. [`migrator`](./migrator/): refers to parts of the migration which run with all other units. Currently, `migrator` includes access to `node` via `.node()` methods on the migrators as well as access to REST clients via `.wait_for_rest_client()` methods on the migrators. Thus, `migrators` can also be where migrations are run which require transaction API usage.
6+
3. [`mtma`](./mtma/): refers to what is ultimately exported as the correct migration. Currently, this is basically empty. It is the end-target for `mtma` migration development.

util/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `util`
2+
The `util` directory contains the following important subdirectories:
3+
4+
1. [`movement`](./movement/): crate APIs for running and working with `movement` nodes.
5+
2. [`movement-aptos`](./movement-aptos/): crate APIs for running and working with `movement-aptos` nodes.
6+
3. [`types`](./types/): universal types used when working throughout `movement-migration`.

0 commit comments

Comments
 (0)