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
Merge requests
!11
Changes specific to HF25 done in
https://github.com/holgern/beem
master branch
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Changes specific to HF25 done in
https://github.com/holgern/beem
master branch
bw_holgern2gitlab_master
into
master
Overview
0
Commits
13
Pipelines
0
Changes
1
Merged
Bartek Wrona
requested to merge
bw_holgern2gitlab_master
into
master
2 years ago
Overview
0
Commits
13
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
7551f6b0
Prev
Next
Show latest version
1 file
+
32
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Unverified
7551f6b0
added a method for the account class for the new convert op
· 7551f6b0
Isaiah Croatt
authored
3 years ago
beem/account.py
+
32
−
0
Options
@@ -3000,6 +3000,38 @@ class Account(BlockchainObject):
return
self
.
blockchain
.
finalizeOp
(
op
,
account
,
"
active
"
)
#Added to differentiate and match the addition of the HF25 convert operation
def
collateralized_convert
(
self
,
amount
,
account
=
None
,
request_id
=
None
,
**
kwargs
):
"""
Convert Hive dollars to Hive (this method is meant to be more instant)
and reflect the method added in HF25
:param float amount: amount of SBD to convert
:param str account: (optional) the source account for the transfer
if not ``default_account``
:param str request_id: (optional) identifier for tracking the
conversion`
"""
if
account
is
None
:
account
=
self
else
:
account
=
Account
(
account
,
blockchain_instance
=
self
.
blockchain
)
amount
=
self
.
_check_amount
(
amount
,
self
.
blockchain
.
backed_token_symbol
)
if
request_id
:
request_id
=
int
(
request_id
)
else
:
request_id
=
random
.
getrandbits
(
32
)
op
=
operations
.
Collateralized_convert
(
**
{
"
owner
"
:
account
[
"
name
"
],
"
requestid
"
:
request_id
,
"
amount
"
:
amount
,
"
prefix
"
:
self
.
blockchain
.
prefix
,
"
json_str
"
:
not
bool
(
self
.
blockchain
.
config
[
"
use_condenser
"
]),
})
return
self
.
blockchain
.
finalizeOp
(
op
,
account
,
"
active
"
,
**
kwargs
)
def
transfer_to_savings
(
self
,
amount
,
asset
,
memo
,
to
=
None
,
account
=
None
,
**
kwargs
):
"""
Transfer SBD or STEEM into a
'
savings
'
account.
Loading