Giter Club home page Giter Club logo

Comments (13)

fschoell avatar fschoell commented on August 22, 2024

This is weird. The decoder correctly decodes the value to "true". So maybe this is happening on some (un-)marshalling step. Do you know of an action that contains a boolean value in it's data? Would like to check if this is a common thing with all nested boolean values or if it's only impacting the decoded table data.

from firehose-antelope.

YaroShkvorets avatar YaroShkvorets commented on August 22, 2024

Do you know of an action that contains a boolean value in it's data?

You mean boolean action param?
Here's one

Looks like it's also encoded as 1.

from firehose-antelope.

fschoell avatar fschoell commented on August 22, 2024

Hmm ok I'll need to take a deeper look into this. Do you know if it's consistent behaviour to encode nested json data into 0/1 or does this impact only certain actions?

from firehose-antelope.

YaroShkvorets avatar YaroShkvorets commented on August 22, 2024

Looks consistent. Here's eosio::deletegatebw call: https://eos.eosq.eosnation.io/tx/bd1bd84da20a7028c14d3404a544fe86a91d7e423ab6db64d7a2cea18f927a3a

from firehose-antelope.

fschoell avatar fschoell commented on August 22, 2024
Jul 07 10:37:50 eos-sfdm41 nodeos[1519058]: 2023-07-07T10:37:50.772Z DEBG (codec) decoding action {"action": "eosio:delegatebw", "global_sequence": 358638274958}
Jul 07 10:37:50 eos-sfdm41 nodeos[1519058]: 2023-07-07T10:37:50.772Z DEBG (codec) found ABI and action definition, performing decoding {"action": "eosio:delegatebw", "global_sequence": 358638274958}
Jul 07 10:37:50 eos-sfdm41 nodeos[1519058]: 2023-07-07T10:37:50.772Z DEBG (codec) successfully decoded action data {"action": "eosio:delegatebw", "json_data": "{\"from\":\"kingparallax\",\"receiver\":\"kingparallax\",\"stake_cpu_quantity\":\"27.9807 EOS\",\"stake_net_quantity\":\"0.0000 EOS\",\"transfer\":0}"}

from firehose-antelope.

fschoell avatar fschoell commented on August 22, 2024

Ok so I copied out the decoding part, ran it locally with a delegatebw action and it is properly decoding the boolean value to true/false instead of 0/1. This is weird.

Looking at the battlefield-eosio repository it seems like the boolean decoding always has been to 0/1 (it's how nested json strings with booleans are encoded in the golden.json files which were used to test against with linediff).

from firehose-antelope.

YaroShkvorets avatar YaroShkvorets commented on August 22, 2024

OK, so we are keeping it this way?

from firehose-antelope.

matthewdarwin avatar matthewdarwin commented on August 22, 2024

I assume yes, unless you get maoueh to say otherwise.

from firehose-antelope.

YaroShkvorets avatar YaroShkvorets commented on August 22, 2024

Related commit where they changed the decoding to byte

Then they added fitNodeos flag.

So they did it to align with nodeos.

Is there any downside if we just decode it as true/false?

from firehose-antelope.

matthewdarwin avatar matthewdarwin commented on August 22, 2024

I love we can find the code change for that.

from firehose-antelope.

fschoell avatar fschoell commented on August 22, 2024

Setting fitNodeos to false has other implications on parsings, like int128 getting parsed into a string instead of a number. Not sure what the impacts are when changing that.

Seems like Matthieu doesn't know either.

from firehose-antelope.

fschoell avatar fschoell commented on August 22, 2024

@YaroShkvorets is this still relevant or should we close the issue?

from firehose-antelope.

YaroShkvorets avatar YaroShkvorets commented on August 22, 2024

I guess we can close it.

from firehose-antelope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.