coinbase / mesh-bitcoin

Bitcoin Mesh API Implementation
Apache License 2.0
110 stars 121 forks source link

enable parsing output address in field of string type #138

Open alejoacosta74 opened 1 year ago

alejoacosta74 commented 1 year ago

Fixes # .

Motivation

After Bitcoin core 23.0, bitcoind no longer returns the addresses field in RPC methods gettxout, getrawtransaction, decoderawtransaction, decodescript, gettransaction verbose=true (see bitcoin release notes for more detail). Instead, a address field is returned, which should be decoded in a Address string field within the ScriptPubKey struct in bitcoin's client types.

Solution

This PR contains a fix that supports both the deprecated Addresses []string field and the new Address string field, that will enable Rosetta-bitcoin implementation to be compatible with bitcoin core v23 while maintaining backward compatibility with previous bitcoin releases Proposed code changes

Unit tests for the bitcoin client have been slightly modified to take the new scenario into consideration.

Open questions

N/A