Conversation
|
|
||
| ### Added | ||
|
|
||
| - Added createdAt timestamp to transaction, block, batch and settlement models.[#502](https://github.com/proto-kit/framework/pull/502) |
There was a problem hiding this comment.
In the future - let's add these to the bottom of the list s.t. PR numbers are ascending
| s: string; | ||
| }; | ||
| isMessage: boolean; | ||
| createdAt?: Date; |
There was a problem hiding this comment.
For Block, Batch and Settlement it makes sense to have a date - they are created at a specific point in time and that time has "meaning". Transactions only get their meaning by being included in a block and imo this should be the date we should in the explorer too.
Additionally, this date here can be freely set by the user the way it's implemented currently making it a bit though to rely on.
There was a problem hiding this comment.
So my suggestion would be to remove the createdAt from the transaction and only do it for block, batch, settlement. Then in the explorer we query the transaction's block and use that date
| proof: JsonProof; | ||
| blockHashes: string[]; | ||
| height: number; | ||
| createdAt: Date; |
There was a problem hiding this comment.
What do we think about making this a number and using Date.now()?
This would make serialization easier as it will not break the "json-serializable by default" property of these objects
… feat/add-timestamp-to-objects
Related to 10