Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
chore: upgrade to fuels 0.49 (#1443)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander <[email protected]>
  • Loading branch information
ra0x3 and deekerno authored Nov 1, 2023
1 parent b70de80 commit e67fe0d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 72 deletions.
111 changes: 54 additions & 57 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 @@ -87,7 +87,7 @@ fuel-indexer-utils = { version = "0.22.0", path = "./packages/fuel-indexer-utils
fuel-tx = { version = "=0.35.3", default-features = false }
fuel-types = { version = "=0.35.3", default-features = false, features = ["serde"] }
fuel-vm = { version = "=0.35.3", default-features = false }
fuels = { version = "0.46", default-features = false }
fuels = { version = "0.49", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0", default-features = false }
thiserror = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/greetings/greetings-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fuel-indexer-lib = { workspace = true }
fuel-indexer-tests = { version = "0.0.0", path = "./../../../packages/fuel-indexer-tests" }
fuel-tx = { workspace = true }
fuel-types = { workspace = true }
fuels = { version = "0.46" }
fuels = { version = "0.49" }
rand = "0.8"
thiserror = { workspace = true }
tokio = { features = ["macros", "rt-multi-thread"], workspace = true }
5 changes: 3 additions & 2 deletions packages/fuel-indexer-macros/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub fn decode_snippet(
let inner = format_ident! { "{}", inner };
quote! {
#ty_id => {
let decoded = ABIDecoder::decode_single(&#typ::<#inner>::param_type(), &data)
let decoded = decoder.decode(&#typ::<#inner>::param_type(), &data)
.with_context(|| format!("[codegen] Failed decoding {}", #type_field_string))?;
let obj = #typ::<#inner>::from_token(decoded)
.with_context(|| format!("[codegen] Failed detokenizing {}", #type_field_string))?;
Expand All @@ -238,7 +238,8 @@ pub fn decode_snippet(
} else {
quote! {
#ty_id => {
let decoded = ABIDecoder::decode_single(&#type_tokens::param_type(), &data)
let decoder = ABIDecoder::default();
let decoded = decoder.decode(&#type_tokens::param_type(), &data)
.with_context(|| format!("[codegen] Failed decoding {}", #type_field_string))?;
let obj = #type_tokens::from_token(decoded)
.with_context(|| format!("[codegen] Failed detokenizing {}", #type_field_string))?;
Expand Down
1 change: 1 addition & 0 deletions packages/fuel-indexer-macros/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ fn process_fn_items(
}

fn decode_type(&mut self, ty_id: usize, data: Vec<u8>) -> anyhow::Result<()> {
let decoder = ABIDecoder::default();
match ty_id {
#(#decoders),*
_ => {
Expand Down
4 changes: 2 additions & 2 deletions packages/fuel-indexer-macros/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ fn wasm_prelude() -> proc_macro2::TokenStream {
use fuel_indexer_utils::plugin::{serde_json, serialize, deserialize, bincode};
use fuel_indexer_utils::plugin::serde::{Deserialize, Serialize};
use fuels::{
core::{codec::ABIDecoder, Configurables, traits::{Parameterize, Tokenizable}},
types::{StringToken, param_types::ParamType},
core::{codec::{ABIDecoder}, Configurables, traits::{Parameterize, Tokenizable}},
types::{param_types::ParamType},
};
}
}
2 changes: 1 addition & 1 deletion packages/fuel-indexer-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fuel-indexer-types = { workspace = true }
fuel-indexer-utils = { workspace = true }
fuel-tx = { workspace = true }
fuel-types = { workspace = true }
fuels = { features = ["fuel-core-lib", "std"], version = "0.46" }
fuels = { features = ["fuel-core-lib", "std"], version = "0.49" }
fuels-macros = { version = "0.46", default-features = false }
futures = "0.3"
hex = "0.4"
Expand Down
12 changes: 5 additions & 7 deletions packages/fuel-indexer-tests/src/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ use fuel_indexer_postgres;
use fuels::{
macros::abigen,
prelude::{
setup_single_asset_coins, setup_test_client, AssetId, Bech32ContractId, Contract,
LoadConfiguration, Provider, TxParameters, WalletUnlocked, DEFAULT_COIN_AMOUNT,
setup_single_asset_coins, setup_test_provider, AssetId, Bech32ContractId,
Contract, LoadConfiguration, Provider, TxParameters, WalletUnlocked,
DEFAULT_COIN_AMOUNT,
},
test_helpers::Config,
};
Expand Down Expand Up @@ -268,7 +269,7 @@ pub fn tx_params() -> TxParameters {
let gas_price = 0;
let gas_limit = 1_000_000;
let byte_price = 0;
TxParameters::new(gas_price, gas_limit, byte_price)
TxParameters::new(Some(gas_price), Some(gas_limit), byte_price)
}

pub async fn setup_test_fuel_node(
Expand Down Expand Up @@ -315,10 +316,7 @@ pub async fn setup_test_fuel_node(
..Config::local_node()
};

let (client, _, consensus_params) =
setup_test_client(coins, vec![], Some(config), None).await;

let provider = Provider::new(client, consensus_params);
let provider = setup_test_provider(coins, vec![], Some(config), None).await;

wallet.set_provider(provider.clone());

Expand Down
2 changes: 1 addition & 1 deletion plugins/forc-index/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ crate-type = ['cdylib']
[dependencies]
fuel-indexer-utils = {{ version = "0.22" }}
fuels = {{ version = "0.46", default-features = false }}
fuels = {{ version = "0.49", default-features = false }}
getrandom = {{ version = "0.2", features = ["js"] }}
serde = {{ version = "1.0", default-features = false, features = ["derive"] }}
"#
Expand Down

0 comments on commit e67fe0d

Please sign in to comment.