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

Upgrade to fuel-vm 0.45.0 #1640

Merged
merged 3 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Description of the upcoming release here.

### Changed

- [#1600](https://github.com/FuelLabs/fuel-core/pull/1600): Upgrade to fuel-vm 0.44.0
- [#1600](https://github.com/FuelLabs/fuel-core/pull/1640): Upgrade to fuel-vm 0.45.0
- [#1633](https://github.com/FuelLabs/fuel-core/pull/1633): Notify services about importing of the genesis block.
- [#1625](https://github.com/FuelLabs/fuel-core/pull/1625): Making relayer independent from the executor and preparation for the force transaction inclusion.
- [#1613](https://github.com/FuelLabs/fuel-core/pull/1613): Add api endpoint to retrieve a message by its nonce.
Expand Down
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fuel-core-tests = { version = "0.0.0", path = "./tests" }
fuel-core-xtask = { version = "0.0.0", path = "./xtask" }

# Fuel dependencies
fuel-vm-private = { version = "0.44.0", package = "fuel-vm", default-features = false }
fuel-vm-private = { version = "0.45.0", package = "fuel-vm", default-features = false }

# Common dependencies
anyhow = "1.0"
Expand Down
14 changes: 11 additions & 3 deletions crates/client/src/client/schema/tx/transparent_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl TryFrom<Transaction> for fuel_tx::Transaction {
.collect(),
);
create.into()
} else if tx.is_mint {
} else {
let tx_pointer: fuel_tx::TxPointer = tx
.tx_pointer
.ok_or_else(|| ConversionError::MissingField("tx_pointer".to_string()))?
Expand Down Expand Up @@ -279,8 +279,16 @@ impl TryFrom<Transaction> for fuel_tx::Transaction {
.into(),
);
mint.into()
} else {
return Err(ConversionError::UnknownVariant("Transaction"));
};

// This `match` block is added here to enforce compilation error if a new variant
// 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 {
fuel_tx::Transaction::Script(_) => {}
fuel_tx::Transaction::Create(_) => {}
fuel_tx::Transaction::Mint(_) => {}
};

Ok(tx)
Expand Down
3 changes: 1 addition & 2 deletions crates/fuel-core/src/graphql_api/worker_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ where
inputs = tx.inputs().as_slice();
outputs = tx.outputs().as_slice();
}
_ => continue,
Transaction::Mint(_) => continue,
}
self.persist_owners_index(
block_height,
Expand Down Expand Up @@ -143,7 +143,6 @@ where
owners.push(to);
}
Output::Contract(_) | Output::ContractCreated { .. } => {}
_ => {}
}
}

Expand Down
1 change: 0 additions & 1 deletion crates/fuel-core/src/schema/tx/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ impl From<&fuel_tx::Input> for Input {
predicate: HexString(predicate.clone()),
predicate_data: HexString(predicate_data.clone()),
}),
input => todo!("No mapping for input {input:?}"),
}
}
}
Expand Down
14 changes: 4 additions & 10 deletions crates/fuel-core/src/schema/tx/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ pub enum Output {
ContractCreated(ContractCreated),
}

pub type OutputConversionError = String;

pub struct CoinOutput {
to: fuel_types::Address,
amount: Word,
Expand Down Expand Up @@ -121,11 +119,9 @@ impl ContractCreated {
}
}

impl TryFrom<&fuel_tx::Output> for Output {
type Error = OutputConversionError;

fn try_from(output: &fuel_tx::Output) -> Result<Self, Self::Error> {
let val = match output {
impl From<&fuel_tx::Output> for Output {
fn from(output: &fuel_tx::Output) -> Self {
match output {
fuel_tx::Output::Coin {
to,
amount,
Expand Down Expand Up @@ -161,9 +157,7 @@ impl TryFrom<&fuel_tx::Output> for Output {
contract_id: *contract_id,
state_root: *state_root,
}),
_ => return Err(format!("Unsupported output type: {:?}", output)),
};
Ok(val)
}
}
}

Expand Down
Loading
Loading