[lbry] rpc: un-embedded attributes in getaddressinfo result
lbcwallet failed to re-generate RPC help message. The help message generator doesn't handle embedded fields properly.
This commit is contained in:
parent
ca9b4e5529
commit
3a179a0eee
2 changed files with 22 additions and 5 deletions
|
@ -53,7 +53,26 @@ type embeddedAddressInfo struct {
|
||||||
// 3. Information about the embedded address in case of P2SH or P2WSH.
|
// 3. Information about the embedded address in case of P2SH or P2WSH.
|
||||||
// Same structure as (1).
|
// Same structure as (1).
|
||||||
type GetAddressInfoResult struct {
|
type GetAddressInfoResult struct {
|
||||||
embeddedAddressInfo
|
// The following fields are identical to embeddedAddressInfo.
|
||||||
|
// However, the utility to generate RPC help message can't handle
|
||||||
|
// embedded field properly. So, spell out the attributes individually.
|
||||||
|
Address string `json:"address"`
|
||||||
|
ScriptPubKey string `json:"scriptPubKey"`
|
||||||
|
Descriptor *string `json:"desc,omitempty"`
|
||||||
|
IsScript bool `json:"isscript"`
|
||||||
|
IsChange bool `json:"ischange"`
|
||||||
|
IsWitness bool `json:"iswitness"`
|
||||||
|
WitnessVersion int `json:"witness_version,omitempty"`
|
||||||
|
WitnessProgram *string `json:"witness_program,omitempty"`
|
||||||
|
ScriptType *txscript.ScriptClass `json:"script,omitempty"`
|
||||||
|
Hex *string `json:"hex,omitempty"`
|
||||||
|
PubKeys *[]string `json:"pubkeys,omitempty"`
|
||||||
|
SignaturesRequired *int `json:"sigsrequired,omitempty"`
|
||||||
|
PubKey *string `json:"pubkey,omitempty"`
|
||||||
|
IsCompressed *bool `json:"iscompressed,omitempty"`
|
||||||
|
HDMasterFingerprint *string `json:"hdmasterfingerprint,omitempty"`
|
||||||
|
Labels []string `json:"labels"`
|
||||||
|
|
||||||
IsMine bool `json:"ismine"`
|
IsMine bool `json:"ismine"`
|
||||||
IsWatchOnly bool `json:"iswatchonly"`
|
IsWatchOnly bool `json:"iswatchonly"`
|
||||||
Timestamp *int `json:"timestamp,omitempty"`
|
Timestamp *int `json:"timestamp,omitempty"`
|
||||||
|
|
|
@ -37,10 +37,8 @@ func TestGetAddressInfoResult(t *testing.T) {
|
||||||
name: "GetAddressInfoResult - ScriptType",
|
name: "GetAddressInfoResult - ScriptType",
|
||||||
result: `{"script":"nonstandard","address":"1abc"}`,
|
result: `{"script":"nonstandard","address":"1abc"}`,
|
||||||
want: GetAddressInfoResult{
|
want: GetAddressInfoResult{
|
||||||
embeddedAddressInfo: embeddedAddressInfo{
|
Address: "1abc",
|
||||||
Address: "1abc",
|
ScriptType: nonStandard,
|
||||||
ScriptType: nonStandard,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue