Skip to content

Commit aa9509c

Browse files
authored
chore(target_chains/fuel): update fuel packages (#1837)
* chore(target_chains/fuel): update fuel packages * chore: add wasm32-unknown-unknown target * chore: update fuels package in `contract_manager` * chore: resolve lint issues
1 parent e82158d commit aa9509c

File tree

21 files changed

+4999
-5600
lines changed

21 files changed

+4999
-5600
lines changed

.github/workflows/ci-fuel-contract.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
run: forc build --verbose
3030
- name: Run tests with Forc
3131
run: forc test --verbose
32+
- name: Rust add wasm32-unknown-unknown target
33+
run: rustup target add wasm32-unknown-unknown
3234
- name: Build
3335
run: cargo build --verbose
3436
- name: Run tests

contract_manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"axios": "^0.24.0",
4646
"bs58": "^5.0.0",
4747
"extract-files": "^13.0.0",
48-
"fuels": "^0.89.2",
48+
"fuels": "^0.94.0",
4949
"ramda": "^0.30.1",
5050
"starknet": "^6.9.0",
5151
"ts-node": "^10.9.1",

contract_manager/src/contracts/fuel.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
Wallet,
1414
arrayify,
1515
hexlify,
16-
InvocationCallResult,
16+
DryRunResult,
1717
} from "fuels";
1818
import { PriceFeed, PriceFeedContract, PrivateKey, TxResult } from "../base";
1919

@@ -99,9 +99,12 @@ export class FuelWormholeContract extends WormholeContract {
9999
const tx = await contract.functions
100100
.submit_new_guardian_set(arrayify(vaa))
101101
.call(); // you might get `Error updating Guardianset for fuel_testnet_{address} TypeError: response.body.getReader is not a function` but the tx could still be successful, this is due to fuels using native fetch but some other packages in the monorepo is using node-fetch which overrides the fetch here
102+
103+
const txResult = await tx.waitForResult();
104+
102105
return {
103106
id: tx.transactionId,
104-
info: JSON.stringify(tx.transactionResponse),
107+
info: JSON.stringify(txResult.transactionResponse),
105108
};
106109
}
107110
}
@@ -217,7 +220,7 @@ export class FuelPriceFeedContract extends PriceFeedContract {
217220

218221
async getDataSources(): Promise<DataSource[]> {
219222
const pythContract = await this.getContract();
220-
const result: InvocationCallResult<DataSourceOutput[]> =
223+
const result: DryRunResult<DataSourceOutput[]> =
221224
await pythContract.functions.valid_data_sources().get();
222225
return result.value.map(
223226
({
@@ -237,8 +240,9 @@ export class FuelPriceFeedContract extends PriceFeedContract {
237240

238241
async getGovernanceDataSource(): Promise<DataSource> {
239242
const pythContract = await this.getContract();
240-
const result: InvocationCallResult<DataSourceOutput> =
241-
await pythContract.functions.governance_data_source().get();
243+
const result: DryRunResult<DataSourceOutput> = await pythContract.functions
244+
.governance_data_source()
245+
.get();
242246
return {
243247
emitterChain: result.value.chain_id,
244248
emitterAddress: result.value.emitter_address.replace("0x", ""),
@@ -259,7 +263,9 @@ export class FuelPriceFeedContract extends PriceFeedContract {
259263
})
260264
.call();
261265

262-
return { id: tx.transactionId, info: tx.transactionResponse };
266+
const txResult = await tx.waitForResult();
267+
268+
return { id: tx.transactionId, info: txResult.transactionResponse };
263269
}
264270

265271
async executeGovernanceInstruction(
@@ -271,7 +277,10 @@ export class FuelPriceFeedContract extends PriceFeedContract {
271277
const tx = await contract.functions
272278
.execute_governance_instruction(arrayify(vaa))
273279
.call();
274-
return { id: tx.transactionId, info: tx.transactionResponse };
280+
281+
const txResult = await tx.waitForResult();
282+
283+
return { id: tx.transactionId, info: txResult.transactionResponse };
275284
}
276285

277286
getChain(): FuelChain {

0 commit comments

Comments
 (0)