Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unexpected type gnolang.BigdecValue #500

Merged
merged 1 commit into from
Feb 5, 2023

Conversation

anarcher
Copy link
Contributor

@anarcher anarcher commented Feb 3, 2023

Description

When I import math , adding realm to chain is OK but it raise a panic unexpected type gnolang.BigdecValue.

package hello

import "math"

func Hello() string {
        return ("Hello World!")
}

Adding is OK, but restarting chain or adding another realm raise a panic unexpected type gnolang.BigdecValue.

panic: unexpected type gnolang.BigdecValue [recovered]
        panic: gno.land/r/math1/hello.gno:1: unexpected type gnolang.BigdecValue

goroutine 1 [running]:
github.com/gnolang/gno/pkgs/gnolang.predefineNow.func1()
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/preprocess.go:2830 +0x250
panic({0x1017fd2e0, 0x140057be4f0})
        /Users/anarch/.gobrew/versions/1.18.9/go/src/runtime/panic.go:838 +0x204
github.com/gnolang/gno/pkgs/gnolang.fillTypesOfValue({0x10191dac0, 0x140001ba1b0}, {0x1019115e8?, 0x1400a8b6e10?})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/realm.go:1365 +0x668
github.com/gnolang/gno/pkgs/gnolang.fillTypesTV({0x10191dac0, 0x140001ba1b0}, 0x14002f8cfa8)
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/realm.go:1295 +0x78
github.com/gnolang/gno/pkgs/gnolang.fillTypesOfValue({0x10191dac0, 0x140001ba1b0}, {0x10190fd38?, 0x140046501e0?})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/realm.go:1357 +0x6bc
github.com/gnolang/gno/pkgs/gnolang.(*defaultStore).loadObjectSafe(0x140001ba1b0, {{{0x58, 0xa6, 0xd6, 0x80, 0x1a, 0xe7, 0x71, 0xe6, 0x32, ...}}, ...})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/store.go:289 +0x2fc
github.com/gnolang/gno/pkgs/gnolang.(*defaultStore).GetObjectSafe(0x140001ba1b0, {{{0x58, 0xa6, 0xd6, 0x80, 0x1a, 0xe7, 0x71, 0xe6, 0x32, ...}}, ...})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/store.go:258 +0x88
github.com/gnolang/gno/pkgs/gnolang.(*defaultStore).GetObject(0x1?, {{{0x58, 0xa6, 0xd6, 0x80, 0x1a, 0xe7, 0x71,
 0xe6, 0x32, ...}}, ...})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/store.go:244 +0x3c
github.com/gnolang/gno/pkgs/gnolang.(*PackageValue).GetBlock(0x14003e50960, {0x10191dac0?, 0x140001ba1b0?})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/values.go:828 +0x98
github.com/gnolang/gno/pkgs/gnolang.(*defaultStore).GetPackage(0x140001ba1b0, {0x14003a28c71, 0x4}, 0x38?)
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/store.go:129 +0x3cc
github.com/gnolang/gno/pkgs/gnolang.tryPredefine({0x10191dac0, 0x140001ba1b0}, {0x10191bca8, 0x140031d02c0}, {0x10191a560, 0x14006086b00?})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/preprocess.go:2943 +0xa80
github.com/gnolang/gno/pkgs/gnolang.predefineNow2({0x10191dac0, 0x140001ba1b0}, {0x10191bca8, 0x140031d02c0}, {0
x10191a560?, 0x14006086b00?}, 0x200?)
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/preprocess.go:2846 +0xec
github.com/gnolang/gno/pkgs/gnolang.predefineNow({0x10191dac0, 0x140001ba1b0}, {0x10191bca8, 0x140031d02c0}, {0x10191a560, 0x14006086b00})
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/preprocess.go:2835 +0xd4
github.com/gnolang/gno/pkgs/gnolang.PredefineFileSet({0x10191dac0, 0x140001ba1b0}, 0x140031d0580, 0x14008994f90)
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/preprocess.go:38 +0x630
github.com/gnolang/gno/pkgs/gnolang.(*Machine).PreprocessAllFilesAndSaveBlockNodes(0x1400022c240)
        /Users/anarch/go/blockchain/src/gno/pkgs/gnolang/machine.go:144 +0xe4
github.com/gnolang/gno/pkgs/sdk/vm.(*VMKeeper).Initialize(0x140001ba240, {0x101912e60, 0x14000232280})
        /Users/anarch/go/blockchain/src/gno/pkgs/sdk/vm/keeper.go:76 +0x1c0
github.com/gnolang/gno/gnoland.NewApp({0x101536a94?, 0x26?}, 0x10?, {0x101913fb8, 0x14000300620})
        /Users/anarch/go/blockchain/src/gno/gnoland/app.go:82 +0x6c8
main.runMain({0x14000032210, 0x0, 0x0})
        /Users/anarch/go/blockchain/src/gno/cmd/gnoland/main.go:77 +0x558
main.main()
        /Users/anarch/go/blockchain/src/gno/cmd/gnoland/main.go:28 +0x54

Please provide a detailed description of what was done in this PR

How has this been tested?

No yet.

Please complete this section if you ran tests for this functionality, otherwise delete it

@anarcher anarcher requested a review from a team as a code owner February 3, 2023 17:22
@moul moul merged commit 7ae9b59 into gnolang:master Feb 5, 2023
@anarcher anarcher deleted the pr/bigdecvalue branch February 6, 2023 09:17
moul-bot pushed a commit that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants