Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
fb8c1d26
Commit
fb8c1d26
authored
2 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
(cli) Rename tx command to transfer (
#436
)
parent
75114cb4
No related branches found
No related tags found
No related merge requests found
Pipeline
#17437
passed
2 years ago
Stage: checks
Stage: tests
Stage: package
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
silkaj/money/transfer.py
+1
-1
1 addition, 1 deletion
silkaj/money/transfer.py
tests/money/test_transfer.py
+1
-1
1 addition, 1 deletion
tests/money/test_transfer.py
tests/money/test_transfer_cli.py
+15
-15
15 additions, 15 deletions
tests/money/test_transfer_cli.py
with
17 additions
and
17 deletions
silkaj/money/transfer.py
+
1
−
1
View file @
fb8c1d26
...
...
@@ -59,7 +59,7 @@ MAX_OUTPUTS = 93
NBR_ISSUERS
=
1
@click.command
(
"
t
x
"
,
help
=
"
Send transaction
"
)
@click.command
(
"
t
ransfer
"
,
help
=
"
Transfer money
"
)
@click.option
(
"
amounts
"
,
"
--amount
"
,
...
...
This diff is collapsed.
Click to expand it.
tests/money/test_transfer.py
+
1
−
1
View file @
fb8c1d26
...
...
@@ -1060,7 +1060,7 @@ def compute_test_amounts(amounts, mult):
def
construct_args
(
amounts
,
amountsud
,
allsources
,
recipients
,
comment
,
outputbackchange
,
yes
):
args_list
=
[
"
t
x
"
]
args_list
=
[
"
t
ransfer
"
]
if
yes
:
args_list
.
append
(
"
--yes
"
)
if
amounts
:
...
...
This diff is collapsed.
Click to expand it.
tests/money/test_transfer_cli.py
+
15
−
15
View file @
fb8c1d26
...
...
@@ -122,42 +122,42 @@ def test_transaction_amount_errors(
def
test_tx_passed_amount_cli
():
# One option
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amount
"
,
"
1
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--amount
"
,
"
1
"
])
assert
"
Error: A recipient should be passed
\n
"
in
result
.
output
assert
result
.
exit_code
==
1
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amountUD
"
,
"
1
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--amountUD
"
,
"
1
"
])
assert
"
Error: A recipient should be passed
\n
"
in
result
.
output
assert
result
.
exit_code
==
1
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--allSources
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--allSources
"
])
assert
"
Error: A recipient should be passed
\n
"
in
result
.
output
assert
result
.
exit_code
==
1
# Multiple options
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amount
"
,
1
,
"
--amountUD
"
,
1
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--amount
"
,
1
,
"
--amountUD
"
,
1
])
assert
"
Error: Usage
"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amount
"
,
1
,
"
--allSources
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--amount
"
,
1
,
"
--allSources
"
])
assert
"
Error: Usage
"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amountUD
"
,
1
,
"
--allSources
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
--amountUD
"
,
1
,
"
--allSources
"
])
assert
"
Error: Usage
"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
--amount
"
,
1
,
"
--amountUD
"
,
1
,
"
--allSources
"
]
cli
,
[
"
t
ransfer
"
,
"
--amount
"
,
1
,
"
--amountUD
"
,
1
,
"
--allSources
"
]
)
assert
"
Error: Usage
"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
])
assert
"
Error: amount, amountUD or allSources is not set.
"
in
result
.
output
assert
result
.
exit_code
==
FAILURE_EXIT_STATUS
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
,
"
-r
"
,
"
B
"
,
"
--allSources
"
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
,
"
-r
"
,
"
B
"
,
"
--allSources
"
])
assert
(
"
Error: the --allSources option can only be used with one recipient.
"
in
result
.
output
...
...
@@ -165,18 +165,18 @@ def test_tx_passed_amount_cli():
assert
result
.
exit_code
==
FAILURE_EXIT_STATUS
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
,
"
-a
"
,
MINIMAL_ABSOLUTE_TX_AMOUNT
-
0.001
]
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
,
"
-a
"
,
MINIMAL_ABSOLUTE_TX_AMOUNT
-
0.001
]
)
assert
"
Error: Invalid value for
'
--amount
'"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
,
"
-d
"
,
MINIMAL_RELATIVE_TX_AMOUNT
-
0.0000001
]
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
,
"
-d
"
,
MINIMAL_RELATIVE_TX_AMOUNT
-
0.0000001
]
)
assert
"
Error: Invalid value for
'
--amountUD
'"
in
result
.
output
assert
result
.
exit_code
==
2
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
,
"
-a
"
,
1
,
"
-a
"
,
2
])
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
,
"
-a
"
,
1
,
"
-a
"
,
2
])
assert
(
"
Error: The number of passed recipients is not the same as the passed amounts.
"
in
result
.
output
...
...
@@ -184,7 +184,7 @@ def test_tx_passed_amount_cli():
assert
result
.
exit_code
==
FAILURE_EXIT_STATUS
result
=
CliRunner
().
invoke
(
cli
,
[
"
t
x
"
,
"
-r
"
,
"
A
"
,
"
-r
"
,
"
B
"
,
"
-r
"
,
"
C
"
,
"
-a
"
,
1
,
"
-a
"
,
2
]
cli
,
[
"
t
ransfer
"
,
"
-r
"
,
"
A
"
,
"
-r
"
,
"
B
"
,
"
-r
"
,
"
C
"
,
"
-a
"
,
1
,
"
-a
"
,
2
]
)
assert
(
"
Error: The number of passed recipients is not the same as the passed amounts.
"
...
...
@@ -197,12 +197,12 @@ def test_tx_passed_amount_cli():
"
arguments, auth_method, is_account_filled
"
,
[
(
[
"
t
x
"
,
"
--allSources
"
,
"
-r
"
,
"
A
"
*
PUBKEY_MIN_LENGTH
],
[
"
t
ransfer
"
,
"
--allSources
"
,
"
-r
"
,
"
A
"
*
PUBKEY_MIN_LENGTH
],
patched_auth_method_truc
,
False
,
),
(
[
"
t
x
"
,
"
--allSources
"
,
"
-r
"
,
"
A
"
*
PUBKEY_MIN_LENGTH
],
[
"
t
ransfer
"
,
"
--allSources
"
,
"
-r
"
,
"
A
"
*
PUBKEY_MIN_LENGTH
],
patched_auth_method_riri
,
True
,
),
...
...
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