-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Refactoring of getters/setters/offset and adapt fuel-core
#716
Conversation
…oa encounters an error
…eature/methods-refactoring-2 # Conflicts: # fuel-block-producer/src/block_producer.rs # fuel-block-producer/src/ports.rs # fuel-core-interfaces/src/executor.rs # fuel-core/src/executor.rs # fuel-core/src/schema/tx.rs # fuel-tests/tests/messages.rs # fuel-tests/tests/tx.rs # fuel-tests/tests/tx/utxo_validation.rs # fuel-txpool/src/txpool.rs
…ing-2 # Conflicts: # fuel-tests/tests/messages.rs # fuel-tests/tests/metrics.rs # fuel-tests/tests/relayer.rs # fuel-tests/tests/tx.rs # fuel-tests/tests/tx/predicates.rs # fuel-tests/tests/tx/utxo_validation.rs # fuel-tests/tests/tx_gossip.rs
// is added into the `fuel_tx::Transaction` enum. | ||
// | ||
// If you face a compilation error, please update the code above and add a new variant below. | ||
match tx { |
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.
nice
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.
left few minor comments, looks solid
should we just combine this PR with the mint PR now? Seems like we won't be able to really merge them separately since the types were released together in fuel-tx/fuel-vm. |
We can combine them to make it easy for me=D But I also can create temporary branches in |
# Conflicts: # Cargo.lock # fuel-client/Cargo.toml # fuel-client/src/client/schema/tx/transparent_receipt.rs # fuel-client/src/client/schema/tx/transparent_tx.rs # fuel-core-interfaces/Cargo.toml # fuel-core/src/executor.rs # fuel-core/src/schema/tx/types.rs # fuel-tests/tests/tx/utxo_validation.rs
I moved the implementation of the coinbase logic into a separate PR #726. This PR contains refactoring with a dummy implementation of |
@@ -130,15 +117,17 @@ impl BlockProducer for MockBlockProducer { | |||
} | |||
} | |||
|
|||
// TODO: The same code is in the `adapters::transaction_selector::select_transactions`. We need | |||
// to move transaction selection logic into `TxPool` to avoid duplication of the code in tests. |
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 may make more sense to abstract these fns as a separate module, since these tests use a mocked tx pool and shouldn't take a direct dep on the txpool crate.
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.
for such a drastic internal structure change to the txs, the breaking impact here actually seems quite minimal. Nice work!
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.
Nice, will be good to get this merged asap
Better to merge #702 first before merging this change because the new version of
fuel-vm
also has other changes.Applied changes from new
fuel-tx
andfuel-vm
:Checked<Tx>
type instead ofCheckedTransaction
.Create
andMint
) into generic methods.Interpreter<Database>
withInterpreter<Database, Tx>
andInterpreter<Database, Script>
accordingly to the logic around(SeeConcreteStorage
).Added a new
PoolTransaction
type that describes transactions stored and accepted by theTxPool
. It is prepared to supportMint
transactions that should be excluded fromTxPool
. Another solved TODO by this change - store only checked transactions in theTxPool
and pass them intoProducer
(becausePoolTransaction
stores only checked transactions inside).The
TransactionBuilder
fromfuel-vm
andfuel-tx
now generate transaction of exact type asScript
orCreate
instead ofTransaction
. Almost all tests in thefuel-core
prefer to work with theTransaction
type, so there is a lot of conversionScript
/Create
intoTransaction
.Close #513