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

Cannot get pubKeys form multisig (Bech32KeyOutput) #4338

Closed
SorawitSiri opened this issue May 14, 2019 · 1 comment · Fixed by #4790
Closed

Cannot get pubKeys form multisig (Bech32KeyOutput) #4338

SorawitSiri opened this issue May 14, 2019 · 1 comment · Fixed by #4790
Assignees
Labels
Milestone

Comments

@SorawitSiri
Copy link

SorawitSiri commented May 14, 2019

I can't get pubKeys from multisig by implement following to below.

  1. Create Info of Multisig:
    info := keys.NewMultiInfo(name, multikey)
    remark: I can do it. Prove it with fmt.Println
=== info ===
&{Wallet {1 [PubKeySecp256k1{033AF09F14E98A992519FF24B78E6C29F1A96B9CFBA127765F585605C748F061BE}]} 1 [{PubKeySecp256k1{033AF09F14E98A992519FF24B78E6C29F1A96B9CFBA127765F585605C748F061BE} 1}]}
  1. Import info to function of Cosmos-SDK
    ko, err := keys.Bech32KeyOutput(info)
    remark: I can do it. Prove it with fmt.Println
NAME:	TYPE:	ADDRESS:					PUBKEY:
Wallet	multi	cosmos15s8j38qm62g0rm23u87tulvq2anhregf3zclzk	cosmospub1ytql0csgqyfzd666axrjzqe67z03f6v2nyj3nleyk78xc203494ee7apyam97kzkqhr53urphccg97s3
  1. After that, I get ko.PubKeys which it don't have data of owner account.
>>>>>>>>>>>> Bug Get PubKeys >>>>>>>>>>>>>>
ko.PubKeys []
WEIGHT:	THRESHOLD:	ADDRESS:					PUBKEY:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Below, I attach code.
Code:
Screen Shot 2562-05-14 at 18 14 30

Result:
Screen Shot 2562-05-14 at 18 14 04

@alexanderbez
Copy link
Contributor

So the functionality to show multsig pubkey constitutions does actually work, example:

$ gaiacli keys show node012 --home ./build/node0/gaiacli --show-multisig
WEIGHT:	THRESHOLD:	ADDRESS:					PUBKEY:
1	2		cosmos19t5d8wx43rmtxgynxpyd7kf4qzrf9tg32fz3a0	cosmospub1addwnpepqwp7qtxppn9qkejcw3d0wfhlw2ekqpgesg3ccaftz7mryn286l5vca83rwn
1	2		cosmos1hsktdq8ftxj4dx5ndnpcee9rg6evd95xw0rp67	cosmospub1addwnpepqvkestj22um5hjudwflz57gmta7nvq95nvy7dxyy3qu0wf730f0p62dmt00
1	2		cosmos1m9547m99vs8e9f40acs7tveg7zuxzrhhcpezc6	cosmospub1addwnpepq2gqyg3t9yn00ew60l5qugsfvcsmcy8rf9cwqa0cpat7yn2cfmspqx4g99l

However, the code example you pasted indeed does not work and does seem like a bug. The reason is because NewMultiInfo returns a pointer (like all info objects). However, Bech32KeyOutput does a type check on a non-pointer. This seems like a bug.

if mInfo, ok := info.(multiInfo); ok {

This should be: if mInfo, ok := info.(*multiInfo); ok {

/cc @alessio

@fedekunze fedekunze added this to the v0.37.0 milestone Jul 19, 2019
@fedekunze fedekunze self-assigned this Jul 26, 2019
@fedekunze fedekunze mentioned this issue Jul 26, 2019
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants