-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
tests and move 2024 cleanup #17517
tests and move 2024 cleanup #17517
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored 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.
overall looks good with a few nits
public(package) fun create(ctx: &TxContext): BridgeCommittee { | ||
assert!(tx_context::sender(ctx) == @0x0, ENotSystemAddress); | ||
BridgeCommittee { | ||
members: vec_map::empty(), | ||
member_registrations: vec_map::empty(), | ||
last_committee_update_epoch: 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.
do you want to do sth like
///////////////////////////////////////////
/// Public functions ///
///////////////////////////////////////////
to make it more readable and for future contributors?
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.
I really do not like that but I could add a public function group marker
// Dupicate keys would cause `try_create_next_committee` to fail and, | ||
// in consequence, an end of epoch transaction to fail (safe mode run). | ||
// This check will ensure the creation of the committee is correct. | ||
fun check_uniqueness_bridge_keys(self: &BridgeCommittee, bridge_pubkey_bytes: vector<u8>) { |
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.
do we have unit test for this?
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.
I do not think so and we are not yet 100% test coverage. So soon...
scenario.end(); | ||
destroy(treasury); | ||
} | ||
} |
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.
nit: new line
let mut bcs = bcs::new(input); | ||
assert!(peel_u64_be(&mut bcs) == expected, 0) | ||
#[test_only] | ||
public(package) fun validator_eth_addresses(block_list: &Blocklist): &vector<vector<u8>> { |
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.
is this used?
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 call, I do not see usage so I will remove and see, thanks
let mut bcs = bcs::new(input); | ||
assert!(peel_u64_be_for_testing(&mut bcs) == expected, 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.
ditto
public fun token_id<T>(self: &BridgeTreasury): u8 { | ||
let metadata = self.get_token_metadata<T>(); | ||
metadata.id | ||
} | ||
|
||
public fun decimal_multiplier<T>(self: &BridgeTreasury): u64 { | ||
let metadata = self.get_token_metadata<T>(); | ||
metadata.decimal_multiplier | ||
} | ||
|
||
public fun notional_value<T>(self: &BridgeTreasury): u64 { | ||
let metadata = self.get_token_metadata<T>(); | ||
metadata.notional_value | ||
} |
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.
do these need to be public
? It looks like people won't be able to get &BridgeTreasury
anyway: https://github.com/MystenLabs/sui/blob/feature/native-bridge/crates/sui-framework/packages/bridge/sources/bridge.move#L674
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.
I think from the limiter? also they seemed accessors that are pretty harmless
feedback |
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.
Thanks for the cleanup, LGTM
## Description Mostly moved tests in their own files. Particularly tests that have to be expanded. Move 2024 cleanup. Formatting and convention alignment. This is almost no change except for few visibility changes we will talk about ## Test plan Existing test, no feature added --- ## 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:
## Description Mostly moved tests in their own files. Particularly tests that have to be expanded. Move 2024 cleanup. Formatting and convention alignment. This is almost no change except for few visibility changes we will talk about ## Test plan Existing test, no feature added --- ## 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:
## Description Mostly moved tests in their own files. Particularly tests that have to be expanded. Move 2024 cleanup. Formatting and convention alignment. This is almost no change except for few visibility changes we will talk about ## Test plan Existing test, no feature added --- ## 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:
## Description Mostly moved tests in their own files. Particularly tests that have to be expanded. Move 2024 cleanup. Formatting and convention alignment. This is almost no change except for few visibility changes we will talk about ## Test plan Existing test, no feature added --- ## 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:
## Description Mostly moved tests in their own files. Particularly tests that have to be expanded. Move 2024 cleanup. Formatting and convention alignment. This is almost no change except for few visibility changes we will talk about ## Test plan Existing test, no feature added --- ## 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:
Description
Mostly moved tests in their own files. Particularly tests that have to be expanded.
Move 2024 cleanup.
Formatting and convention alignment.
This is almost no change except for few visibility changes we will talk about
Test plan
Existing test, no feature added
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.