Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
113feaee
Commit
113feaee
authored
7 years ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
[fix]
#1037
Rules files not deleted
parent
869662e1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/rules/helpers.js
+0
-10
0 additions, 10 deletions
app/lib/rules/helpers.js
app/lib/rules/index.js
+0
-90
0 additions, 90 deletions
app/lib/rules/index.js
with
0 additions
and
100 deletions
app/lib/rules/helpers.js
deleted
100644 → 0
+
0
−
10
View file @
869662e1
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
common
=
require
(
'
duniter-common
'
);
const
constants
=
common
.
constants
;
function
maxAcceleration
(
conf
)
{
let
maxGenTime
=
Math
.
ceil
(
conf
.
avgGenTime
*
constants
.
POW_DIFFICULTY_RANGE_RATIO
);
return
Math
.
ceil
(
maxGenTime
*
conf
.
medianTimeBlocks
);
}
exports
.
maxAcceleration
=
maxAcceleration
;
//# sourceMappingURL=helpers.js.map
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/lib/rules/index.js
deleted
100644 → 0
+
0
−
90
View file @
869662e1
"
use strict
"
;
var
__awaiter
=
(
this
&&
this
.
__awaiter
)
||
function
(
thisArg
,
_arguments
,
P
,
generator
)
{
return
new
(
P
||
(
P
=
Promise
))(
function
(
resolve
,
reject
)
{
function
fulfilled
(
value
)
{
try
{
step
(
generator
.
next
(
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
rejected
(
value
)
{
try
{
step
(
generator
[
"
throw
"
](
value
));
}
catch
(
e
)
{
reject
(
e
);
}
}
function
step
(
result
)
{
result
.
done
?
resolve
(
result
.
value
)
:
new
P
(
function
(
resolve
)
{
resolve
(
result
.
value
);
}).
then
(
fulfilled
,
rejected
);
}
step
((
generator
=
generator
.
apply
(
thisArg
,
_arguments
||
[])).
next
());
});
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
local_rules_1
=
require
(
"
./local_rules
"
);
const
common
=
require
(
'
duniter-common
'
);
const
Block
=
common
.
document
.
Block
;
exports
.
ALIAS
=
{
ALL_LOCAL
:
(
block
,
conf
,
index
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkParameters
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkProofOfWork
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkInnerHash
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPreviousHash
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPreviousIssuer
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkUnitBase
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkBlockSignature
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkBlockTimes
(
block
,
conf
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesSignature
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesUserIDConflict
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesPubkeyConflict
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesMatchJoin
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkMembershipUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkRevokedUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkRevokedAreExcluded
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkMembershipsSignature
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPubkeyUnicity
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationOneByIssuer
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationIsntForLeaverOrExcluded
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxVersion
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxIssuers
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxSources
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxRecipients
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxAmounts
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxSignature
(
block
);
}),
ALL_LOCAL_BUT_POW_AND_SIGNATURE
:
(
block
,
conf
,
index
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkParameters
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkInnerHash
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPreviousHash
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPreviousIssuer
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkUnitBase
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkBlockTimes
(
block
,
conf
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesSignature
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesUserIDConflict
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesPubkeyConflict
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkIdentitiesMatchJoin
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkMembershipUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkRevokedUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkRevokedAreExcluded
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkMembershipsSignature
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkPubkeyUnicity
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationOneByIssuer
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationUnicity
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkCertificationIsntForLeaverOrExcluded
(
block
,
conf
,
index
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxVersion
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxIssuers
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxSources
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxRecipients
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxAmounts
(
block
);
yield
local_rules_1
.
LOCAL_RULES_FUNCTIONS
.
checkTxSignature
(
block
);
})
};
exports
.
CHECK
=
{
ASYNC
:
{
ALL_LOCAL
:
checkLocal
(
exports
.
ALIAS
.
ALL_LOCAL
),
ALL_LOCAL_BUT_POW
:
checkLocal
(
exports
.
ALIAS
.
ALL_LOCAL_BUT_POW_AND_SIGNATURE
)
}
};
function
checkLocal
(
contract
)
{
return
(
b
,
conf
,
index
,
done
=
undefined
)
=>
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
try
{
const
block
=
Block
.
fromJSON
(
b
);
yield
contract
(
block
,
conf
,
index
);
done
&&
done
();
}
catch
(
err
)
{
if
(
done
)
return
done
(
err
);
throw
err
;
}
});
}
//# sourceMappingURL=index.js.map
\ No newline at end of file
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