Skip to content
Snippets Groups Projects
Commit 834f271e authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[enh] Rename humanTime

parent d9d236c3
No related branches found
No related tags found
No related merge requests found
Pipeline #7368 failed
...@@ -61,8 +61,8 @@ export function plugModule(server: Server, logger?: any) { ...@@ -61,8 +61,8 @@ export function plugModule(server: Server, logger?: any) {
if (!block) return null; if (!block) return null;
return { return {
...block, ...block,
// TODO make sure this is the final RFC name commonTime: block.medianTime,
commonTime: async () => { humanTime: async () => {
const parameters = await server.dal.getParameters(); const parameters = await server.dal.getParameters();
return parameters && (block.medianTime + (parameters.avgGenTime * parameters.medianTimeBlocks / 2)) || null; return parameters && (block.medianTime + (parameters.avgGenTime * parameters.medianTimeBlocks / 2)) || null;
} }
......
...@@ -220,7 +220,8 @@ type Block { ...@@ -220,7 +220,8 @@ type Block {
excluded: [String!]! excluded: [String!]!
certifications: [String!]! certifications: [String!]!
transactions: [BlockTransaction!]! transactions: [BlockTransaction!]!
medianTime: Int!
medianTime: Int! @deprecated(reason: "Use `commonTime`.")
nonce: String! nonce: String!
parameters: String! parameters: String!
monetaryMass: Int! monetaryMass: Int!
...@@ -230,6 +231,7 @@ type Block { ...@@ -230,6 +231,7 @@ type Block {
written_on: String! written_on: String!
commonTime: Int! commonTime: Int!
humanTime: Int!
} }
type BlockchainParameters { type BlockchainParameters {
......
...@@ -6,13 +6,21 @@ export declare class Block { ...@@ -6,13 +6,21 @@ export declare class Block {
// Block time // Block time
time: number; time: number;
// Block median time /**
* Block median time
* @Deprecated use commonTime
*/
medianTime: number; medianTime: number;
// commonTime = medianTime + (avgGenTime * medianTimeBlocks / 2) /**
// TODO check the RFC final name * Blockchain (average) time
*/
commonTime: number; commonTime: number;
// humanTime = medianTime + (avgGenTime * medianTimeBlocks / 2)
// TODO check the RFC final name
humanTime: number;
// TODO: check if define in the RFC // TODO: check if define in the RFC
issuerName: string; issuerName: string;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment