File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
src/Cardano/Wasm/Internal/Api Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,14 @@ executable cardano-wasm
4242 Cardano.Wasm.Internal.Api.GRPC
4343 Cardano.Wasm.Internal.Api.Info
4444 Cardano.Wasm.Internal.Api.InfoToTypeScript
45+ Cardano.Wasm.Internal.Api.Random
4546 Cardano.Wasm.Internal.Api.Tx
4647 Cardano.Wasm.Internal.Api.TypeScriptDefs
4748 Cardano.Wasm.Internal.Api.Wallet
4849 Cardano.Wasm.Internal.ExceptionHandling
4950 Cardano.Wasm.Internal.JavaScript.Bridge
5051 Cardano.Wasm.Internal.JavaScript.GRPC
5152 Cardano.Wasm.Internal.JavaScript.GRPCTypes
52- Cardano.Wasm.Internal.JavaScript.Random
5353
5454 build-depends :
5555 aeson,
@@ -74,6 +74,9 @@ executable cardano-wasm
7474 base16-bytestring,
7575 ghc-experimental,
7676 utf8-string,
77+ else
78+ build-depends :
79+ crypton
7780
7881test-suite cardano-wasm-golden
7982 type : exitcode-stdio-1.0
Original file line number Diff line number Diff line change 11{-# LANGUAGE CApiFFI #-}
22{-# LANGUAGE CPP #-}
33
4- module Cardano.Wasm.Internal.JavaScript .Random (getRandomBytes ) where
4+ module Cardano.Wasm.Internal.Api .Random (getRandomBytes ) where
55
66#if !defined(wasm32_HOST_ARCH)
77
88import Data.ByteString (ByteString )
9+ import Crypto.Random.Entropy (getEntropy )
910
1011getRandomBytes :: Word -> IO ByteString
11- getRandomBytes _ = error " getRandomBytes is not implemented for non-WASM targets "
12+ getRandomBytes n = getEntropy ( fromIntegral n)
1213
1314#else
1415
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ import Cardano.Api
3838 )
3939
4040import Cardano.Crypto.Seed (mkSeedFromBytes )
41+ import Cardano.Wasm.Internal.Api.Random (getRandomBytes )
4142import Cardano.Wasm.Internal.ExceptionHandling (rightOrError , toMonadFail )
42- import Cardano.Wasm.Internal.JavaScript.Random (getRandomBytes )
4343
4444import Data.Aeson ((.=) )
4545import Data.Aeson qualified as Aeson
You can’t perform that action at this time.
0 commit comments