Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parity-test-sync
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
parity
parity-test-sync
Commits
3cbaf64c
Commit
3cbaf64c
authored
9 years ago
by
Gav Wood
Browse files
Options
Downloads
Patches
Plain Diff
Beginnings of Ethash engine.
parent
648207d8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ethash.rs
+22
-0
22 additions, 0 deletions
src/ethash.rs
src/spec.rs
+1
-0
1 addition, 0 deletions
src/spec.rs
with
23 additions
and
0 deletions
src/ethash.rs
0 → 100644
+
22
−
0
View file @
3cbaf64c
use
engine
::
Engine
;
use
spec
::
Spec
;
use
evm_schedule
::
EvmSchedule
;
use
env_info
::
EnvInfo
;
/// Engine using Ethash proof-of-work consensus algorithm, suitable for Ethereum
/// mainnet chains in the Olympic, Frontier and Homestead eras.
pub
struct
Ethash
{
spec
:
Spec
,
}
impl
Ethash
{
pub
fn
new_boxed
(
spec
:
Spec
)
->
Box
<
Engine
>
{
Box
::
new
(
NullEngine
{
spec
:
spec
})
}
}
impl
Engine
for
NullEngine
{
fn
name
(
&
self
)
->
&
str
{
"Ethash"
}
fn
spec
(
&
self
)
->
&
Spec
{
&
self
.spec
}
fn
evm_schedule
(
&
self
,
_env_info
:
&
EnvInfo
)
->
EvmSchedule
{
EvmSchedule
::
new_frontier
()
}
}
This diff is collapsed.
Click to expand it.
src/spec.rs
+
1
−
0
View file @
3cbaf64c
...
...
@@ -93,6 +93,7 @@ impl Spec {
pub
fn
to_engine
(
self
)
->
Result
<
Box
<
Engine
>
,
EthcoreError
>
{
match
self
.engine_name
.as_ref
()
{
"NullEngine"
=>
Ok
(
NullEngine
::
new_boxed
(
self
)),
"Ethash"
=>
Ok
(
Ethash
::
new_boxed
(
self
)),
_
=>
Err
(
EthcoreError
::
UnknownName
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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