Commit 834f271e authored by Benoit Lavenier's avatar Benoit Lavenier

[enh] Rename humanTime

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