Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gva-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benoit Lavenier
gva-api
Commits
834f271e
Commit
834f271e
authored
5 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[enh] Rename humanTime
parent
d9d236c3
No related branches found
No related tags found
No related merge requests found
Pipeline
#7368
failed
5 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/gva.ts
+2
-2
2 additions, 2 deletions
src/gva.ts
src/schema.graphql
+3
-1
3 additions, 1 deletion
src/schema.graphql
src/types.ts
+11
-3
11 additions, 3 deletions
src/types.ts
with
16 additions
and
6 deletions
src/gva.ts
+
2
−
2
View file @
834f271e
...
@@ -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 na
me
commonTime
:
block
.
medianTi
me
,
commo
nTime
:
async
()
=>
{
huma
nTime
:
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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/schema.graphql
+
3
−
1
View file @
834f271e
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
src/types.ts
+
11
−
3
View file @
834f271e
...
@@ -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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment