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

Simple project won't compile -- no error message. #78

Open
firefly-sol opened this issue Dec 9, 2022 · 1 comment
Open

Simple project won't compile -- no error message. #78

firefly-sol opened this issue Dec 9, 2022 · 1 comment

Comments

@firefly-sol
Copy link

I was trying to use a bump as a signer. When trying to recreate the issue with the minimum reproducible code, I noticed that this program that I would expect to compile, wouldn't

Source code:

# bugreport
# Built with Seahorse v0.2.5

from seahorse.prelude import *

declare_id("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS")


class Protocol:
    bump: u8


@instruction
def init_protocol(signer: Signer, protocol: Empty[Protocol]) -> Program:
    protocol = protocol.init(payer=signer, seeds=["protocol"])
    protocol.bump = u8(0)

Error message on seahorse build

seahorse build
⠋ Compiling bugreport...thread 'main' panicked at 'explicit panic', src/core/compile/build/mod.rs:248:18
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
⠙ Compiling bugreport...%

@ameliatastic
Copy link
Owner

Hi, sorry for missing this! This isn't a compiler bug, but there is an unreported reason behind the error. You need to make Protocol inherit from Account:

class Protocol(Account):
    bump: u8

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

No branches or pull requests

2 participants