Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

getState returns different format for Maps on Kaya than Testnet #108

Open
SvenMeyer opened this issue Dec 5, 2019 · 0 comments
Open

getState returns different format for Maps on Kaya than Testnet #108

SvenMeyer opened this issue Dec 5, 2019 · 0 comments

Comments

@SvenMeyer
Copy link

getState returns a different format for Maps on Kaya than Testnet

Testnet (https://dev-api.zilliqa.com)

{
    "_balance": "6000",
    "ipfsInventory": {
        "Qm001": {
            "argtypes": [],
            "arguments": [
                "0x0ba87f4374f7d9fe3ddf75b11439506b491a779a",
                "946652",
                "metadata_1"
            ],
            "constructor": "RegData"
        },
        "Qm002": {
            "argtypes": [],
            "arguments": [
                "0x0ba87f4374f7d9fe3ddf75b11439506b491a779a",
                "946655",
                "metadata_2"
            ],
            "constructor": "RegData"
        },
        "Qm101": {
            "argtypes": [],
            "arguments": [
                "0xeecc5f2d4c87285129c7301acedbf4c132c42452",
                "946979",
                "first item of Account 1"
            ],
            "constructor": "RegData"
        }
    },
    "price": "2000",
    "registered_items": {
        "0x0ba87f4374f7d9fe3ddf75b11439506b491a779a": [
            "Qm002",
            "Qm001"
        ],
        "0xeecc5f2d4c87285129c7301acedbf4c132c42452": [
            "Qm101"
        ]
    }
}

Kaya (localhost - remote interpreter)

{
    "_balance": "4000",
    "price": "2000",
    "ipfsInventory": [
        {
            "key": "Qm001",
            "val": {
                "constructor": "RegData",
                "argtypes": [],
                "arguments": [
                    "0x7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8",
                    "0",
                    "metadata_1"
                ]
            }
        },
        {
            "key": "Qm002",
            "val": {
                "constructor": "RegData",
                "argtypes": [],
                "arguments": [
                    "0x7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8",
                    "0",
                    "metadata_2"
                ]
            }
        }
    ],
    "registered_items": [
        {
            "key": "0x7bb3b0e8a59f3f61d9bff038f4aeb42cae2ecce8",
            "val": [
                "Qm002",
                "Qm001"
            ]
        }
    ]
}

Looks like as if Kaya wraps an additional array [] around each Map Object.
Kaya also uses an additional key / val Map.
Makes it quite difficult to develop code which works on Kaya and unchanged on Testnet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant