Explorer Error when Viewing Asset

+2 votes

Hi

We found an issue when trying to view an asset from the assets page of the explorer.  When we click on one of our issued assets the explorer blows up, the error is:

explorer_1  | Traceback (most recent call last):
explorer_1  |   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
explorer_1  |     self.result = application(self.environ, self.start_response)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/abe.py", line 321, in __call__
explorer_1  |     handler(page)
explorer_1  |   File "/usr/local/lib/python2.7/dist-packages/Mce/abe.py", line 2095, in handle_assetref
explorer_1  |     address_from = issuetx['vout'][2]['scriptPubKey']['addresses'][0]
explorer_1  | KeyError: 'addresses'

 

The code in question is here on line 2095:

address_from = issuetx['vout'][2]['scriptPubKey']['addresses'][0]

The from address is hardwired to the third output, but when you look at the issuing transaction for the asset, the from_address is on the 4th output below....

  "vout": [
    {
      "assets": [
        {
          "assetref": "779-267-60402", 
          "issuetxid": "f2eb3171aee30291f88b9430a3b6eff0e2ace649d3266f73958f6f696a733d42", 
          "name": "PuffinCoin", 
          "qty": 9001.0, 
          "raw": 9001, 
          "type": "issuefirst"
        }
      ], 
      "items": [], 
      "n": 0, 
      "permissions": [], 
      "scriptPubKey": {
        "addresses": [
          "18NXxwQ6qvjsQZceah1j4Mo7CBAapZp3mo"
        ], 
        "asm": "OP_DUP OP_HASH160 50db76a816c7e66f38fdc89569dd673012320d50 OP_EQUALVERIFY OP_CHECKSIG 73706b672923000000000000 OP_DROP", 
        "hex": "76a91450db76a816c7e66f38fdc89569dd673012320d5088ac0c73706b67292300000000000075", 
        "reqSigs": 1, 
        "type": "pubkeyhash"
      }, 
      "value": 0.0
    }, 
    {
      "assets": [], 
      "items": [], 
      "n": 1, 
      "permissions": [], 
      "scriptPubKey": {
        "asm": "73706b6e010002010100010a50756666696e436f696e OP_DROP OP_RETURN", 
        "hex": "1673706b6e010002010100010a50756666696e436f696e756a", 
        "type": "nulldata"
      }, 
      "value": 0.0
    }, 
    {
      "assets": [], 
      "items": [], 
      "n": 2, 
      "permissions": [], 
      "scriptPubKey": {
        "asm": "OP_RETURN 7b227472616e73616374696f6e54797065223a224953535545222c22617373657473223a5b7b22766f7574223a302c226173736574496e666f223a7b7d7d5d7d", 
        "hex": "6a407b227472616e73616374696f6e54797065223a224953535545222c22617373657473223a5b7b22766f7574223a302c226173736574496e666f223a7b7d7d5d7d", 
        "type": "nulldata"
      }, 
      "value": 0.0
    }, 
    {
      "assets": [], 
      "items": [], 
      "n": 3, 
      "permissions": [], 
      "scriptPubKey": {
        "addresses": [
          "18NXxwQ6qvjsQZceah1j4Mo7CBAapZp3mo"
        ], 
        "asm": "OP_DUP OP_HASH160 50db76a816c7e66f38fdc89569dd673012320d50 OP_EQUALVERIFY OP_CHECKSIG", 
        "hex": "76a91450db76a816c7e66f38fdc89569dd673012320d5088ac", 
        "reqSigs": 1, 
        "type": "pubkeyhash"
      }, 
      "value": 0.0
    }
  ]
 
Cheers
Marty
 

 

 

 

asked Dec 21, 2017 by marty

1 Answer

0 votes

Thanks. That looks like more logic in the Explorer that's hard coded for MultiChain's high level issuance transactions, but chokes on the issuance transactions you build yourselves. Please try changing:

address_from = issuetx['vout'][2]['scriptPubKey']['addresses'][0]

... to ...

address_from = asset['issues'][0]['issuers'][0]

 

answered Dec 22, 2017 by MultiChain
cheers, that's sorted it!
...