Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
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
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
hive
beem
Commits
9c42b2c8
Commit
9c42b2c8
authored
6 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
Fix unit tests
parent
362eea7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
beem/steem.py
+6
-0
6 additions, 0 deletions
beem/steem.py
tests/beem/test_steem.py
+1
-1
1 addition, 1 deletion
tests/beem/test_steem.py
tests/beem/test_testnet.py
+2
-2
2 additions, 2 deletions
tests/beem/test_testnet.py
with
9 additions
and
3 deletions
beem/steem.py
+
6
−
0
View file @
9c42b2c8
...
...
@@ -435,6 +435,8 @@ class Steem(object):
"""
Returns the block interval in seconds
"""
props
=
self
.
get_config
(
use_stored_data
=
use_stored_data
)
block_interval
=
3
if
props
is
None
:
return
block_interval
for
key
in
props
:
if
key
[
-
14
:]
==
"
BLOCK_INTERVAL
"
:
block_interval
=
props
[
key
]
...
...
@@ -445,6 +447,8 @@ class Steem(object):
"""
Returns the blockchain version
"""
props
=
self
.
get_config
(
use_stored_data
=
use_stored_data
)
blockchain_version
=
'
0.0.0
'
if
props
is
None
:
return
blockchain_version
for
key
in
props
:
if
key
[
-
18
:]
==
"
BLOCKCHAIN_VERSION
"
:
blockchain_version
=
props
[
key
]
...
...
@@ -454,6 +458,8 @@ class Steem(object):
"""
Returns the vote dust threshold
"""
props
=
self
.
get_config
(
use_stored_data
=
use_stored_data
)
dust_threshold
=
0
if
props
is
None
:
return
dust_threshold
for
key
in
props
:
if
key
[
-
20
:]
==
"
VOTE_DUST_THRESHOLD
"
:
dust_threshold
=
props
[
key
]
...
...
This diff is collapsed.
Click to expand it.
tests/beem/test_steem.py
+
1
−
1
View file @
9c42b2c8
...
...
@@ -472,7 +472,7 @@ class Testcases(unittest.TestCase):
def
test_sp_to_rshares
(
self
):
stm
=
self
.
bts
rshares
=
stm
.
sp_to_rshares
(
stm
.
vests_to_sp
(
1e6
))
self
.
assertTrue
(
abs
(
rshares
-
1995
0000000.0
)
<
2
)
self
.
assertTrue
(
abs
(
rshares
-
2000
0000000.0
)
<
2
)
def
test_rshares_to_vests
(
self
):
stm
=
self
.
bts
...
...
This diff is collapsed.
Click to expand it.
tests/beem/test_testnet.py
+
2
−
2
View file @
9c42b2c8
...
...
@@ -164,8 +164,8 @@ class Testcases(unittest.TestCase):
"
amount
"
:
Amount
(
"
0.01 STEEM
"
,
steem_instance
=
steem
),
"
memo
"
:
'
1 of 1 transaction
'
}))
self
.
assertEqual
(
tx
[
"
operations
"
][
0
][
0
],
"
transfer
"
tx
[
"
operations
"
][
0
][
"
type
"
],
"
transfer
_operation
"
)
tx
.
appendWif
(
self
.
active_key
)
tx
.
sign
()
...
...
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