Open
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