diff --git a/master/print.html b/master/print.html index 348abd5aa3..ceded62529 100644 --- a/master/print.html +++ b/master/print.html @@ -3454,7 +3454,7 @@
LoadScript
provider.produce_blocks(blocks_to_produce, None).await?;
assert_eq!(provider.latest_block_height().await?, blocks_to_produce);
let expected_latest_block_time = origin_block_time
- .checked_add_signed(Duration::seconds((blocks_to_produce * block_time) as i64))
+ .checked_add_signed(Duration::try_seconds((blocks_to_produce * block_time) as i64).unwrap())
.unwrap();
assert_eq!(
provider.latest_block_time().await?.unwrap(),
diff --git a/master/searchindex.js b/master/searchindex.js
index 17a1f165d4..67792e477b 100644
--- a/master/searchindex.js
+++ b/master/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search, {"doc_urls":["index.html#the-fuel-rust-sdk","getting-started.html#getting-started","getting-started.html#installation-guide","getting-started.html#creating-a-new-project-with-forc","getting-started.html#adding-a-rust-integration-test-to-the-sway-project","getting-started.html#importing-the-fuel-rust-sdk","getting-started.html#the-fuel-rust-sdk-source-code","getting-started.html#more-in-depth-fuel-and-sway-knowledge","connecting/index.html#connecting-to-a-fuel-node","connecting/external-node.html#connecting-to-the-testnet-or-an-external-node","connecting/short-lived.html#running-a-short-lived-fuel-node-with-the-sdk","connecting/short-lived.html#features","connecting/short-lived.html#fuel-core-lib","connecting/short-lived.html#rocksdb","connecting/rocksdb.html#rocksdb","connecting/querying.html#querying-the-blockchain","connecting/querying.html#set-up","connecting/querying.html#get-all-coins-from-an-address","connecting/querying.html#get-spendable-resources-owned-by-an-address","connecting/querying.html#get-balances-from-an-address","connecting/retrying.html#retrying-requests","connecting/retrying.html#retryconfig","connecting/retrying.html#interval-strategy---backoff","connecting/retrying.html#variants","accounts.html#accounts","accounts.html#transferring-assets","wallets/index.html#managing-wallets","wallets/private-keys.html#creating-a-wallet-from-a-private-key","wallets/mnemonic-wallet.html#creating-a-wallet-from-mnemonic-phrases","wallets/access.html#wallet-access","wallets/access.html#wallet-states","wallets/access.html#transitioning-states","wallets/access.html#design-guidelines","wallets/encrypting-and-storing.html#encrypting-and-storing-wallets","wallets/encrypting-and-storing.html#creating-a-wallet-and-storing-an-encrypted-json-wallet-on-disk","wallets/encrypting-and-storing.html#encrypting-and-storing-a-wallet-created-from-a-mnemonic-or-private-key","wallets/checking-balances-and-coins.html#checking-balances-and-coins","wallets/test-wallets.html#setting-up-test-wallets","wallets/test-wallets.html#setting-up-multiple-test-wallets","wallets/test-wallets.html#setting-up-a-test-wallet-with-multiple-random-assets","wallets/test-wallets.html#setting-up-a-test-wallet-with-multiple-custom-assets","wallets/test-wallets.html#setting-up-assets","wallets/signing.html#signing","wallets/signing.html#adding-signers-to-a-transaction-builder","wallets/signing.html#signing-a-built-transaction","abigen/index.html#generating-bindings-with-abigen","abigen/the-json-abi-file.html#the-json-abi-file","abigen/the-abigen-macro.html#abigen","abigen/the-abigen-macro.html#how-does-the-generated-code-look","abigen/the-abigen-macro.html#type-paths","abigen/the-abigen-macro.html#using-the-bindings","deploying/index.html#deploying-contracts","deploying/index.html#deploying-a-contract-binary","deploying/configurable-constants.html#configurable-constants","deploying/storage-slots.html#overriding-storage-slots","deploying/interacting-with-contracts.html#interacting-with-contracts","deploying/the-fuelvm-binary-file.html#the-fuelvm-binary-file","calling-contracts/index.html#calling-contracts","calling-contracts/calls-with-different-wallets.html#calls-with-different-wallets","calling-contracts/tx-policies.html#transaction-policies","calling-contracts/call-params.html#call-parameters","calling-contracts/custom-asset-transfer.html#custom-asset-transfer","calling-contracts/call-response.html#call-response","calling-contracts/call-response.html#error-handling","calling-contracts/logs.html#logs","calling-contracts/variable-outputs.html#output-variables","calling-contracts/read-only.html#read-only-calls","calling-contracts/other-contracts.html#calling-other-contracts","calling-contracts/multicalls.html#multiple-contract-calls","calling-contracts/multicalls.html#output-values","calling-contracts/tx-dependency-estimation.html#transaction-dependency-estimation","calling-contracts/cost-estimation.html#estimating-contract-call-cost","calling-contracts/low-level-calls.html#low-level-calls","running-scripts.html#running-scripts","running-scripts.html#running-scripts-with-transaction-policies","running-scripts.html#logs","running-scripts.html#calling-contracts-from-scripts","running-scripts.html#configurable-constants","predicates/index.html#predicates","predicates/index.html#instantiating-predicates","predicates/index.html#configurable-constants","predicates/send-spend-predicate.html#signatures-in-predicates-example","custom-transactions/index.html#custom-transactions","custom-transactions/transaction-builders.html#transaction-builders","custom-transactions/transaction-builders.html#role-of-the-transaction-builders","custom-transactions/transaction-builders.html#creating-a-custom-transaction","custom-transactions/transaction-builders.html#building-a-transaction-without-signatures","custom-transactions/custom-calls.html#custom-contract-and-script-calls","custom-transactions/custom-calls.html#custom-contract-call","custom-transactions/custom-calls.html#custom-script-call","types/index.html#types","types/bytes32.html#bytes32","types/address.html#address","types/contract-id.html#contractid","types/asset-id.html#assetid","types/conversion.html#converting-native-types","types/bech32.html#bech32","types/custom_types.html#structs-and-enums","types/custom_types.html#generics","types/custom_types.html#unused-generic-type-parameters","types/string.html#string","types/bits256.html#bits256","types/bytes.html#bytes","types/B512.html#b512","types/evm_address.html#evmaddress","types/vectors.html#vectors","types/vectors.html#passing-in-vectors","types/vectors.html#returning-vectors","codec/index.html#codec","codec/index.html#prerequisites-for-decodingencoding","codec/index.html#deriving-the-traits","codec/index.html#tweaking-the-derivation","codec/encoding.html#encoding","codec/encoding.html#configuring-the-encoder","codec/encoding.html#configuring-the-encoder-for-contractscript-calls","codec/decoding.html#decoding","codec/decoding.html#configuring-the-decoder","codec/decoding.html#configuring-the-decoder-for-contractscript-calls","reference.html#api-reference","testing/index.html#fuels-rs-testing","testing/basics.html#testing-basics","testing/basics.html#the-assert-macro","testing/basics.html#the-assert_eq-macro","testing/basics.html#the-assert_ne-macro","testing/basics.html#the-println-macro","testing/basics.html#run-commands","testing/the-setup-program-test-macro.html#the-setup_program_test-macro","testing/the-setup-program-test-macro.html#wallets","testing/the-setup-program-test-macro.html#abigen","testing/the-setup-program-test-macro.html#deploy","testing/the-setup-program-test-macro.html#loadscript","testing/chains.html#increasing-the-block-height","cookbook/index.html#cookbook","cookbook/custom-chain.html#custom-chain","cookbook/deposit-and-withdraw.html#deposit-and-withdraw","cookbook/transfer-all-assets.html#transfer-all-assets","debugging/index.html#debugging","debugging/function-selector.html#function-selector","debugging/function-selector.html#if-you-dont-have-the-paramtype","glossary.html#glossary","glossary.html#contract","glossary.html#provider","glossary.html#wallet-and-signer","contributing/CONTRIBUTING.html#contributing-to-the-fuel-rust-sdk","contributing/CONTRIBUTING.html#finding-something-to-work-on","contributing/CONTRIBUTING.html#contribution-flow","contributing/CONTRIBUTING.html#linking-issues","contributing/tests-structure.html#integration-tests-structure-in-fuels-rs","cli/index.html#fuels-rs-rust-workspaces","cli/fuels-abi-cli.html#fuels-abi-cli","cli/fuels-abi-cli.html#usage","cli/fuels-abi-cli.html#examples","cli/fuels-abi-cli.html#encoding-params-only","cli/fuels-abi-cli.html#encoding-function-call","cli/fuels-abi-cli.html#decoding-params-only","cli/fuels-abi-cli.html#decoding-function-output"],"index":{"documentStore":{"docInfo":{"0":{"body":51,"breadcrumbs":6,"title":3},"1":{"body":0,"breadcrumbs":4,"title":2},"10":{"body":69,"breadcrumbs":15,"title":6},"100":{"body":106,"breadcrumbs":3,"title":1},"101":{"body":59,"breadcrumbs":3,"title":1},"102":{"body":48,"breadcrumbs":3,"title":1},"103":{"body":33,"breadcrumbs":3,"title":1},"104":{"body":57,"breadcrumbs":3,"title":1},"105":{"body":0,"breadcrumbs":3,"title":1},"106":{"body":29,"breadcrumbs":4,"title":2},"107":{"body":32,"breadcrumbs":4,"title":2},"108":{"body":12,"breadcrumbs":2,"title":1},"109":{"body":65,"breadcrumbs":3,"title":2},"11":{"body":0,"breadcrumbs":10,"title":1},"110":{"body":34,"breadcrumbs":3,"title":2},"111":{"body":48,"breadcrumbs":3,"title":2},"112":{"body":90,"breadcrumbs":3,"title":1},"113":{"body":30,"breadcrumbs":4,"title":2},"114":{"body":25,"breadcrumbs":6,"title":4},"115":{"body":93,"breadcrumbs":3,"title":1},"116":{"body":32,"breadcrumbs":4,"title":2},"117":{"body":24,"breadcrumbs":6,"title":4},"118":{"body":23,"breadcrumbs":4,"title":2},"119":{"body":11,"breadcrumbs":4,"title":3},"12":{"body":37,"breadcrumbs":12,"title":3},"120":{"body":11,"breadcrumbs":5,"title":2},"121":{"body":18,"breadcrumbs":5,"title":2},"122":{"body":16,"breadcrumbs":5,"title":2},"123":{"body":11,"breadcrumbs":5,"title":2},"124":{"body":98,"breadcrumbs":5,"title":2},"125":{"body":26,"breadcrumbs":5,"title":2},"126":{"body":68,"breadcrumbs":5,"title":2},"127":{"body":16,"breadcrumbs":4,"title":1},"128":{"body":32,"breadcrumbs":4,"title":1},"129":{"body":45,"breadcrumbs":4,"title":1},"13":{"body":20,"breadcrumbs":10,"title":1},"130":{"body":220,"breadcrumbs":4,"title":1},"131":{"body":91,"breadcrumbs":6,"title":3},"132":{"body":30,"breadcrumbs":2,"title":1},"133":{"body":78,"breadcrumbs":6,"title":2},"134":{"body":282,"breadcrumbs":5,"title":2},"135":{"body":200,"breadcrumbs":5,"title":2},"136":{"body":7,"breadcrumbs":2,"title":1},"137":{"body":46,"breadcrumbs":5,"title":2},"138":{"body":56,"breadcrumbs":5,"title":2},"139":{"body":0,"breadcrumbs":2,"title":1},"14":{"body":44,"breadcrumbs":5,"title":1},"140":{"body":24,"breadcrumbs":2,"title":1},"141":{"body":15,"breadcrumbs":2,"title":1},"142":{"body":37,"breadcrumbs":3,"title":2},"143":{"body":24,"breadcrumbs":5,"title":4},"144":{"body":52,"breadcrumbs":4,"title":3},"145":{"body":111,"breadcrumbs":3,"title":2},"146":{"body":50,"breadcrumbs":3,"title":2},"147":{"body":99,"breadcrumbs":9,"title":5},"148":{"body":13,"breadcrumbs":7,"title":4},"149":{"body":15,"breadcrumbs":9,"title":3},"15":{"body":30,"breadcrumbs":7,"title":2},"150":{"body":44,"breadcrumbs":7,"title":1},"151":{"body":20,"breadcrumbs":7,"title":1},"152":{"body":41,"breadcrumbs":8,"title":2},"153":{"body":83,"breadcrumbs":9,"title":3},"154":{"body":17,"breadcrumbs":8,"title":2},"155":{"body":8,"breadcrumbs":9,"title":3},"16":{"body":53,"breadcrumbs":7,"title":2},"17":{"body":13,"breadcrumbs":7,"title":2},"18":{"body":68,"breadcrumbs":9,"title":4},"19":{"body":21,"breadcrumbs":7,"title":2},"2":{"body":42,"breadcrumbs":4,"title":2},"20":{"body":29,"breadcrumbs":8,"title":2},"21":{"body":33,"breadcrumbs":7,"title":1},"22":{"body":22,"breadcrumbs":9,"title":3},"23":{"body":29,"breadcrumbs":7,"title":1},"24":{"body":43,"breadcrumbs":2,"title":1},"25":{"body":233,"breadcrumbs":3,"title":2},"26":{"body":77,"breadcrumbs":4,"title":2},"27":{"body":84,"breadcrumbs":10,"title":4},"28":{"body":129,"breadcrumbs":10,"title":4},"29":{"body":25,"breadcrumbs":6,"title":2},"3":{"body":15,"breadcrumbs":6,"title":4},"30":{"body":87,"breadcrumbs":6,"title":2},"31":{"body":42,"breadcrumbs":6,"title":2},"32":{"body":32,"breadcrumbs":6,"title":2},"33":{"body":0,"breadcrumbs":8,"title":3},"34":{"body":67,"breadcrumbs":12,"title":7},"35":{"body":58,"breadcrumbs":12,"title":7},"36":{"body":75,"breadcrumbs":8,"title":3},"37":{"body":10,"breadcrumbs":10,"title":4},"38":{"body":68,"breadcrumbs":11,"title":5},"39":{"body":68,"breadcrumbs":13,"title":7},"4":{"body":100,"breadcrumbs":8,"title":6},"40":{"body":89,"breadcrumbs":13,"title":7},"41":{"body":131,"breadcrumbs":9,"title":3},"42":{"body":63,"breadcrumbs":4,"title":1},"43":{"body":110,"breadcrumbs":7,"title":4},"44":{"body":10,"breadcrumbs":6,"title":3},"45":{"body":47,"breadcrumbs":6,"title":3},"46":{"body":72,"breadcrumbs":9,"title":3},"47":{"body":49,"breadcrumbs":6,"title":1},"48":{"body":210,"breadcrumbs":8,"title":3},"49":{"body":86,"breadcrumbs":7,"title":2},"5":{"body":24,"breadcrumbs":6,"title":4},"50":{"body":394,"breadcrumbs":7,"title":2},"51":{"body":14,"breadcrumbs":4,"title":2},"52":{"body":237,"breadcrumbs":5,"title":3},"53":{"body":141,"breadcrumbs":6,"title":2},"54":{"body":73,"breadcrumbs":7,"title":3},"55":{"body":98,"breadcrumbs":6,"title":2},"56":{"body":234,"breadcrumbs":8,"title":3},"57":{"body":129,"breadcrumbs":4,"title":2},"58":{"body":93,"breadcrumbs":7,"title":3},"59":{"body":144,"breadcrumbs":6,"title":2},"6":{"body":76,"breadcrumbs":7,"title":5},"60":{"body":253,"breadcrumbs":6,"title":2},"61":{"body":30,"breadcrumbs":8,"title":3},"62":{"body":126,"breadcrumbs":6,"title":2},"63":{"body":33,"breadcrumbs":6,"title":2},"64":{"body":166,"breadcrumbs":4,"title":1},"65":{"body":94,"breadcrumbs":7,"title":2},"66":{"body":66,"breadcrumbs":6,"title":2},"67":{"body":76,"breadcrumbs":6,"title":2},"68":{"body":80,"breadcrumbs":8,"title":3},"69":{"body":69,"breadcrumbs":7,"title":2},"7":{"body":14,"breadcrumbs":7,"title":5},"70":{"body":159,"breadcrumbs":8,"title":3},"71":{"body":96,"breadcrumbs":8,"title":4},"72":{"body":128,"breadcrumbs":8,"title":3},"73":{"body":67,"breadcrumbs":4,"title":2},"74":{"body":20,"breadcrumbs":6,"title":4},"75":{"body":32,"breadcrumbs":3,"title":1},"76":{"body":28,"breadcrumbs":5,"title":3},"77":{"body":129,"breadcrumbs":4,"title":2},"78":{"body":53,"breadcrumbs":2,"title":1},"79":{"body":180,"breadcrumbs":3,"title":2},"8":{"body":76,"breadcrumbs":6,"title":3},"80":{"body":118,"breadcrumbs":3,"title":2},"81":{"body":279,"breadcrumbs":6,"title":3},"82":{"body":28,"breadcrumbs":4,"title":2},"83":{"body":25,"breadcrumbs":6,"title":2},"84":{"body":147,"breadcrumbs":7,"title":3},"85":{"body":281,"breadcrumbs":7,"title":3},"86":{"body":46,"breadcrumbs":8,"title":4},"87":{"body":44,"breadcrumbs":10,"title":4},"88":{"body":21,"breadcrumbs":9,"title":3},"89":{"body":22,"breadcrumbs":9,"title":3},"9":{"body":116,"breadcrumbs":11,"title":4},"90":{"body":13,"breadcrumbs":2,"title":1},"91":{"body":123,"breadcrumbs":3,"title":1},"92":{"body":54,"breadcrumbs":3,"title":1},"93":{"body":54,"breadcrumbs":3,"title":1},"94":{"body":54,"breadcrumbs":3,"title":1},"95":{"body":35,"breadcrumbs":7,"title":3},"96":{"body":87,"breadcrumbs":3,"title":1},"97":{"body":67,"breadcrumbs":5,"title":2},"98":{"body":71,"breadcrumbs":4,"title":1},"99":{"body":108,"breadcrumbs":7,"title":4}},"docs":{"0":{"body":"The Fuel Rust SDK can be used for a variety of things, including: Compiling, deploying, and testing Sway contracts Using the testnet or running a local Fuel node Crafting and signing transactions with hand-crafted scripts or contract calls Generating type-safe Rust bindings of contract ABI methods This book is an overview of the different things one can achieve using the Rust SDK, and how to implement them. Keep in mind that both the SDK and the documentation are works-in-progress!","breadcrumbs":"The Fuel Rust SDK » The Fuel Rust SDK","id":"0","title":"The Fuel Rust SDK"},"1":{"body":"","breadcrumbs":"Getting Started » Getting Started","id":"1","title":"Getting Started"},"10":{"body":"You can use the SDK to spin up a local, ideally short-lived Fuel node. Then, you can instantiate a Fuel client, pointing to this node. use fuels::prelude::{FuelService, Provider}; // Run the fuel node. let server = FuelService::start(Config::default()).await?; // Create a client that will talk to the node created above. let client = Provider::from(server.bound_address()).await?; assert!(client.healthy().await?); This approach is ideal for contract testing. You can also use the test helper setup_test_provider() for this: use fuels::prelude::*; // Use the test helper to setup a test provider. let provider = setup_test_provider(vec![], vec![], None, None).await?; // Create the wallet. let _wallet = WalletUnlocked::new_random(Some(provider)); You can also use launch_provider_and_get_wallet(), which abstracts away the setup_test_provider() and the wallet creation, all in one single method: let wallet = launch_provider_and_get_wallet().await?;","breadcrumbs":"Connecting to a Fuel node » Running a short-lived Fuel node with the SDK » Running a short-lived Fuel node with the SDK","id":"10","title":"Running a short-lived Fuel node with the SDK"},"100":{"body":"The Rust SDK represents Fuel's Strings as SizedAsciiString