Skip to content

Commit

Permalink
[test][adapter] Make coin_transfer test more stable (MystenLabs#2750)
Browse files Browse the repository at this point in the history
- coin_transfer test unnecessarily viewed a gas object
- This caused the value to change with any change to with any adjustment to the framework
  • Loading branch information
tnowacki authored Jun 28, 2022
1 parent fa16180 commit a6eabab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 8 tasks
processed 7 tasks

init:
A: object(100), B: object(101), C: object(102)
Expand All @@ -25,7 +25,3 @@ written: object(100), object(107)
task 6 'view-object'. lines 18-18:
Owner: Account Address ( C )
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(100)}}, version: 2u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 99990u64}}

task 7 'view-object'. lines 20-20:
Owner: Account Address ( B )
Contents: sui::coin::Coin<sui::sui::SUI> {id: sui::id::VersionedID {id: sui::id::UniqueID {id: sui::id::ID {bytes: fake(107)}}, version: 1u64}, balance: sui::balance::Balance<sui::sui::SUI> {value: 99570u64}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
//# run sui::coin::transfer --type-args sui::sui::SUI --args object(100) @C --sender B

//# view-object 100

//# view-object 107
1 change: 1 addition & 0 deletions crates/sui-transactional-test-runner/src/test_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ impl<'a> SuiTestAdapter<'a> {
txn_data: impl FnOnce(/* sender */ SuiAddress, /* gas */ ObjectRef) -> TransactionData,
) -> Transaction {
let gas_object_id = ObjectID::new(self.rng.gen());
assert!(!self.object_enumeration.contains_left(&gas_object_id));
self.enumerate_fake(gas_object_id);
let new_key_pair;
let (sender, sender_key) = match sender {
Expand Down

0 comments on commit a6eabab

Please sign in to comment.