Giter Club home page Giter Club logo

Comments (8)

ghostant-1017 avatar ghostant-1017 commented on June 5, 2024

This issue should be fixed, check: https://github.com/AleoHQ/snarkVM/pull/1736.

from leo.

AlexZhao6666 avatar AlexZhao6666 commented on June 5, 2024

This issue should be fixed, check: AleoHQ/snarkVM#1736.

i will check later

from leo.

AlexZhao6666 avatar AlexZhao6666 commented on June 5, 2024

This issue should be fixed, check: AleoHQ/snarkVM#1736.

the issue not fix now
https://github.com/AleoHQ/snarkVM/pull/1736 the pr not fix my issue.
my issue is :Using 'Mapping::get(ticketPurchaseMap, i)' in the for loop within the finalize method
and i test use Mapping::get_or_use is ok,this is real a bug for Mapping::get

from leo.

HarukaMa avatar HarukaMa commented on June 5, 2024

Basically, ifs in finalizers should be compiled down to branch instructions. AFAIK this is planned.

from leo.

raychu86 avatar raychu86 commented on June 5, 2024

If I am reading your logic correctly, this is intended.

Attempting to get a value from a mapping that doesn't contain your key will cause an error.

Using mapping get.or_use is what you should be using if you do not know if a value exists, but want to set a default.

from leo.

HarukaMa avatar HarukaMa commented on June 5, 2024

Note: this is actually a Leo compiler issue, as the program compiles to Aleo instructions with side-effects that could not be ignored.

from leo.

d0cd avatar d0cd commented on June 5, 2024

From what I understand, the compiler needs to leverage branch commands correctly.
Can you please paste your source code (not a screenshot), or a reproducible example so that we may triage?

from leo.

AlexZhao6666 avatar AlexZhao6666 commented on June 5, 2024

From what I understand, the compiler needs to leverage branch commands correctly. Can you please paste your source code (not a screenshot), or a reproducible example so that we may triage?

https://github.com/AlexZhao6666/double-color-ball/blob/main/contract/double_color_ball/src/main.leo
just replace Mapping::get_or_use to Mapping::get can recurrent
1

from leo.

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.