Skip to content

Commit 656d969

Browse files
add adapter test for new currency ptb call (#24415)
## Description as title ## Test plan How did you test the new or updated feature? --- ## 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: - [ ] Indexing Framework:
1 parent 75e461e commit 656d969

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Mysten Labs, Inc.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// tests cannot call `coin_registry::new_currency` with programmable transactions
5+
6+
//# init --addresses test=0x0 --accounts A
7+
8+
//# publish --sender A
9+
module test::m1;
10+
11+
use std::string::String;
12+
13+
public fun name(): String {
14+
b"A".to_string()
15+
}
16+
17+
//# programmable --sender A --inputs object(0xc) @A 6u8
18+
//> 0: test::m1::name();
19+
//> 1: sui::coin_registry::new_currency<sui::kiosk::Kiosk>(Input(0), Input(2), Result(0), Result(0), Result(0), Result(0));
20+
//> 2: sui::coin_registry::finalize<sui::kiosk::Kiosk>(NestedResult(1,0));
21+
//> 3: TransferObjects([NestedResult(1,1), Result(2)], Input(1));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
source: external-crates/move/crates/move-transactional-test-runner/src/framework.rs
3+
---
4+
processed 3 tasks
5+
6+
init:
7+
A: object(0,0)
8+
9+
task 1, lines 8-15:
10+
//# publish --sender A
11+
created: object(1,0)
12+
mutated: object(0,0)
13+
gas summary: computation_cost: 1000000, storage_cost: 4028000, storage_rebate: 0, non_refundable_storage_fee: 0
14+
15+
task 2, lines 17-21:
16+
//# programmable --sender A --inputs object(0xc) @A 6u8
17+
//> 0: test::m1::name();
18+
//> 1: sui::coin_registry::new_currency<sui::kiosk::Kiosk>(Input(0), Input(2), Result(0), Result(0), Result(0), Result(0));
19+
//> 2: sui::coin_registry::finalize<sui::kiosk::Kiosk>(NestedResult(1,0));
20+
//> 3: TransferObjects([NestedResult(1,1), Result(2)], Input(1));
21+
Error: Transaction Effects Status: Non Entry Function Invoked. Move Call must start with an entry function
22+
Debug of error: NonEntryFunctionInvoked at command Some(1)

crates/sui-transactional-test-runner/src/test_adapter.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ use sui_storage::{
6868
};
6969
use sui_swarm_config::genesis_config::AccountConfig;
7070
use sui_swarm_config::network_config_builder::KeyPairWrapper;
71-
use sui_types::SUI_SYSTEM_ADDRESS;
7271
use sui_types::base_types::{SequenceNumber, VersionNumber};
7372
use sui_types::committee::EpochId;
7473
use sui_types::crypto::{
@@ -101,7 +100,8 @@ use sui_types::{
101100
transaction::{Transaction, TransactionData, VerifiedTransaction},
102101
};
103102
use sui_types::{
104-
SUI_FRAMEWORK_PACKAGE_ID, programmable_transaction_builder::ProgrammableTransactionBuilder,
103+
SUI_COIN_REGISTRY_OBJECT_ID, SUI_FRAMEWORK_PACKAGE_ID, SUI_SYSTEM_ADDRESS,
104+
programmable_transaction_builder::ProgrammableTransactionBuilder,
105105
};
106106
use sui_types::{SUI_SYSTEM_PACKAGE_ID, utils::to_sender_signed_transaction};
107107
use sui_types::{execution_status::ExecutionStatus, transaction::TransactionKind};
@@ -129,6 +129,7 @@ const WELL_KNOWN_OBJECTS: &[ObjectID] = &[
129129
SUI_CLOCK_OBJECT_ID,
130130
SUI_DENY_LIST_OBJECT_ID,
131131
SUI_RANDOMNESS_STATE_OBJECT_ID,
132+
SUI_COIN_REGISTRY_OBJECT_ID,
132133
];
133134
// TODO use the file name as a seed
134135
const RNG_SEED: [u8; 32] = [

0 commit comments

Comments
 (0)