-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add new tx specific GTFArgs and make new generic GTFArgs to replace duplication #882
Conversation
// Maybe use predicates to check create context? | ||
// TODO GTFArgs::CreateBytecodeLength | ||
// TODO GTFArgs::CreateBytecodeWitnessIndex | ||
// TODO GTFArgs::CreateStorageSlotsCount | ||
// TODO GTFArgs::CreateSalt | ||
// TODO GTFArgs::CreateStorageSlotAtIndex | ||
// TODO GTFArgs::OutputContractCreatedContractId | ||
// TODO GTFArgs::OutputContractCreatedStateRoot | ||
|
||
// blocked by https://github.com/FuelLabs/fuel-vm/issues/59 | ||
// TODO GTFArgs::InputCoinTxPointer | ||
// TODO GTFArgs::InputContractTxPointer |
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.
Why do we remove these todos?=D
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.
Because I added all the tests to tests them all in the PR héhé (it was loooong)
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 don't see where we test CreateBytecodeLength
, CreateBytecodeWitnessIndex
, CreateSalt
, CreateStorageSlotAtIndex
, OutputContractCreatedContractId
, OutputContractCreatedStateRoot
, InputCoinTxPointer
, InputContractTxPointer
GTF opcodes. Could you point to corresponding tests please?
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.
It starts here :
fuel-vm/fuel-vm/src/tests/metadata.rs
Line 1025 in 067d836
fn get__create_specific_transaction_fields__success() { |
Side node : InputContractTxPointer
and InputCoinTxPointer
do not exist anymore.
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.
My bad, search in browser was not working=( Thank you!
fuel-tx/src/transaction/repr.rs
Outdated
@@ -33,3 +38,19 @@ impl From<&Transaction> for TransactionRepr { | |||
} | |||
} | |||
} | |||
|
|||
impl TryFrom<Word> for TransactionRepr { |
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 don't see where do we use it. Could you point please?=)
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.
It's used here :
fuel-vm/fuel-vm/src/interpreter/metadata.rs
Line 648 in 4618cf6
<Tx as ExecutableTransaction>::transaction_type().try_into()?; |
Which is a internal type that allow more clean matching for tx specific GTF here :
fuel-vm/fuel-vm/src/interpreter/metadata.rs
Line 540 in 4618cf6
match (tx_type, specific_args) { |
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.
Okay, I see. I think we don't need to put unreachable use cases(InvalidTransactionType
) into a panic reason. I think we should use Bug
in the case if Mint
transaction presents in VM, but it is not possible right now, because it doesn't implement ExecutableTransaction
trait .
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'm not sure I understand, I do nothing for now and open an issue ?
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.
Removed in a01e2a9
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.
Okey ty
#812
Add new transactions specific
GTFArgs
, creates newGTFArgs
to deprecate duplicated one between Script and Create and make them generic for all transactions implementingExecutableTransaction
.Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]