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

Cleanup and test rework #17116

Merged
merged 1 commit into from
Apr 19, 2024
Merged

Cleanup and test rework #17116

merged 1 commit into from
Apr 19, 2024

Conversation

dariorussi
Copy link
Contributor

Description

More Move2024 cleanup and formatting.
Moved tests out of bridge.move in its own test directory.
We will transition all tests to that model as we work towards 100% test coverage.

Test plan

This is mostly tests


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@dariorussi dariorussi requested review from patrickkuo and longbowlu and removed request for ronny-mysten April 10, 2024 23:07
Copy link

vercel bot commented Apr 10, 2024

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

Name Status Preview Comments Updated (UTC)
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2024 1:09pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Apr 19, 2024 1:09pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Apr 19, 2024 1:09pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Apr 19, 2024 1:09pm

@dariorussi
Copy link
Contributor Author

this can go in as is or wait for me to add more tests to bridge.move.
Either way works for me and I'll ping you all when I have added bridge tests if not accepted earlier

Comment on lines +720 to +753
#[test_only]
public fun transfer_status_pending(): u8 {
TRANSFER_STATUS_PENDING
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make these const public instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately there is no public const concept in move, all const are private to the module

Comment on lines +608 to +632
#[test_only]
public fun setup_treasury_for_testing(bridge: &mut Bridge) {
bridge.load_inner_mut().treasury.setup_for_testing();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

for these kind of test-only helpers, is it better to just make them public(package or friend (if it's still a thing in move 2024?) @dariorussi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does not really matter because those are compiled away.
I am not sure if there is a "standard" here, I'll find out.
We are talking about unit tests having visibility over the module they are testing but that is a change on the compiler side (and maybe more) that is not scheduled or planned yet

Copy link
Contributor

Choose a reason for hiding this comment

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

cool, i'm curious too but not blocking this PR

Copy link
Contributor

@longbowlu longbowlu left a comment

Choose a reason for hiding this comment

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

thanks for the cleanup and refactor! mostly look good to me, with several questions

abort TEST_DONE
}

// #[test]
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we have these commented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because they do not work yet as I need to build more infra for those tests... I did not want to have them completely out yet, which I could if we are going to get this in as it is

@dariorussi dariorussi merged commit 3d3112f into feature/native-bridge Apr 19, 2024
47 checks passed
@dariorussi dariorussi deleted the bridge_ut1 branch April 19, 2024 15:36
patrickkuo pushed a commit that referenced this pull request May 2, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 8, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description

More Move2024 cleanup and formatting.
Moved tests out of `bridge.move` in its own test directory.
We will transition all tests to that model as we work towards 100% test
coverage.

## Test plan

This is mostly tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
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.

2 participants