-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
BTW, What's the best practice to support a rpc both for BlockNumber and Hash? |
substrate/primitives/rpc/src/number.rs Lines 33 to 40 in 4be5dd2
|
You don't know what downstream is doing. Having there |
Very strange, the hex is not about hash but block number( and if it's about block hash, it must be u256, could not be other. e.g. u512. Although u256 is main stream). |
Yeah you are right, I mixed this up. All RPCs also work with hash, besides the one that can give you a block number for a hash. In general, using hash is much better to address blocks to ensure that you are accessing the correct block. |
It's very easy for downstream to define a old The |
I think it's better to also derive |
If you give some better description than just "bad design", I'm okay with merging this. |
i don't know what you want to express There is no such word in the title. I can close this PR. I just think that BlockId can be integrated into many substrate and third parties RPCs in the future |
You are saying it is a bad design and I just want to understand why it is a bad design. Not more. |
Hi, I means it have no If someone did, I think it is also very bad, it should be kept in the same style as |
The BlockId serde is never used in substrate.
And I think it's a bad design. It could not be used in rpc api.