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
09634103
Commit
09634103
authored
4 years ago
by
Holger
Browse files
Options
Downloads
Patches
Plain Diff
Improve hybrid operation in operations (pre / post HF 24 operation are supported)
parent
920efb86
No related branches found
No related tags found
2 merge requests
!5
Taken current version of master branch in the https://github.com/holgern/beem
,
!4
Original changes pushed to master at https://github.com/holgern/beem
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
beembase/operations.py
+22
-29
22 additions, 29 deletions
beembase/operations.py
with
23 additions
and
29 deletions
CHANGELOG.rst
+
1
−
0
View file @
09634103
...
...
@@ -3,6 +3,7 @@ Changelog
0.24.22
-------
* Fix to parameter in transfer_to_vesting
* Allow hybrid operation in operations (pre / post HF 24 operation are supported)
0.24.21
-------
...
...
This diff is collapsed.
Click to expand it.
beembase/operations.py
+
22
−
29
View file @
09634103
...
...
@@ -440,22 +440,16 @@ class Witness_set_properties(GrapheneObject):
is_hex
=
False
if
isinstance
(
k
[
1
],
int
)
and
k
[
0
]
in
[
"
account_subsidy_budget
"
,
"
account_subsidy_decay
"
,
"
maximum_block_size
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Uint32
(
k
[
1
]).
__bytes__
())).
decode
()
elif
isinstance
(
k
[
1
],
int
)
and
k
[
0
]
in
[
"
sbd_interest_rate
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Uint16
(
k
[
1
]).
__bytes__
())).
decode
()
elif
isinstance
(
k
[
1
],
int
)
and
k
[
0
]
in
[
"
hbd_interest_rate
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Uint16
(
k
[
1
]).
__bytes__
())).
decode
()
elif
isinstance
(
k
[
1
],
int
)
and
k
[
0
]
in
[
"
sbd_interest_rate
"
,
"
hbd_interest_rate
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Uint16
(
k
[
1
]).
__bytes__
())).
decode
()
elif
not
isinstance
(
k
[
1
],
str
)
and
k
[
0
]
in
[
"
account_creation_fee
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Amount
(
k
[
1
],
prefix
=
prefix
,
json_str
=
json_str
).
__bytes__
())).
decode
()
elif
not
is_hex
and
isinstance
(
k
[
1
],
str
)
and
k
[
0
]
in
[
"
account_creation_fee
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
Amount
(
k
[
1
],
prefix
=
prefix
,
json_str
=
json_str
).
__bytes__
())).
decode
()
elif
not
isinstance
(
k
[
1
],
str
)
and
k
[
0
]
in
[
"
sbd_exchange_rate
"
]:
elif
not
isinstance
(
k
[
1
],
str
)
and
k
[
0
]
in
[
"
sbd_exchange_rate
"
,
"
hbd_exchange_rate
"
]:
if
'
prefix
'
not
in
k
[
1
]:
k
[
1
][
'
prefix
'
]
=
prefix
props
[
k
[
0
]]
=
(
hexlify
(
ExchangeRate
(
k
[
1
]).
__bytes__
())).
decode
()
elif
not
isinstance
(
k
[
1
],
str
)
and
k
[
0
]
in
[
"
hbd_exchange_rate
"
]:
if
'
prefix
'
not
in
k
[
1
]:
k
[
1
][
'
prefix
'
]
=
prefix
props
[
k
[
0
]]
=
(
hexlify
(
ExchangeRate
(
k
[
1
]).
__bytes__
())).
decode
()
props
[
k
[
0
]]
=
(
hexlify
(
ExchangeRate
(
k
[
1
]).
__bytes__
())).
decode
()
elif
not
is_hex
and
k
[
0
]
in
[
"
url
"
]:
props
[
k
[
0
]]
=
(
hexlify
(
String
(
k
[
1
]).
__bytes__
())).
decode
()
else
:
...
...
@@ -569,15 +563,15 @@ class Comment_options(GrapheneObject):
extensions
=
Array
([])
if
"
extensions
"
in
kwargs
and
kwargs
[
"
extensions
"
]:
extensions
=
Array
([
CommentOptionExtensions
(
o
)
for
o
in
kwargs
[
"
extensions
"
]])
if
"
percent_
steem_dollars
"
in
kwargs
:
if
"
percent_
hbd
"
in
kwargs
:
super
(
Comment_options
,
self
).
__init__
(
OrderedDict
([
(
'
author
'
,
String
(
kwargs
[
"
author
"
])),
(
'
permlink
'
,
String
(
kwargs
[
"
permlink
"
])),
(
'
max_accepted_payout
'
,
Amount
(
kwargs
[
"
max_accepted_payout
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
percent_
steem_dollars
'
,
Uint16
(
int
(
kwargs
[
"
percent_
steem_dollars
"
]))),
(
'
percent_
hbd
'
,
Uint16
(
int
(
kwargs
[
"
percent_
hbd
"
]))),
(
'
allow_votes
'
,
Bool
(
bool
(
kwargs
[
"
allow_votes
"
]))),
(
'
allow_curation_rewards
'
,
Bool
(
bool
(
kwargs
[
"
allow_curation_rewards
"
]))),
...
...
@@ -590,8 +584,8 @@ class Comment_options(GrapheneObject):
(
'
permlink
'
,
String
(
kwargs
[
"
permlink
"
])),
(
'
max_accepted_payout
'
,
Amount
(
kwargs
[
"
max_accepted_payout
"
],
prefix
=
prefix
)),
(
'
percent_
hbd
'
,
Uint16
(
int
(
kwargs
[
"
percent_
hbd
"
]))),
(
'
percent_
steem_dollars
'
,
Uint16
(
int
(
kwargs
[
"
percent_
steem_dollars
"
]))),
(
'
allow_votes
'
,
Bool
(
bool
(
kwargs
[
"
allow_votes
"
]))),
(
'
allow_curation_rewards
'
,
Bool
(
bool
(
kwargs
[
"
allow_curation_rewards
"
]))),
...
...
@@ -619,7 +613,6 @@ class Feed_publish(GrapheneObject):
if
len
(
args
)
==
1
and
len
(
kwargs
)
==
0
:
kwargs
=
args
[
0
]
prefix
=
kwargs
.
get
(
"
prefix
"
,
default_prefix
)
json_str
=
kwargs
.
get
(
"
json_str
"
,
False
)
if
'
prefix
'
not
in
kwargs
[
'
exchange_rate
'
]:
kwargs
[
'
exchange_rate
'
][
'
prefix
'
]
=
prefix
super
(
Feed_publish
,
self
).
__init__
(
...
...
@@ -847,18 +840,18 @@ class Claim_reward_balance(GrapheneObject):
(
'
reward_hbd
'
,
Amount
(
kwargs
[
"
reward_hbd
"
],
prefix
=
prefix
)),
(
'
reward_vests
'
,
Amount
(
kwargs
[
"
reward_vests
"
],
prefix
=
prefix
)),
]))
elif
"
reward_
steem
"
in
kwargs
:
elif
"
reward_
hive
"
in
kwargs
:
super
(
Claim_reward_balance
,
self
).
__init__
(
OrderedDict
([
(
'
account
'
,
String
(
kwargs
[
"
account
"
])),
(
'
reward_
steem
'
,
Amount
(
kwargs
[
"
reward_
steem
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
reward_
hive
'
,
Amount
(
kwargs
[
"
reward_
hive
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
reward_vests
'
,
Amount
(
kwargs
[
"
reward_vests
"
],
prefix
=
prefix
)),
]))
else
:
super
(
Claim_reward_balance
,
self
).
__init__
(
OrderedDict
([
(
'
account
'
,
String
(
kwargs
[
"
account
"
])),
(
'
reward_
hive
'
,
Amount
(
kwargs
[
"
reward_
hive
"
],
prefix
=
prefix
)),
(
'
reward_
steem
'
,
Amount
(
kwargs
[
"
reward_
steem
"
],
prefix
=
prefix
)),
(
'
reward_vests
'
,
Amount
(
kwargs
[
"
reward_vests
"
],
prefix
=
prefix
)),
]))
...
...
@@ -931,15 +924,15 @@ class Escrow_transfer(GrapheneObject):
meta
=
json
.
dumps
(
kwargs
[
"
json_meta
"
])
else
:
meta
=
kwargs
[
"
json_meta
"
]
if
"
s
bd_amount
"
in
kwargs
and
"
steem
_amount
"
in
kwargs
:
if
"
h
bd_amount
"
in
kwargs
and
"
hive
_amount
"
in
kwargs
:
super
(
Escrow_transfer
,
self
).
__init__
(
OrderedDict
([
(
'
from
'
,
String
(
kwargs
[
"
from
"
])),
(
'
to
'
,
String
(
kwargs
[
"
to
"
])),
(
'
agent
'
,
String
(
kwargs
[
"
agent
"
])),
(
'
escrow_id
'
,
Uint32
(
kwargs
[
"
escrow_id
"
])),
(
'
s
bd_amount
'
,
Amount
(
kwargs
[
"
s
bd_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
steem
_amount
'
,
Amount
(
kwargs
[
"
steem
_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
h
bd_amount
'
,
Amount
(
kwargs
[
"
h
bd_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
hive
_amount
'
,
Amount
(
kwargs
[
"
hive
_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
fee
'
,
Amount
(
kwargs
[
"
fee
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
ratification_deadline
'
,
PointInTime
(
kwargs
[
"
ratification_deadline
"
])),
(
'
escrow_expiration
'
,
PointInTime
(
kwargs
[
"
escrow_expiration
"
])),
...
...
@@ -952,8 +945,8 @@ class Escrow_transfer(GrapheneObject):
(
'
to
'
,
String
(
kwargs
[
"
to
"
])),
(
'
agent
'
,
String
(
kwargs
[
"
agent
"
])),
(
'
escrow_id
'
,
Uint32
(
kwargs
[
"
escrow_id
"
])),
(
'
h
bd_amount
'
,
Amount
(
kwargs
[
"
h
bd_amount
"
],
prefix
=
prefix
)),
(
'
hive
_amount
'
,
Amount
(
kwargs
[
"
hive
_amount
"
],
prefix
=
prefix
)),
(
'
s
bd_amount
'
,
Amount
(
kwargs
[
"
s
bd_amount
"
],
prefix
=
prefix
)),
(
'
steem
_amount
'
,
Amount
(
kwargs
[
"
steem
_amount
"
],
prefix
=
prefix
)),
(
'
fee
'
,
Amount
(
kwargs
[
"
fee
"
],
prefix
=
prefix
)),
(
'
ratification_deadline
'
,
PointInTime
(
kwargs
[
"
ratification_deadline
"
])),
(
'
escrow_expiration
'
,
PointInTime
(
kwargs
[
"
escrow_expiration
"
])),
...
...
@@ -984,15 +977,15 @@ class Escrow_release(GrapheneObject):
kwargs
=
args
[
0
]
prefix
=
kwargs
.
get
(
"
prefix
"
,
default_prefix
)
json_str
=
kwargs
.
get
(
"
json_str
"
,
False
)
if
"
steem
_amount
"
in
kwargs
and
"
s
bd_amount
"
in
kwargs
:
if
"
hive
_amount
"
in
kwargs
and
"
h
bd_amount
"
in
kwargs
:
super
(
Escrow_release
,
self
).
__init__
(
OrderedDict
([
(
'
from
'
,
String
(
kwargs
[
"
from
"
])),
(
'
to
'
,
String
(
kwargs
[
"
to
"
])),
(
'
who
'
,
String
(
kwargs
[
"
who
"
])),
(
'
escrow_id
'
,
Uint32
(
kwargs
[
"
escrow_id
"
])),
(
'
s
bd_amount
'
,
Amount
(
kwargs
[
"
s
bd_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
steem
_amount
'
,
Amount
(
kwargs
[
"
steem
_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
h
bd_amount
'
,
Amount
(
kwargs
[
"
h
bd_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
(
'
hive
_amount
'
,
Amount
(
kwargs
[
"
hive
_amount
"
],
prefix
=
prefix
,
json_str
=
json_str
)),
]))
else
:
super
(
Escrow_release
,
self
).
__init__
(
...
...
@@ -1001,8 +994,8 @@ class Escrow_release(GrapheneObject):
(
'
to
'
,
String
(
kwargs
[
"
to
"
])),
(
'
who
'
,
String
(
kwargs
[
"
who
"
])),
(
'
escrow_id
'
,
Uint32
(
kwargs
[
"
escrow_id
"
])),
(
'
h
bd_amount
'
,
Amount
(
kwargs
[
"
h
bd_amount
"
],
prefix
=
prefix
)),
(
'
hive
_amount
'
,
Amount
(
kwargs
[
"
hive
_amount
"
],
prefix
=
prefix
)),
(
'
s
bd_amount
'
,
Amount
(
kwargs
[
"
s
bd_amount
"
],
prefix
=
prefix
)),
(
'
steem
_amount
'
,
Amount
(
kwargs
[
"
steem
_amount
"
],
prefix
=
prefix
)),
]))
...
...
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