-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Labels
enhancementiroha2package: clientRelated to Client package(-s)Related to Client package(-s)package: cryptoRelated to Crypto packagesRelated to Crypto packages
Description
Description
Currently, @iroha2/client provides a mechanism to inject the crypto instance into the library, so that all crypto-related functions will work after that:
import { setCrypto } from '@iroha2/client'
import { crypto } from '@iroha2/crypto-target-node'
setCrypto(crypto)The proposal is to move this singleton to the @iroha2/crypto-core package, because it seems to make more sense:
import { setCryptoWasm } from '@iroha2/crypto-core'
import { cryptoWasm } from '@iroha2/crypto-target-node'
setCryptoWasm(cryptoWasm)After that, it will be probably possible to move all "interface wrap" into the single core package, and each crypto-target-* package will be a simple WASM exporter
Benefits
- More intuitive API: the crypto part is moved to the crypto package
- Simpler code base - no complicated wrap bundling for each target
Drawbacks
There might be some unexpected limitations, needs research.
Metadata
Metadata
Assignees
Labels
enhancementiroha2package: clientRelated to Client package(-s)Related to Client package(-s)package: cryptoRelated to Crypto packagesRelated to Crypto packages