-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
bug: cannot fetch mint transactions #1203
Conversation
} | ||
} | ||
} | ||
|
||
fn unsupported_mint_operation(operation: &str) -> ! { | ||
unimplemented!("Calling `{operation}` on Mint transactions is unsupported!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it'd be better to just return an error instead of panicking? Imo we shouldn't have any public apis exposed to users that allow them to cause a panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started a discussion about not implementing this trait at all. If that for some reason isn't accepted, I'll change the trait so that methods that would have passed normally on a Script or Create will fail in the case of a Mint transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Mint
have to implement Transaction
? We use the trait as a common interface for Create
and Script
when submitting them to the provider and AFAIK submitting Mint
currently makes no sense.
IMO it's better to not implement Transaction
here since it will also guard against passing the tx where it doesn't belong.
On the other hand a transaction that is not Transaction
could be confusing. Maybe renaming the trait to something like SubmittableTransaction
would make sense.
In the VM we use a trait called |
If you take a closer look you'll notice that Mint doesn't implement You also cannot implement something like The only solution is not to implement anything for this enum and have it just be a bare enum, used so that we can return I don't see the methods of I suggest we remove the |
Ended up removing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
cdbee7c
cdbee7c
closes #1199
Mint transactions can now be fetched through the
Provider
. Implemented what made sense forMint
, left the rest asunimplemented!
. Without some hefty redesign don't see what other option is there but to violate the LSP (L for Liskov).Decided to wrap
Mint
, so that users may extract the id, outputs, etc, without having to know about the various traits from fuel.Checklist