Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
cd0772f8
Commit
cd0772f8
authored
8 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Compatibility with duniterpy 0.30
parent
2d5e95dd
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
src/sakia/core/wallet.py
+5
-4
5 additions, 4 deletions
src/sakia/core/wallet.py
with
5 additions
and
4 deletions
src/sakia/core/wallet.py
+
5
−
4
View file @
cd0772f8
...
@@ -206,7 +206,7 @@ class Wallet(QObject):
...
@@ -206,7 +206,7 @@ class Wallet(QObject):
"""
"""
inputs
=
[]
inputs
=
[]
for
s
in
sources
:
for
s
in
sources
:
inputs
.
append
(
InputSource
(
s
[
'
type
'
],
s
[
'
identifier
'
],
s
[
'
noffset
'
]))
inputs
.
append
(
InputSource
(
None
,
None
,
s
[
'
type
'
],
s
[
'
identifier
'
],
s
[
'
noffset
'
]))
return
inputs
return
inputs
def
tx_unlocks
(
self
,
sources
):
def
tx_unlocks
(
self
,
sources
):
...
@@ -248,10 +248,11 @@ class Wallet(QObject):
...
@@ -248,10 +248,11 @@ class Wallet(QObject):
outputs
.
append
(
OutputSource
(
overhead
,
overhead_base
,
output
.
Condition
.
token
(
output
.
SIG
.
token
(
self
.
pubkey
))))
outputs
.
append
(
OutputSource
(
overhead
,
overhead_base
,
output
.
Condition
.
token
(
output
.
SIG
.
token
(
self
.
pubkey
))))
return
outputs
return
outputs
def
prepare_tx
(
self
,
pubkey
,
amount
,
message
,
community
):
def
prepare_tx
(
self
,
pubkey
,
blockstamp
,
amount
,
message
,
community
):
"""
"""
Prepare a simple Transaction document
Prepare a simple Transaction document
:param str pubkey: the target of the transaction
:param str pubkey: the target of the transaction
:param duniterpy.documents.BlockUID blockstamp: the blockstamp
:param int amount: the amount sent to the receiver
:param int amount: the amount sent to the receiver
:param Community community: the target community
:param Community community: the target community
:return: the transaction document
:return: the transaction document
...
@@ -266,7 +267,7 @@ class Wallet(QObject):
...
@@ -266,7 +267,7 @@ class Wallet(QObject):
unlocks
=
self
.
tx_unlocks
(
sources
)
unlocks
=
self
.
tx_unlocks
(
sources
)
outputs
=
self
.
tx_outputs
(
pubkey
,
amount
,
sources
)
outputs
=
self
.
tx_outputs
(
pubkey
,
amount
,
sources
)
logging
.
debug
(
"
Outputs : {0}
"
.
format
(
outputs
))
logging
.
debug
(
"
Outputs : {0}
"
.
format
(
outputs
))
tx
=
Transaction
(
PROTOCOL_VERSION
,
community
.
currency
,
0
,
tx
=
Transaction
(
PROTOCOL_VERSION
,
community
.
currency
,
blockstamp
,
0
,
[
self
.
pubkey
],
inputs
,
unlocks
,
[
self
.
pubkey
],
inputs
,
unlocks
,
outputs
,
message
,
None
)
outputs
,
message
,
None
)
return
tx
return
tx
...
@@ -324,7 +325,7 @@ class Wallet(QObject):
...
@@ -324,7 +325,7 @@ class Wallet(QObject):
transfer
=
Transfer
.
initiate
(
metadata
)
transfer
=
Transfer
.
initiate
(
metadata
)
self
.
caches
[
community
.
currency
].
_transfers
.
append
(
transfer
)
self
.
caches
[
community
.
currency
].
_transfers
.
append
(
transfer
)
try
:
try
:
tx
=
self
.
prepare_tx
(
recipient
,
amount
,
message
,
community
)
tx
=
self
.
prepare_tx
(
recipient
,
blockUID
,
amount
,
message
,
community
)
logging
.
debug
(
"
TX : {0}
"
.
format
(
tx
.
raw
()))
logging
.
debug
(
"
TX : {0}
"
.
format
(
tx
.
raw
()))
tx
.
sign
([
key
])
tx
.
sign
([
key
])
...
...
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