You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users have to use their Wallet to pay for a transaction. However, there are many use cases where a user wants to pass a Predicate, instead of a Wallet, to pay for a transaction. The actual UTXOs used to pay for the transaction must be unlocked in the predicate passed.
For example:
constcontract=ExampleContractAbi__factory.connect(wallet);letresponse=awaitcontract.functions.initialize_counter(42)// Build the ABI call.call()// Perform the network call
Here, we link a Wallet to the contract instance. Underneath, it will grab this wallet's funds to pay for the transaction.
With this new feature, one could pass in a Predicate instead of a Wallet, and, underneath, the predicate would be evaluated, and, if true, the UTXOs unlocked would be used to pay for the tx fees.
This is based by a feedback we got from an external developer, here's what was said about this feature request:
When I want to spend utxos from a predicate, there should be a wallet that offers the same kind of features as a wallet for a simple public key address. Currently, you need to initialize the wallet with a key, and that will also be the address that pays for the fees. If I have a predicate, I generally want to pay for the fees with the coins available in the utxos on the predicate address. A public-key based address should not be required to manage a predicate wallet.
Issue #757 would include tests using a predicate to execute script call. Once this issue is done and scripts are done, it would be possible to implement tests for calling a Script using Predicate as a Wallet, closing the issue #757.
Users have to use their
Wallet
to pay for a transaction. However, there are many use cases where a user wants to pass aPredicate
, instead of aWallet
, to pay for a transaction. The actual UTXOs used to pay for the transaction must be unlocked in the predicate passed.For example:
Here, we link a
Wallet
to the contract instance. Underneath, it will grab this wallet's funds to pay for the transaction.With this new feature, one could pass in a
Predicate
instead of aWallet
, and, underneath, the predicate would be evaluated, and, if true, the UTXOs unlocked would be used to pay for the tx fees.This is based by a feedback we got from an external developer, here's what was said about this feature request:
Base issue: FuelLabs/fuels-rs#809
The text was updated successfully, but these errors were encountered: