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
d7c8a7c4
Commit
d7c8a7c4
authored
6 years ago
by
crokkon
Browse files
Options
Downloads
Patches
Plain Diff
witness.py: using generic asset symbol names
parent
ad12c4b7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beem/witness.py
+7
-6
7 additions, 6 deletions
beem/witness.py
with
7 additions
and
6 deletions
beem/witness.py
+
7
−
6
View file @
d7c8a7c4
...
...
@@ -117,15 +117,16 @@ class Witness(BlockchainObject):
def
feed_publish
(
self
,
base
,
quote
=
"
1.000 STEEM
"
,
quote
=
None
,
account
=
None
):
"""
Publish a feed price as a witness.
:param float base: USD Price of STEEM in SBD (implied price)
:param float quote: (optional) Quote Price. Should be 1.000, unless
:param float quote: (optional) Quote Price. Should be 1.000
(default)
, unless
we are adjusting the feed to support the peg.
:param str account: (optional) the source account for the transfer
if not self[
"
owner
"
]
"""
quote
=
quote
if
quote
is
not
None
else
"
1.000 %s
"
%
(
self
.
steem
.
symbol
)
if
not
account
:
account
=
self
[
"
owner
"
]
if
not
account
:
...
...
@@ -137,18 +138,18 @@ class Witness(BlockchainObject):
elif
isinstance
(
base
,
string_types
):
base
=
Amount
(
base
,
steem_instance
=
self
.
steem
)
else
:
base
=
Amount
(
base
,
"
SBD
"
,
steem_instance
=
self
.
steem
)
base
=
Amount
(
base
,
self
.
steem
.
sbd_symbol
,
steem_instance
=
self
.
steem
)
if
isinstance
(
quote
,
Amount
):
quote
=
Amount
(
quote
,
steem_instance
=
self
.
steem
)
elif
isinstance
(
quote
,
string_types
):
quote
=
Amount
(
quote
,
steem_instance
=
self
.
steem
)
else
:
quote
=
Amount
(
quote
,
"
STEEM
"
,
steem_instance
=
self
.
steem
)
quote
=
Amount
(
quote
,
self
.
steem
.
steem_symbol
,
steem_instance
=
self
.
steem
)
if
not
base
.
symbol
==
"
SBD
"
:
if
not
base
.
symbol
==
self
.
steem
.
sbd_symbol
:
raise
AssertionError
()
if
not
quote
.
symbol
==
"
STEEM
"
:
if
not
quote
.
symbol
==
self
.
steem
.
steem_symbol
:
raise
AssertionError
()
op
=
operations
.
Feed_publish
(
...
...
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