Skip to content

Commit

Permalink
fix(adapter-transactional-tests): fix indexes in tests (stable sort p…
Browse files Browse the repository at this point in the history
…roblem)
  • Loading branch information
jkrvivian committed Nov 8, 2024
1 parent 73ac17e commit b54d054
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5829200, storage_rebate: 0, non_refundable_storage_fee: 0

task 3, lines 50-54:
//# view-object 2,1
Owner: Object ID: ( fake(2,0) )
//# view-object 2,2
Owner: Shared( 2 )
Version: 2
Contents: test::m::S {
id: iota::object::UID {
id: iota::object::ID {
bytes: fake(2,1),
bytes: fake(2,2),
},
},
}
Expand All @@ -34,17 +34,18 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5829200, storage_rebate: 980400, non_refundable_storage_fee: 0

task 5, line 58:
//# run test::m::transfer --sender A --args object(4,2) @B
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(4,2), parent_id: object(4,0) }
//# run test::m::transfer --sender A --args object(4,1) @B
mutated: object(0,0), object(4,1)
gas summary: computation_cost: 1000000, storage_cost: 2181200, storage_rebate: 2181200, non_refundable_storage_fee: 0

task 6, lines 60-64:
//# view-object 4,2
Owner: Object ID: ( fake(4,0) )
Version: 3
//# view-object 4,1
Owner: Account Address ( B )
Version: 4
Contents: test::m::S {
id: iota::object::UID {
id: iota::object::ID {
bytes: fake(4,2),
bytes: fake(4,1),
},
},
}
Expand All @@ -63,7 +64,7 @@ gas summary: computation_cost: 1000000, storage_cost: 2181200, storage_rebate:
task 9, line 70:
//# view-object 7,1
Owner: Account Address ( B )
Version: 5
Version: 6
Contents: test::m::S {
id: iota::object::UID {
id: iota::object::ID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ module test::m {

//# run test::m::mint_and_share --sender A

//# view-object 2,1
//# view-object 2,2

//
// Test transfer allows non-zero child count
//

//# run test::m::mint --sender A

//# run test::m::transfer --sender A --args object(4,2) @B
//# run test::m::transfer --sender A --args object(4,1) @B

//# view-object 4,2
//# view-object 4,1

//
// Test TransferObject allows non-zero child count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0

task 3, line 39:
//# run a::m::t2 --sender A --args object(2,0)
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,0), parent_id: object(2,2) }
//# run a::m::t2 --sender A --args object(2,1)
Error: Transaction Effects Status: Move Runtime Abort. Location: iota::dynamic_field::remove_child_object (function index 13) at offset 0, Abort Code: 2
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: iota, name: Identifier("dynamic_field") }, function: 13, instruction: 0, function_name: Some("remove_child_object") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: iota, name: Identifier("dynamic_field") }), indices: [], offsets: [(FunctionDefinitionIndex(13), 0)] }), command: Some(0) } }
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ entry fun t2(obj: &mut Obj) {

//# run a::m::t1 --sender A

//# run a::m::t2 --sender A --args object(2,0)
//# run a::m::t2 --sender A --args object(2,1)
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ mutated: object(0,0)
gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate: 0, non_refundable_storage_fee: 0

task 3, line 44:
//# view-object 2,1
Owner: Account Address ( A )
//# view-object 2,0
Owner: Object ID: ( fake(2,2) )
Version: 2
Contents: a::m::Obj {
id: iota::object::UID {
id: iota::object::ID {
bytes: fake(2,1),
bytes: fake(2,0),
},
},
}

task 4, line 46:
//# run a::m::take_and_wrap --sender A --args object(2,0)
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,0), parent_id: object(2,2) }
//# run a::m::take_and_wrap --sender A --args object(2,1)
created: object(4,0)
mutated: object(0,0), object(2,1)
deleted: object(2,2)
wrapped: object(2,0)
gas summary: computation_cost: 1000000, storage_cost: 4134400, storage_rebate: 5859600, non_refundable_storage_fee: 0

task 5, line 49:
//# run a::m::mint --sender A
Expand All @@ -39,8 +43,8 @@ gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate:

task 6, line 51:
//# view-object 5,2
Owner: Object ID: ( fake(5,0) )
Version: 3
Owner: Object ID: ( fake(5,1) )
Version: 4
Contents: iota::dynamic_field::Field<iota::dynamic_object_field::Wrapper<u64>, iota::object::ID> {
id: iota::object::UID {
id: iota::object::ID {
Expand All @@ -51,14 +55,14 @@ Contents: iota::dynamic_field::Field<iota::dynamic_object_field::Wrapper<u64>, i
name: 0u64,
},
value: iota::object::ID {
bytes: fake(5,1),
bytes: fake(5,0),
},
}

task 7, line 53:
//# run a::m::take_and_destroy --sender A --args object(5,0)
mutated: object(0,0), object(5,0)
deleted: object(5,1), object(5,2)
//# run a::m::take_and_destroy --sender A --args object(5,1)
mutated: object(0,0), object(5,1)
deleted: object(5,0), object(5,2)
gas summary: computation_cost: 1000000, storage_cost: 2196400, storage_rebate: 5859600, non_refundable_storage_fee: 0

task 8, line 56:
Expand All @@ -70,7 +74,7 @@ gas summary: computation_cost: 1000000, storage_cost: 5859600, storage_rebate:
task 9, line 58:
//# view-object 8,2
Owner: Object ID: ( fake(8,0) )
Version: 5
Version: 6
Contents: iota::dynamic_field::Field<iota::dynamic_object_field::Wrapper<u64>, iota::object::ID> {
id: iota::object::UID {
id: iota::object::ID {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ entry fun take_and_take(obj: &mut Obj, ctx: &mut TxContext) {

//# run a::m::mint --sender A

//# view-object 2,1
//# view-object 2,0

//# run a::m::take_and_wrap --sender A --args object(2,0)
//# run a::m::take_and_wrap --sender A --args object(2,1)


//# run a::m::mint --sender A

//# view-object 5,2

//# run a::m::take_and_destroy --sender A --args object(5,0)
//# run a::m::take_and_destroy --sender A --args object(5,1)


//# run a::m::mint --sender A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ Error: Transaction Effects Status: Move Runtime Abort. Location: iota::transfer:
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: iota, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: iota, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } }

task 12, line 101:
//# run tto::M1::receive_b_parent --args object(2,6) receiving(2,5) --sender A
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,5), parent_id: object(2,0) }
//# run tto::M1::receive_b_parent --args object(2,6) receiving(2,4) --sender A
created: object(12,0)
mutated: object(0,0), object(2,6)
wrapped: object(2,4)
gas summary: computation_cost: 1000000, storage_cost: 4256000, storage_rebate: 3534000, non_refundable_storage_fee: 0

task 13, line 103:
//# run tto::M1::receive_wrapped --args object(2,6) receiving(2,7) --sender A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ module tto::M1 {
// Try to load an invalid type that will cause indexing to fail.
//# run tto::M1::receive_b_parent --args object(2,6) receiving(2,7) --sender A

//# run tto::M1::receive_b_parent --args object(2,6) receiving(2,5) --sender A
//# run tto::M1::receive_b_parent --args object(2,6) receiving(2,4) --sender A

//# run tto::M1::receive_wrapped --args object(2,6) receiving(2,7) --sender A
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,18 @@ Contents: tto::M1::Wrapper<tto::M1::A> {
}

task 13, line 103:
//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,9) --sender A
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,8), parent_id: object(2,1) }
//# run tto::M1::receive_b_parent --args object(2,7) receiving(2,9) --sender A
Error: Transaction Effects Status: Move Runtime Abort. Location: iota::transfer::receive_impl (function index 12) at offset 0, Abort Code: 2
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: MoveAbort(MoveLocation { module: ModuleId { address: iota, name: Identifier("transfer") }, function: 12, instruction: 0, function_name: Some("receive_impl") }, 2), source: Some(VMError { major_status: ABORTED, sub_status: Some(2), message: None, exec_state: None, location: Module(ModuleId { address: iota, name: Identifier("transfer") }), indices: [], offsets: [(FunctionDefinitionIndex(12), 0)] }), command: Some(0) } }

task 14, line 105:
//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,7) --sender A
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,8), parent_id: object(2,1) }
//# run tto::M1::receive_b_parent --args object(2,7) receiving(2,5) --sender A
created: object(14,0)
mutated: object(0,0), object(2,5), object(2,7)
gas summary: computation_cost: 1000000, storage_cost: 5981200, storage_rebate: 3534000, non_refundable_storage_fee: 0

task 15, line 107:
//# run tto::M1::receive_wrapped --args object(2,8) receiving(2,9) --sender A
Error: Error checking transaction input objects: InvalidChildObjectArgument { child_id: object(2,8), parent_id: object(2,1) }
//# run tto::M1::receive_wrapped --args object(2,7) receiving(2,9) --sender A
created: object(15,0)
mutated: object(0,0), object(2,7), object(2,9)
gas summary: computation_cost: 1000000, storage_cost: 6558800, storage_rebate: 4111600, non_refundable_storage_fee: 0
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ module tto::M1 {

// E_OBJECT_TYPE_MISMATCH
// Try to load an invalid type that will cause indexing to fail.
//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,9) --sender A
//# run tto::M1::receive_b_parent --args object(2,7) receiving(2,9) --sender A

//# run tto::M1::receive_b_parent --args object(2,8) receiving(2,7) --sender A
//# run tto::M1::receive_b_parent --args object(2,7) receiving(2,5) --sender A

//# run tto::M1::receive_wrapped --args object(2,8) receiving(2,9) --sender A
//# run tto::M1::receive_wrapped --args object(2,7) receiving(2,9) --sender A

0 comments on commit b54d054

Please sign in to comment.