Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature only flag bug on tx sign command #7632

Closed
antstalepresh opened this issue Oct 22, 2020 · 3 comments · Fixed by #8106
Closed

Signature only flag bug on tx sign command #7632

antstalepresh opened this issue Oct 22, 2020 · 3 comments · Fixed by #8106
Assignees
Labels
C:CLI C:Keys Keybase, KMS and HSMs T:Bug

Comments

@antstalepresh
Copy link
Contributor

Summary of Bug

When add signature only flag on transaction sign, it does not print any signature but just returns empty array.

{"signatures":[]}

Version

latest cosmos sdk master (55d7d0c)

Steps to Reproduce

Start daemon using below script.

#!/bin/bash

rm -rf $HOME/.simd/

cd $HOME

simd init --chain-id=testing testing --home=$HOME/.simd
simd keys add validator --keyring-backend=test --home=$HOME/.simd
simd add-genesis-account $(simd keys show validator -a --keyring-backend=test --home=$HOME/.simd) 1000000000validatortoken,1000000000stake --home=$HOME/.simd
simd gentx validator --keyring-backend=test --home=$HOME/.simd --chain-id testing
simd collect-gentxs --home=$HOME/.simd

simd start --home=$HOME/.simd

Open another terminal and run

simd keys add user1 --keyring-backend=test --home=$HOME/.simd
simd tx bank send $(simd keys show -a validator --keyring-backend=test --home=$HOME/.simd) $(simd keys show -a user1 --keyring-backend=test --home=$HOME/.simd) 1000stake --keyring-backend=test --home=$HOME/.simd --chain-id=testing --generate-only > my_tx.json
simd tx sign my_tx.json --from validator --keyring-backend=test --home=$HOME/.simd --chain-id=testing --signature-only

Result

{"signatures":[]}

Expected

{"signatures":[{XXXXX}]}
@gsora
Copy link
Contributor

gsora commented Dec 9, 2020

Tried reproducing this bug on latest Launchpad release.

cncli tx send did:com:1l9rr5ck7ed30ny3ex4uj75ezrt03gfp96z7nen (cncli keys show janet --address)  2000000000ucommercio --chain-id=testnet --fees 10000ucommercio -y --generate-only

cncli tx sign tx --from jack  --chain-id=testnet  --signature-only

(jack == did:com:1l9rr5ck7ed30ny3ex4uj75ezrt03gfp96z7nen in this context)

The output of the last command looks like a proper signature:

{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"A7Xdk942ZzsO14tioIjksOlmccYvnUJi8z+ytZ9qaK4h"},"signature":"poVIjzoFMfg1kV3rOVugpMBC5RaH738NW8xz0DeYftlpuYIVeyfxmZfkZ0d38BzPxY9MCrmAO+K5jN0cQIfPVQ=="}

@alessio
Copy link
Contributor

alessio commented Dec 9, 2020

Thanks @gsora! It's a regression 👍

@clevinson
Copy link
Contributor

Of note from SDK iteration planning call:

  • let's make sure we are issuing an error whenever a user uses SIGN_MODE_DIRECT when singing multisig or multiple signature transactinos. Only amino-json is supported a a sign method for these currently.

@mergify mergify bot closed this as completed in #8106 Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:Keys Keybase, KMS and HSMs T:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants