Add IdentityClient::from_iota_client and update examples#1765
Conversation
IdentityClientBuilder as the new standard way to create an IdentityClientIdentityClient::from_iota_client and update examples
|
|
||
| #[wasm_bindgen(js_name = create)] | ||
| pub async fn new(client: WasmIdentityClientReadOnly, signer: WasmTransactionSigner) -> Result<WasmIdentityClient> { | ||
| #[allow(deprecated)] |
There was a problem hiding this comment.
Could we use IdentityClient::from_iota_client instead? ^^
There was a problem hiding this comment.
Not really, IdentityClientReadOnly doesn't expose the actual IOTA client
There was a problem hiding this comment.
Hm, was coming more from the standpoint, that we're deprecating the new function, but keep using it in the tests and WASM bindings.
I would have expected the new function not be used anymore and/or, in case of the WASM bindings, a new function to be added, that will (at some point) replace the current function, which consumes the now deprecated function, so that we could fade it out in the future.
There was a problem hiding this comment.
I did something similar with IdentityClientReadOnly but for the TS full client the same pattern doesn't apply because we can't use the typestate pattern we use in its Rust counterpart. I was thinking of just leaving it as it is for now until we roll out 2.0.
Description of change
READMEs are updated to make sure users DO NOT publish their own version of the IOTA Identity package when working on official IOTA networks such as
testnetordevnet.Rust APIs for
IdentityClientistantiation are also changed for the aforementioned issue. SpecificallyIdentityClient::newhas been deprecated in favor ofIdentityClient::from_iota_client.Moreover,
IdentityClientReadOnlynow has no reason to be used directly by users;IdentityClient<NoSigner>- i.e the type returned byIdentityClient::from_iota_client- has the same purpose.IdentityClient<NoSigner>can be turned into a client with write capabilities through the use ofIdentityClient::set_signer.Links to any relevant issues
Closes #1759
Type of change