stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
783 stars 315 forks source link

Inconsistent formatting of Address return values #4228

Open mwherman2000 opened 3 years ago

mwherman2000 commented 3 years ago

Here's two methods (actually one method and one property getter):

    public Address SenderAddress
    {
        get
        {
            return Message.Sender;
        }
    }

    public Address GetSenderAddress()
    {
        return Message.Sender;
    }

The first one (the property getter) works like I hope it would with a "properly" formatted Address value ("return" value):

{
  "internalTransfers": [],
  "gasConsumed": {
    "value": 10014
  },
  "revert": false,
  "errorMessage": null,
  "return": "CUtNvY1Jxpn4V4RD1tgphsUKpQdo4q5i54",
  "logs": []
}

The second one (an actual method) returns a hex string (the "returnValue" value):

{
    "transactionHash": "e2c161a08830f9ad2ce9fde6d5f14330e26040ed584ce2c39f47be0cbee5610e",
    "blockHash": "c895f54b774e901ae03d9f2a037b8934260bd0cee8e410dca60dc31cc1cfc1d4",
    "postState": "19aed953ff6f0200e21058c31ff10c30fea5d0cdf348a6d6ca32b6ddbb61c277",
    "gasUsed": 10014,
    "from": "CUtNvY1Jxpn4V4RD1tgphsUKpQdo4q5i54",
    "to": "CTE3W1QUpUKZUnaKa3ChcNKaGfbQaxUBDE",
    "newContractAddress": null,
    "success": true,
    "returnValue": "88432921B2B07617A42342597558CFA0BA429963",
    "bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "error": null,
    "logs": []
}

Questions

  1. Why are these different?
  2. Is it a bug?
  3. In the calling app, how I can I convert the bye[] representation of the hexstring ("88432921B2B07617A42342597558CFA0BA429963") into something that looks like an Address ("CUtNvY1Jxpn4V4RD1tgphsUKpQdo4q5i54")?
mwherman2000 commented 3 years ago

Using the Hackathon 2019 wallet and integrated node.

YakupIpek commented 3 years ago

This can be considered bug which is fixed in latest versions.

I recommend you, clone repository locally and switch branch for release/1.0.9.0 and run command in console dotnet run -devmode under Stratis.CirrusD folder. You can see swagger url at the beginning of console logs.

You can also run latest Cirrus wallet while the process is running so in this way Cirrus wallet will use already running process.

Hope this helps, let me know if it is fixed your issue.

YakupIpek commented 3 years ago

Btw this repository is for Strat and this is not maintained anymore. New repository is in here https://github.com/stratisproject/StratisFullNode