-
Notifications
You must be signed in to change notification settings - Fork 546
Open
Labels
App: Name RegistryLabel used to filter for the app issueLabel used to filter for the app issueAwaiting SDK feature(s)SDK does not support desired functionality, yetSDK does not support desired functionality, yet
Description
Once fuels-rs 0.42.0
is available, the test utility function get_timestamp_and_call
can be refactored in order to get the timestamp
from a transaction, as opposed to a hard-coded value. An example of how the refactor might look:
pub(crate) async fn get_timestamp_and_call<T, D>(
handler: ContractCallHandler<T, D>,
) -> (FuelCallResponse<D>, u64)
where
T: FuelAccount,
D: Tokenizable + Debug,
{
let call_response = handler.call().await.unwrap();
let tx_id = call_response.tx_id;
let provider = handler.account.try_provider().unwrap();
let tx_response = provider
.get_transaction_by_id(&tx_id)
.await
.unwrap()
.unwrap();
let time = tx_response.time.unwrap().timestamp().try_into().unwrap();
(call_response, time)
}
This requires the release of fuels-rs 0.42.0
in order to access the tx_id
from a FuelCallResponse, made available by:
FuelLabs/fuels-rs#734
This should also allow for testing on currently ignored
tests
Metadata
Metadata
Assignees
Labels
App: Name RegistryLabel used to filter for the app issueLabel used to filter for the app issueAwaiting SDK feature(s)SDK does not support desired functionality, yetSDK does not support desired functionality, yet