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
Currently the only way to sign a execution is through Account::sign_execution which takes in a RawExecution, however this type has no way to be made by users of the library making it so the only way to use this API is for internal purposes and through the unsafe mem::transmute.
The simplest solution to this would be to make a RawExecution::new associated function or to make the method Execution::to_raw which would return a Option<RawExecution> (though this forces uses to have to add a unwrap if they know the Execution has a nonce and a max_fee)
The text was updated successfully, but these errors were encountered:
Hi sorry for the delay. I think it makes sense to allow construction of this type. I just want a bit more context on cases where this is useful. Care to elaborate?
@xJonathanLEI Thanks for the reply! The use case that initially caused this PR to be made was for when a load testing framework required that its own http request functions be used to get benchmarking metrics, meaning we have to prepare the requests ourselves as well. This code is currently what we have to do, which is not ideal since any version upgrades might break the code and it is generally not very idiomatic.
It is also very confusing to users of the library to have public methods they could use that have parameters that they cannot construct, ideally it would be a private method if that is the case or the type would be made publicly constructable.
Currently the only way to sign a execution is through
Account::sign_execution
which takes in aRawExecution
, however this type has no way to be made by users of the library making it so the only way to use this API is for internal purposes and through the unsafemem::transmute
.The simplest solution to this would be to make a
RawExecution::new
associated function or to make the methodExecution::to_raw
which would return aOption<RawExecution>
(though this forces uses to have to add a unwrap if they know the Execution has anonce
and amax_fee
)The text was updated successfully, but these errors were encountered: