cli: fix parseCosigner method

This commit is contained in:
Anna Shaleva 2020-07-03 23:35:22 +03:00
parent 1880e96844
commit 3c551788c9

View file

@ -427,7 +427,7 @@ func invokeInternal(ctx *cli.Context, signAndPush bool) error {
for i, c := range args[cosignersStart:] {
cosigner, err := parseCosigner(c)
if err != nil {
return cli.NewExitError(fmt.Errorf("failed to parse cosigner #%d: %v", i+cosignersStart+1, err), 1)
return cli.NewExitError(fmt.Errorf("failed to parse cosigner #%d: %v", i+1, err), 1)
}
cosigners = append(cosigners, cosigner)
}
@ -692,7 +692,7 @@ func parseCosigner(c string) (transaction.Cosigner, error) {
err error
res = transaction.Cosigner{}
)
data := strings.SplitN(strings.ToLower(c), ":", 2)
data := strings.SplitN(c, ":", 2)
s := data[0]
if len(s) == 2*util.Uint160Size+2 && s[0:2] == "0x" {
s = s[2:]