Skip to content

Commit be94dd3

Browse files
authored
[1.59][cherry-pick] Simplify private generics check (#24108)
## Description - We plan on adding more "internal" functions, and rewriting this now will help us get more of these new functions out next release (and we really should have done this a long time ago) ## Test plan - Updated test error messages --- ## 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): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
1 parent bac09b6 commit be94dd3

File tree

35 files changed

+512
-107
lines changed

35 files changed

+512
-107
lines changed

crates/sui-adapter-transactional-tests/tests/party/private_transfer_ptb.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ task 5, lines 36-40:
3838
//> sui::transfer::party_transfer<ex::m::Priv>(Input(0), Result(0))
3939
// Private transfer
4040
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
41-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::party_transfer. Use the public variant instead, sui::transfer::public_party_transfer"), command: Some(1) } }
41+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::party_transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_party_transfer'."), command: Some(1) } }
4242

4343
task 6, lines 41-44:
4444
//# programmable --inputs @0
4545
//> 0: ex::m::priv();
4646
//> 1: sui::party::single_owner(Input(0));
4747
//> sui::transfer::party_transfer<ex::m::Priv>(Result(0), Result(1))
4848
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
49-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::party_transfer. Use the public variant instead, sui::transfer::public_party_transfer"), command: Some(2) } }
49+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::party_transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_party_transfer'."), command: Some(2) } }

crates/sui-adapter-transactional-tests/tests/party/[email protected]

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ task 5, lines 36-40:
3838
//> sui::transfer::party_transfer<ex::m::Priv>(Input(0), Result(0))
3939
// Private transfer
4040
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
41-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::party_transfer. Use the public variant instead, sui::transfer::public_party_transfer"), command: Some(1) } }
41+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::party_transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_party_transfer'."), command: Some(1) } }
4242

4343
task 6, lines 41-44:
4444
//# programmable --inputs @0
4545
//> 0: ex::m::priv();
4646
//> 1: sui::party::single_owner(Input(0));
4747
//> sui::transfer::party_transfer<ex::m::Priv>(Result(0), Result(1))
4848
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
49-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::party_transfer. Use the public variant instead, sui::transfer::public_party_transfer"), command: Some(2) } }
49+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::party_transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_party_transfer'."), command: Some(2) } }

crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ task 2, lines 14-16:
1717
//> 0: test::m1::a();
1818
//> sui::event::emit<test::m1::A>(Result(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2121

2222
task 3, lines 18-21:
2323
//# programmable
2424
//> 0: test::m1::a();
2525
// wrong type annotation did not matter in v1 of PTB execution
2626
//> sui::event::emit<bool>(Result(0));
2727
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
28-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
28+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2929

3030
task 4, lines 23-26:
3131
//# programmable

crates/sui-adapter-transactional-tests/tests/programmable/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ task 2, lines 14-16:
1717
//> 0: test::m1::a();
1818
//> sui::event::emit<test::m1::A>(Result(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2121

2222
task 3, lines 18-21:
2323
//# programmable

crates/sui-adapter-transactional-tests/tests/programmable/cannot_call_emit_authenticated.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ task 2, lines 14-16:
1717
//> 0: test::m1::a();
1818
//> sui::event::emit_authenticated<test::m1::A>(Result(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit_authenticated' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2121

2222
task 3, lines 18-21:
2323
//# programmable
2424
//> 0: test::m1::a();
2525
// wrong type annotation did not matter in v1 of PTB execution
2626
//> sui::event::emit_authenticated<bool>(Result(0));
2727
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
28-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
28+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit_authenticated' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2929

3030
task 4, lines 23-26:
3131
//# programmable

crates/sui-adapter-transactional-tests/tests/programmable/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ task 2, lines 14-16:
1717
//> 0: test::m1::a();
1818
//> sui::event::emit_authenticated<test::m1::A>(Result(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call functions in sui::event"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::event::emit_authenticated' since type parameter #0 can only be instantiated with types defined within the caller's module."), command: Some(1) } }
2121

2222
task 3, lines 18-21:
2323
//# programmable

crates/sui-adapter-transactional-tests/tests/programmable/private_transfer_invalid.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,44 @@ task 2, lines 19-21:
1717
//> 0: test::m1::pub();
1818
//> sui::transfer::transfer<test::m1::Pub>(Result(0), Input(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_transfer'."), command: Some(1) } }
2121

2222
task 3, lines 23-25:
2323
//# programmable
2424
//> 0: test::m1::pub();
2525
//> sui::transfer::share_object<test::m1::Pub>(Result(0));
2626
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
27-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } }
27+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::share_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_share_object'."), command: Some(1) } }
2828

2929
task 4, lines 27-32:
3030
//# programmable
3131
//> 0: test::m1::pub();
3232
//> sui::transfer::freeze_object<test::m1::Pub>(Result(0));
3333
// Does not have store, cannot be used with internal variants
3434
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
35-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } }
35+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::freeze_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_freeze_object'."), command: Some(1) } }
3636

3737
task 5, lines 34-36:
3838
//# programmable --sender A --inputs @A
3939
//> 0: test::m1::priv();
4040
//> sui::transfer::transfer<test::m1::Priv>(Result(0), Input(0));
4141
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
42-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } }
42+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_transfer'."), command: Some(1) } }
4343

4444
task 6, lines 38-40:
4545
//# programmable
4646
//> 0: test::m1::priv();
4747
//> sui::transfer::share_object<test::m1::Priv>(Result(0));
4848
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
49-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } }
49+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::share_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_share_object'."), command: Some(1) } }
5050

5151
task 7, lines 42-47:
5252
//# programmable
5353
//> 0: test::m1::priv();
5454
//> sui::transfer::freeze_object<test::m1::Priv>(Result(0));
5555
// Does not have store, cannot be used with public variants
5656
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
57-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } }
57+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::freeze_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_freeze_object'."), command: Some(1) } }
5858

5959
task 8, lines 49-51:
6060
//# programmable --sender A --inputs @A

crates/sui-adapter-transactional-tests/tests/programmable/[email protected]

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,44 @@ task 2, lines 19-21:
1717
//> 0: test::m1::pub();
1818
//> sui::transfer::transfer<test::m1::Pub>(Result(0), Input(0));
1919
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
20-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } }
20+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_transfer'."), command: Some(1) } }
2121

2222
task 3, lines 23-25:
2323
//# programmable
2424
//> 0: test::m1::pub();
2525
//> sui::transfer::share_object<test::m1::Pub>(Result(0));
2626
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
27-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } }
27+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::share_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_share_object'."), command: Some(1) } }
2828

2929
task 4, lines 27-32:
3030
//# programmable
3131
//> 0: test::m1::pub();
3232
//> sui::transfer::freeze_object<test::m1::Pub>(Result(0));
3333
// Does not have store, cannot be used with internal variants
3434
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
35-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } }
35+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::freeze_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_freeze_object'."), command: Some(1) } }
3636

3737
task 5, lines 34-36:
3838
//# programmable --sender A --inputs @A
3939
//> 0: test::m1::priv();
4040
//> sui::transfer::transfer<test::m1::Priv>(Result(0), Input(0));
4141
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
42-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::transfer. Use the public variant instead, sui::transfer::public_transfer"), command: Some(1) } }
42+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::transfer' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_transfer'."), command: Some(1) } }
4343

4444
task 6, lines 38-40:
4545
//# programmable
4646
//> 0: test::m1::priv();
4747
//> sui::transfer::share_object<test::m1::Priv>(Result(0));
4848
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
49-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::share_object. Use the public variant instead, sui::transfer::public_share_object"), command: Some(1) } }
49+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::share_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_share_object'."), command: Some(1) } }
5050

5151
task 7, lines 42-47:
5252
//# programmable
5353
//> 0: test::m1::priv();
5454
//> sui::transfer::freeze_object<test::m1::Priv>(Result(0));
5555
// Does not have store, cannot be used with public variants
5656
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
57-
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call sui::transfer::freeze_object. Use the public variant instead, sui::transfer::public_freeze_object"), command: Some(1) } }
57+
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: NonEntryFunctionInvoked, source: Some("Cannot directly call function 'sui::transfer::freeze_object' since type parameter #0 can only be instantiated with types defined within the caller's module. If the type has the 'store' ability, use the public variant instead: 'sui::transfer::public_freeze_object'."), command: Some(1) } }
5858

5959
task 8, lines 49-51:
6060
//# programmable --sender A --inputs @A

0 commit comments

Comments
 (0)