confidential-assets-demo icon indicating copy to clipboard operation
confidential-assets-demo copied to clipboard

Replacing `generate` with `generatetoaddress`

Open RdeWilde opened this issue 4 years ago • 1 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: https://github.com/ElementsProject/confidential-assets-demo/blob/bd23dc90b62572f7c4c24f11c7505f646fd1a365/src/fred/main.go#L43

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

RdeWilde avatar May 20 '20 22:05 RdeWilde

@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.

AkioNak avatar May 21 '20 02:05 AkioNak