rpc(ChainRpc): Add time_added_to_pool field for ChainRpcImpl::get_transaction#3949
Merged
zhangsoledad merged 4 commits intonervosnetwork:developfrom Apr 25, 2023
Conversation
enter_tx_pool_timestamp field to get_transaction
enter_tx_pool_timestamp field to get_transactionenter_tx_pool_timestamp field for ChainRpcImpl::get_transaction
Collaborator
Author
|
I think there may be a bug in the Investigating... Update: It seems that if I write multiple lines of comments to a field for a struct, Waiting #3954 to solve rpc doc issue. |
a23d582 to
8c15c64
Compare
71adf86 to
89d7fb9
Compare
doitian
reviewed
Apr 24, 2023
rpc/README.md
Outdated
|
|
||
| * `cycles`: [`Cycle`](#type-cycle) `|` `null` - The transaction consumed cycles. | ||
|
|
||
| * `enter_tx_pool_timestamp`: [`Uint64`](#type-uint64) `|` `null` - If the transaction is in tx-pool, `enter_tx_pool_timestamp` represent when it enter the tx-pool |
Member
There was a problem hiding this comment.
I asked AI to give a better name:
Some better name options for enter_tx_pool_timestamp could be:
- tx_pool_entry_timestamp
- timestamp_entered_tx_pool
- tx_pool_inclusion_time
- time_added_to_tx_pool
These names are a bit more verbose but convey the meaning clearly that it is the timestamp when the transaction entered the transaction pool.
I think we can use time_added_to_pool. The prefix tx_ is not necessary.
Signed-off-by: Eval EXEC <execvy@gmail.com>
Signed-off-by: Eval EXEC <execvy@gmail.com>
89d7fb9 to
d0f0ad1
Compare
enter_tx_pool_timestamp field for ChainRpcImpl::get_transactiontime_added_to_pool field for ChainRpcImpl::get_transaction
doitian
approved these changes
Apr 24, 2023
Collaborator
Author
--- STDERR: ckb-rpc tests::examples::test_rpc_examples ---
thread 'tests::examples::test_rpc_examples' panicked at 'assertion failed: `(left == right)`: RPC Example get_transaction(id=42) got the following unexpected response:
{"id":42,"jsonrpc":"2.0","result":{"cycles":"0x219","time_added_to_pool":"0x187b3d137a1","transaction":{"cell_deps":[{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3"}}],"hash":"0xa0ef4eb5f4ceeb08a4c8524d84c5da95dce2f608e0ca2ec8091191b0f330c6e3","header_deps":["0x7978ec7ce5b507cfb52e149e36b1a23f6062ed150503c85bbf825da3599095ed"],"inputs":[{"previous_output":{"index":"0x0","tx_hash":"0x365698b50ca0da75dca2c87f9e7b563811d3b5813736b8cc62cc3b106faceb17"},"since":"0x0"}],"outputs":[{"capacity":"0x2540be400","lock":{"args":"0x","code_hash":"0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5","hash_type":"data"},"type":null}],"outputs_data":["0x"],"version":"0x0","witnesses":[]},"tx_status":{"block_hash":null,"reason":null,"status":"pending"}},"error":null}
Diff < left / right > :
RpcTestResponse {
id: 42,
jsonrpc: "2.0",
result: Object {
"cycles": String("0x219"),
> "time_added_to_pool": String("0x187b3d137a1"),
"transaction": Object {
"cell_deps": Array [
Object {
"dep_type": String("code"),
"out_point": Object {
"index": String("0x0"),
"tx_hash": String("0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3"),
},
},
],
"hash": String("0xa0ef4eb5f4ceeb08a4c8524d84c5da95dce2f608e0ca2ec8091191b0f330c6e3"),
"header_deps": Array [
String("0x7978ec7ce5b507cfb52e149e36b1a23f6062ed150503c85bbf825da3599095ed"),
],
"inputs": Array [
Object {
"previous_output": Object {
"index": String("0x0"),
"tx_hash": String("0x365698b50ca0da75dca2c87f9e7b563811d3b5813736b8cc62cc3b106faceb17"),
},
"since": String("0x0"),
},
],
"outputs": Array [
Object {
"capacity": String("0x2540be400"),
"lock": Object {
"args": String("0x"),
"code_hash": String("0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5"),
"hash_type": String("data"),
},
"type": Null,
},
],
"outputs_data": Array [
String("0x"),
],
"version": String("0x0"),
"witnesses": Array [],
},
"tx_status": Object {
"block_hash": Null,
"reason": Null,
"status": String("pending"),
},
},
error: Null,
}
', rpc/src/tests/examples.rs:560:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtracehttps://github.com/nervosnetwork/ckb/actions/runs/4786689804/jobs/8510943774 It's hard to let this RPC pass
|
doitian
approved these changes
Apr 25, 2023
zhangsoledad
approved these changes
Apr 25, 2023
Closed
This was referenced May 8, 2023
This was referenced Aug 1, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #3938
Problem Summary:
What is changed and how it works?
What's Changed:
Related changes
time_added_to_poolfield toTransactionWithStatusCheck List
Tests
Side effects
Release note