Skip to content

Commit

Permalink
Add type args into the call trace (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Poytr1 committed Oct 4, 2023
1 parent 01fb2ba commit 1518e9e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@
"outputs": [
"0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf"
],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": []
},
{
Expand All @@ -145,7 +147,9 @@
"outputs": [
"false"
],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": []
},
{
Expand All @@ -156,7 +160,9 @@
"0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf"
],
"outputs": [],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": [
{
"pc": 0,
Expand All @@ -167,7 +173,9 @@
""
],
"outputs": [],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": []
}
]
Expand All @@ -182,7 +190,9 @@
"outputs": [
"struct[0u64, struct[struct[2u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]]"
],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": [
{
"pc": 0,
Expand All @@ -194,7 +204,9 @@
"outputs": [
"struct[struct[2u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]"
],
"type_args": [],
"type_args": [
"0x1::coin::DepositEvent"
],
"sub_traces": [
{
"pc": 0,
Expand Down Expand Up @@ -235,7 +247,9 @@
"outputs": [
"struct[0u64, struct[struct[2u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]]"
],
"type_args": [],
"type_args": [
"0x1::coin::DepositEvent"
],
"sub_traces": []
}
]
Expand All @@ -250,7 +264,9 @@
"outputs": [
"struct[0u64, struct[struct[3u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]]"
],
"type_args": [],
"type_args": [
"0x1::aptos_coin::AptosCoin"
],
"sub_traces": [
{
"pc": 0,
Expand All @@ -262,7 +278,9 @@
"outputs": [
"struct[struct[3u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]"
],
"type_args": [],
"type_args": [
"0x1::coin::WithdrawEvent"
],
"sub_traces": [
{
"pc": 0,
Expand Down Expand Up @@ -303,7 +321,9 @@
"outputs": [
"struct[0u64, struct[struct[3u64, 0x34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf]]]"
],
"type_args": [],
"type_args": [
"0x1::coin::WithdrawEvent"
],
"sub_traces": []
}
]
Expand Down
12 changes: 9 additions & 3 deletions third_party/move/move-vm/runtime/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ impl Interpreter {
inputs: args_1.into_iter().enumerate().map(|(_, i)| i.to_string()).collect(),
outputs: vec![],
// TODO(pcxu): add type args
type_args: vec![],
type_args: current_frame.ty_args().into_iter().map(|ty| {
loader.type_to_type_tag(ty).unwrap().to_string()
}).collect(),
sub_traces: vec![],
}).map_err(|_e| {
let err = PartialVMError::new(StatusCode::ABORTED);
Expand Down Expand Up @@ -449,7 +451,9 @@ impl Interpreter {
Ok(value.as_move_value(&layout).to_string())
}).map(|v: Result<String, PartialVMError>| v.unwrap_or("".to_string())).collect(),
outputs: vec![],
type_args: vec![],
type_args: current_frame.ty_args().into_iter().map(|ty| {
loader.type_to_type_tag(ty).unwrap().to_string()
}).collect(),
sub_traces: vec![],
}).map_err(|_e| {
let err = PartialVMError::new(StatusCode::ABORTED);
Expand Down Expand Up @@ -535,7 +539,9 @@ impl Interpreter {
Ok(value.as_move_value(&layout).to_string())
}).map(|v: Result<String, PartialVMError>| v.unwrap_or("".to_string())).collect(),
outputs: vec![],
type_args: vec![],
type_args: current_frame.ty_args().into_iter().map(|ty| {
loader.type_to_type_tag(ty).unwrap().to_string()
}).collect(),
sub_traces: vec![],
}).map_err(|_e| {
let err = PartialVMError::new(StatusCode::ABORTED);
Expand Down

0 comments on commit 1518e9e

Please sign in to comment.