Skip to content

Commit

Permalink
[mktx] The tx file can now be "-" to print on stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
np committed Nov 19, 2014
1 parent 9f8f358 commit eadee16
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ mainArgs ("ec-int-modn":args) = interactArgsLn hx_ec_int_modn args
mainArgs ("ec-x":args) = interactArgsLn hx_ec_x args
mainArgs ("ec-y":args) = interactArgsLn hx_ec_y args

mainArgs ("mktx":file:args) = BS.writeFile (B8.unpack file) $ hx_mktx args
mainArgs ("mktx":file:args) = interactFileArgs hx_mktx file args
mainArgs ["sign-input",f,i,s] = hx_sign_input f i s
mainArgs ["set-input",f,i,s] = hx_set_input f i s
mainArgs ["validsig",f,i,s,sig] = hx_validsig f i s sig
Expand Down
42 changes: 42 additions & 0 deletions tests/sx-tuto-mktx-stdin-stdout.t/TESTRECIPE
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

testname=sx-tuto-mktx-stdin-stdout.t
command=hx
args=( mktx - --input 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3:1 --output - )
exit_code=0
stdin_file=stdin
stdout_file=stdout
stderr_file=/dev/null
sources=( )
products=( )

# Environment variables:
env_vars=( )

setup(){
: Perform here actions to be run before the tested program
}

munge(){
: Munge here the results of the tested program to ease the check
}

check(){
check_exit_code &&
check_stderr &&
check_stdout &&
check_products &&
: Perform here extra checks on the tested program
}

explain(){
explain_exit_code
explain_stdout
explain_stderr
explain_products
: Explain here more potential differences
}

teardown(){
: Undo here the actions of setup
}
1 change: 1 addition & 0 deletions tests/sx-tuto-mktx-stdin-stdout.t/stdin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1MyKMeDsom7rYcp69KpbKn4DcyuvLMkLYJ:90000
1 change: 1 addition & 0 deletions tests/sx-tuto-mktx-stdin-stdout.t/stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000000ffffffff01905f0100000000001976a914e60921dbfe1e066113f1c6e0ea15517234187d4788ac00000000
42 changes: 42 additions & 0 deletions tests/sx-tuto-mktx-stdout.t/TESTRECIPE
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

testname=sx-tuto-mktx-stdout.t
command=hx
args=( mktx - --input 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3:1 --output 1MyKMeDsom7rYcp69KpbKn4DcyuvLMkLYJ:90000 )
exit_code=0
stdin_file=/dev/null
stdout_file=stdout
stderr_file=/dev/null
sources=( )
products=( )

# Environment variables:
env_vars=( )

setup(){
: Perform here actions to be run before the tested program
}

munge(){
: Munge here the results of the tested program to ease the check
}

check(){
check_exit_code &&
check_stderr &&
check_stdout &&
check_products &&
: Perform here extra checks on the tested program
}

explain(){
explain_exit_code
explain_stdout
explain_stderr
explain_products
: Explain here more potential differences
}

teardown(){
: Undo here the actions of setup
}
1 change: 1 addition & 0 deletions tests/sx-tuto-mktx-stdout.t/stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000000ffffffff01905f0100000000001976a914e60921dbfe1e066113f1c6e0ea15517234187d4788ac00000000

0 comments on commit eadee16

Please sign in to comment.