ElementsProject / confidential-assets-demo

Confidential Assets Demo built on the Elements blockchain platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replacing `generate` with `generatetoaddress`

RdeWilde opened this issue · comments

Now that generate is deprecated, I would like to replace it with generatetoaddress but I am not sure how to get the address to pass along in the code below:

res, err = rpcClient.RequestAndUnmarshalResult(&hashs, "generate", 1)

How do I pass a valid address as extra argument to the call?

@RdeWilde Passing an address to generatetoaddress, just add the 4th param like follows:

addr, _ := rpcClient.GetNewAddr(false)
res, err = rpcClient.RequestAndUnmarshalResult(&hashs, "generatetoaddress", 1, addr) 

But, It seems some other codes should be fix to run with the latest version of elements.
I will try to make a PR to fix them.