Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
0bf406d9
Commit
0bf406d9
authored
8 years ago
by
Benjamin Bollen
Browse files
Options
Downloads
Patches
Plain Diff
make AssertCompatibleConsensus return error instead of bool
parent
1d741294
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
manager/eris-mint/eris-mint_test.go
+1
-3
1 addition, 3 deletions
manager/eris-mint/eris-mint_test.go
manager/eris-mint/version.go
+6
-3
6 additions, 3 deletions
manager/eris-mint/version.go
manager/manager.go
+3
-1
3 additions, 1 deletion
manager/manager.go
with
10 additions
and
7 deletions
manager/eris-mint/eris-mint_test.go
+
1
−
3
View file @
0bf406d9
...
@@ -28,8 +28,6 @@ func TestCompatibleConsensus(t *testing.T) {
...
@@ -28,8 +28,6 @@ func TestCompatibleConsensus(t *testing.T) {
// compatible consensus engine
// compatible consensus engine
for
_
,
listedConsensus
:=
range
compatibleConsensus
{
for
_
,
listedConsensus
:=
range
compatibleConsensus
{
assert
.
Equal
(
t
,
IsCompatibleConsensus
(
listedConsensus
),
true
,
assert
.
Nil
(
t
,
AssertCompatibleConsensus
(
listedConsensus
))
fmt
.
Sprintf
(
"ErisMint (%s) failed compatibility test with consensus %s"
,
GetErisMintVersion
(),
listedConsensus
))
}
}
}
}
This diff is collapsed.
Click to expand it.
manager/eris-mint/version.go
+
6
−
3
View file @
0bf406d9
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
package
erismint
package
erismint
import
(
import
(
"fmt"
version
"github.com/eris-ltd/eris-db/version"
version
"github.com/eris-ltd/eris-db/version"
)
)
...
@@ -43,11 +45,12 @@ func GetErisMintVersion() *version.VersionIdentifier {
...
@@ -43,11 +45,12 @@ func GetErisMintVersion() *version.VersionIdentifier {
erisMintVersionMinor
,
erisMintVersionPatch
)
erisMintVersionMinor
,
erisMintVersionPatch
)
}
}
func
Is
CompatibleConsensus
(
consensusMinorVersion
string
)
bool
{
func
Assert
CompatibleConsensus
(
consensusMinorVersion
string
)
error
{
for
_
,
supported
:=
range
compatibleConsensus
{
for
_
,
supported
:=
range
compatibleConsensus
{
if
consensusMinorVersion
==
supported
{
if
consensusMinorVersion
==
supported
{
return
true
return
nil
}
}
}
}
return
false
return
fmt
.
Errorf
(
"ErisMint (%s) is not compatible with consensus engine %s"
,
GetErisMintVersion
(),
consensusMinorVersion
)
}
}
This diff is collapsed.
Click to expand it.
manager/manager.go
+
3
−
1
View file @
0bf406d9
...
@@ -34,7 +34,9 @@ func NewApplication(moduleConfig *config.ModuleConfig,
...
@@ -34,7 +34,9 @@ func NewApplication(moduleConfig *config.ModuleConfig,
error
)
{
error
)
{
switch
moduleConfig
.
Name
{
switch
moduleConfig
.
Name
{
case
"erismint"
:
case
"erismint"
:
if
err
:=
erismint
.
AssertCompatibleConsensus
(
consensusMinorVersion
);
err
!=
nil
{
return
nil
,
err
}
return
newErisMintPH
(
moduleConfig
)
return
newErisMintPH
(
moduleConfig
)
}
}
return
nil
,
fmt
.
Errorf
(
"PLACEHOLDER"
)
return
nil
,
fmt
.
Errorf
(
"PLACEHOLDER"
)
...
...
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