Skip to content

Commit

Permalink
Remove debug code in tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Scitz0 committed Jul 3, 2020
1 parent 952aae2 commit 134bc92
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions scripts/cnode-helper-scripts/cntools.library
Expand Up @@ -672,10 +672,10 @@ sendADA() {
--testnet-magic ${NWMAGIC}
)

say ""
echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction"

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 1. Problem during tx creation with args ${buildArgs[*]}" "log"
Expand All @@ -684,18 +684,14 @@ sendADA() {
fi

say "Signing transaction"

## TODO decrypt skey
output=$(${CCLI} ${signArgs[*]})
## TODO encrypt skey
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 2. Problem during signing with args ${signArgs[*]}" "log"
say "$output" "log"
return 1
fi

say "Sending transaction"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 3. Problem during tx submission with args ${submitArgs[*]}" "log"
Expand Down Expand Up @@ -807,10 +803,10 @@ registerStakeWallet() {
--testnet-magic ${NWMAGIC}
)

say ""
echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction" "log"

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 1. Problem during tx creation with args ${buildArgs[*]}"
Expand All @@ -819,7 +815,6 @@ registerStakeWallet() {
fi

say "Signing transaction" "log"

output=$(${CCLI} ${signArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 2. Problem during signing with args ${signArgs[*]}"
Expand All @@ -828,7 +823,6 @@ registerStakeWallet() {
fi

say "Sending transaction" "log"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 3. Problem during tx submission with args ${submitArgs[*]}"
Expand Down Expand Up @@ -964,11 +958,10 @@ registerPool() {
--testnet-magic ${NWMAGIC}
)

say ""
echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction"
echo ${buildArgs[*]}

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 1. Problem during tx creation with args ${buildArgs[*]}" "log"
Expand All @@ -977,7 +970,6 @@ registerPool() {
fi

say "Signing transaction"

output=$(${CCLI} ${signArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 2. Problem during signing with args ${signArgs[*]}" "log"
Expand All @@ -986,7 +978,6 @@ registerPool() {
fi

say "Sending transaction"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 3. Problem during tx submission with args ${submitArgs[*]}" "log"
Expand Down Expand Up @@ -1092,11 +1083,10 @@ modifyPool() {
--testnet-magic ${NWMAGIC}
)

say ""
echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction"
echo ${buildArgs[*]}

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 1. Problem during tx creation with args ${buildArgs[*]}" "log"
Expand All @@ -1105,7 +1095,6 @@ modifyPool() {
fi

say "Signing transaction"

output=$(${CCLI} ${signArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 2. Problem during signing with args ${signArgs[*]}" "log"
Expand All @@ -1114,7 +1103,6 @@ modifyPool() {
fi

say "Sending transaction"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
say "${RED}ERROR${NC}: 3. Problem during tx submission with args ${submitArgs[*]}" "log"
Expand Down Expand Up @@ -1321,29 +1309,24 @@ delegate() {
--testnet-magic ${NWMAGIC}
)

say ""
echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction"
echo ${buildArgs[*]}

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
error "1. Problem during tx creation with args ${buildArgs[*]}" "$output"
return 1
fi

say "Signing transaction"

## TODO decrypt skey
output=$(${CCLI} ${signArgs[*]})
## TODO encrypt skey
if [[ -n $output ]]; then
error "2. Problem during signing with args ${signArgs[*]}" "$output"
return 1
fi

say "Sending transaction"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
error "3. Problem during tx submission with args ${submitArgs[*]}" "$output"
Expand Down Expand Up @@ -1436,27 +1419,22 @@ deRegisterPool() {

echo ""
say " -- Build, Sign & Send transaction --" "log"

say "Building transaction"
echo ${buildArgs[*]}

output=$(${CCLI} ${buildArgs[*]})
if [[ -n $output ]]; then
error "1. Problem during tx creation with args ${buildArgs[*]}" "$output"
return 1
fi

say "Signing transaction"

## TODO decrypt skey
output=$(${CCLI} ${signArgs[*]})
## TODO encrypt skey
if [[ -n $output ]]; then
error "2. Problem during signing with args ${signArgs[*]}" "$output"
return 1
fi

say "Sending transaction"

output=$(${CCLI} ${submitArgs[*]})
if [[ -n $output ]]; then
error "3. Problem during tx submission with args ${submitArgs[*]}" "$output"
Expand Down

0 comments on commit 134bc92

Please sign in to comment.