forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
369 additions
and
41 deletions.
There are no files selected for viewing
314 changes: 314 additions & 0 deletions
314
api/goldens/aptos_api__tests__call_trace_test__test_get_call_trace_by_hash.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,314 @@ | ||
{ | ||
"pc": 0, | ||
"module_id": "", | ||
"func_name": "create_account", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"outputs": [], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "create_account", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbec88: [Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "create_account_unchecked", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbec88: [Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::guid", | ||
"func_name": "create", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)", | ||
"(&container 600003fd1bd8)[3]" | ||
], | ||
"outputs": [ | ||
"(container 600003fd1b78: [(container 600003fd1848: [U64(0), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::event", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(container 600003fd1a28: [(container 600003fd1ab8: [U64(0), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"outputs": [ | ||
"(container 600003fd1f68: [U64(0), (container 600003fd18d8: [(container 600003fd1848: [U64(0), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::guid", | ||
"func_name": "create", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)", | ||
"(&container 600003fd1bd8)[3]" | ||
], | ||
"outputs": [ | ||
"(container 600003fd1e48: [(container 600003fd1ea8: [U64(1), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::event", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(container 600003fd18d8: [(container 600003fd1ab8: [U64(1), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"outputs": [ | ||
"(container 600003fd1d88: [U64(0), (container 600003fd1de8: [(container 600003fd1ea8: [U64(1), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::option", | ||
"func_name": "none", | ||
"inputs": [], | ||
"outputs": [ | ||
"(container 600003fbf978: [(container 600003fbf6d8: [])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::option", | ||
"func_name": "none", | ||
"inputs": [], | ||
"outputs": [ | ||
"(container 600003fbc978: [(container 600003fbc948: [])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::coin", | ||
"func_name": "register", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::signer", | ||
"func_name": "address_of", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::coin", | ||
"func_name": "is_account_registered", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"outputs": [ | ||
"false" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "register_coin", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"outputs": [], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::event", | ||
"func_name": "emit_event", | ||
"inputs": [ | ||
"(&container 600003fd1b78)", | ||
"(container 600003fbfb88: [(container 600003fbf588: [Address(1), (container 600003fbee38: [97, 112, 116, 111, 115, 95, 99, 111, 105, 110]), (container 600003fbe8f8: [65, 112, 116, 111, 115, 67, 111, 105, 110])])])" | ||
], | ||
"outputs": [], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbe808: [U64(0), (container 600003fbeb68: [(container 600003fbeb38: [U64(2), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "create_guid", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbea48: [(container 600003fbee38: [U64(2), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::signer", | ||
"func_name": "address_of", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::guid", | ||
"func_name": "create", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)", | ||
"(&container 600003fbc948)[2]" | ||
], | ||
"outputs": [ | ||
"(container 600003fbe808: [(container 600003fbeef8: [U64(2), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::event", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(container 600003fbeb68: [(container 600003fbeb38: [U64(2), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"outputs": [ | ||
"(container 600003fbe808: [U64(0), (container 600003fbee38: [(container 600003fbea48: [U64(2), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbec28: [U64(0), (container 600003fbeb68: [(container 600003fbea48: [U64(3), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::account", | ||
"func_name": "create_guid", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"(container 600003fbeef8: [(container 600003fbe508: [U64(3), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [ | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::signer", | ||
"func_name": "address_of", | ||
"inputs": [ | ||
"(&container 600003fd1f98)" | ||
], | ||
"outputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::guid", | ||
"func_name": "create", | ||
"inputs": [ | ||
"Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)", | ||
"(&container 600003fbc948)[2]" | ||
], | ||
"outputs": [ | ||
"(container 600003fbec28: [(container 600003fbeb98: [U64(3), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"pc": 0, | ||
"module_id": "0000000000000000000000000000000000000000000000000000000000000001::event", | ||
"func_name": "new_event_handle", | ||
"inputs": [ | ||
"(container 600003fbeb68: [(container 600003fbea48: [U64(3), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])" | ||
], | ||
"outputs": [ | ||
"(container 600003fbec28: [U64(0), (container 600003fbe508: [(container 600003fbeef8: [U64(3), Address(34bf7e2d17674feb234371a7ea58efd715f0e56ba20ebf13789480d9d643afaf)])])])" | ||
], | ||
"type_args": [], | ||
"sub_traces": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright © Aptos Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use aptos_api_test_context::{assert_json, current_function_name, pretty, TestContext}; | ||
use super::new_test_context; | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_get_call_trace_by_hash() { | ||
let mut context = new_test_context(current_function_name!()); | ||
let account = context.gen_account(); | ||
let txn = context.create_user_account(&account).await; | ||
context.commit_block(&vec![txn.clone()]).await; | ||
|
||
let txns = context.get("/transactions?start=2&limit=1").await; | ||
assert_eq!(1, txns.as_array().unwrap().len()); | ||
|
||
let resp = context | ||
.get(&format!( | ||
"/transactions/by_hash/{}", | ||
txns[0]["hash"].as_str().unwrap() | ||
)) | ||
.await; | ||
assert_json(resp, txns[0].clone()); | ||
|
||
let call_trace_resp = context. | ||
get(&format!( | ||
"/call_trace/by_hash/{}", | ||
txns[0]["hash"].as_str().unwrap() | ||
)) | ||
.await; | ||
context.check_golden_output(call_trace_resp); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.