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

ci(release): v0.97.0 @ master #3347

Merged
merged 2 commits into from
Nov 15, 2024
Merged

ci(release): v0.97.0 @ master #3347

merged 2 commits into from
Nov 15, 2024

Conversation

fuel-service-user
Copy link
Contributor

@fuel-service-user fuel-service-user commented Oct 21, 2024

Summary

In this release, we:

  • Implemented batch transfer to contracts
  • Optimized the getMessageByNonce provider endpoint
  • Upgraded fuel-core to v0.40.0
  • Optimize graphQL query for Provider.getTransactions
  • Limit pagination number for getTransactionsSummaries to 60
  • Upgraded forc to v0.66.4
  • Removed blockId property from responses when listing transactions
  • Upgraded forc to v0.66.2
  • Deprecate and fix multiple receipts properties
  • Optimized the getCoins provider endpoint
  • Revised our code snippets to use a WYSIWYG format

Breaking


Features

Fixes

Chores

Docs


Migration Notes

Features

#3383 - onDeploy fuels config supports all Sway program types

  • Changed the outputted data from the onDeploy callback method for the fuels.config.ts. Instead of just emitting the deployed contracts (as an array), it will now emit an object with contracts, predicates and scripts.
// Before (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedContract } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployedContracts: DeployedContract[]) => {
    console.log('contracts', deployedContracts);
  }
});
// After (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedData } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployed: DeployedData[]) => {
    console.log('contracts', deployed.contracts);
    console.log('predicates', deployed.predicates);
    console.log('scripts', deployed.scripts);
  }
});

Fixes

#3298 - Remove unnecessary nonce from message gql queries

  • Removed the nonce property from Provider.operations.getMessageByNonce(). This can still be retrieved by Provider.getMessageByNonce().

Chores

#3389 - Refactor predicate and script deployment

ContractFactory.deployAsBlobTxForScript has been removed in favor of Predicate.deploy and Script.deploy:

// before
const factory = new ContractFactory(scriptBytecode, scriptAbi, wallet);
const { waitForResult } = await factory.deployAsBlobTxForScript();
const { loaderBytecode, configurableOffsetDiff } = await waitForResult();

// after
const script = new Script(scriptBytecode, scriptAbi, wallet);
const { blobId, waitForResult } = await script.deploy(deployerWallet);
const loaderScript = await waitForResult();

const predicate = new Predicate({ bytecode, abi, provider });
const { blobId, waitForResult } = await predicate.deploy(deployerWallet);
const loaderPredicate = await waitForResult();

#3387 - Mandate abi in Predicate constructor

Instantiating a Predicate now requires providing its abi. If you want to use the Predicate as an Account, please instantiate it via the Account class

// before
const predicate = new Predicate({ provider, bytecode }); // worked even though abi is missing

// after
const predicate = new Predicate({ abi, provider, bytecode }); // abi is now mandatory

// predicate as account
const account = new Account(predicateAddress, provider);

#3336 - Optimize getTransactions query

The response format for Provider.getTransactions remains the same. However, the response format for the query Provider.operations.getTransactions has been modified.

// before
query getTransactions {
  id
  rawPayload
  status {
    ...
  }
}
// after
query getTransactions {
  rawPayload
}

#3400 - Limit TX pagination number for getTransactionsSummaries

The pagination number for getTransactionsSummaries is limited to 60 now

// before
const { transactions } = await getTransactionsSummaries({
  provider,
  filters: {
    owner: account.address.toB256(),
    first: 200,
  },
});
// after
const { transactions } = await getTransactionsSummaries({
  provider,
  filters: {
    owner: account.address.toB256(),
    first: 60, // Limit is 60 now. A higher value will result in an error
  },
});

#3379 - Remove blockId in transaction list responses

The blockId property has been removed from the following GraphQL queries used to list past transactions:

const { transactions } = await getTransactionsSummaries({ ... });

const { transactionsByOwner } = await provider.operations.getTransactionsByOwner({ ... });

If the blockId is required for a given transaction, it needs to be queried separately with getTransactionSummary helper:

import { getTransactionSummary } from 'fuels';

const transaction = await getTransactionSummary({
  id,
  provider,
});

Note: The blockId is still available in the result for a submitted transaction.

#3301 - Optimize coin gql queries

  • The Provider.operations.getCoins() and Provider.operations.getCoinsToSpend function no longer return the owner. These methods shouldn't be called directly but are used internally to formulate responses from the SDK.

  • Removed the property owner from the Provider.operations.getCoinsToSpend() function. Suggest to use the owner from the input parameters.

Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2024 0:55am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2024 0:55am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ts-docs-api ⬜️ Ignored (Inspect) Nov 15, 2024 0:55am

Copy link

codspeed-hq bot commented Oct 21, 2024

CodSpeed Performance Report

Merging #3347 will not alter performance

Comparing changeset-release/master (29b3fcb) with master (efdc721)

Summary

✅ 18 untouched benchmarks

maschad
maschad previously approved these changes Nov 15, 2024
danielbate
danielbate previously approved these changes Nov 15, 2024
Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@Torres-ssf Torres-ssf enabled auto-merge (squash) November 15, 2024 12:48
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
64.19%(+0%) 69.62%(-0.03%) 72.99%(+0%) 64.63%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)

@Torres-ssf Torres-ssf merged commit 537fdc2 into master Nov 15, 2024
34 of 37 checks passed
@Torres-ssf Torres-ssf deleted the changeset-release/master branch November 15, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants