diff --git a/Extra.juvix b/Extra.juvix index 043815e..34373fc 100644 --- a/Extra.juvix +++ b/Extra.juvix @@ -2,4 +2,3 @@ module Extra; import Extra.Anoma open public; import Extra.Encoded open public; -import Extra.Random open public; diff --git a/Extra/Anoma.juvix b/Extra/Anoma.juvix index aaf8ead..9e5c281 100644 --- a/Extra/Anoma.juvix +++ b/Extra/Anoma.juvix @@ -1,7 +1,6 @@ --- This module contains functions that should be moved to Anoma.System.Builtins module Extra.Anoma; -import Extra.Random open; import Stdlib.Prelude open; import Anoma.Builtin.System open; import Anoma.Builtin.ByteArray open; @@ -13,14 +12,3 @@ axiom isNullifier : Nat -> Bool; builtin anoma-is-commitment axiom isCommitment : Nat -> Bool; - -randomNonce (prng : PRNG) : Pair Nonce PRNG := - first - (Nonce.from32SizedByteArray) - (pseudoRandomNumberGeneratorNextBytes 32 prng); - -randomNonce' {R : Type -> Type} {{Random R}} : R Nonce := - do { - bytes <- Random.genRandomBytes 32; - pure (Nonce.from32SizedByteArray bytes); - }; diff --git a/Extra/Random.juvix b/Extra/Random.juvix deleted file mode 100644 index 5f76689..0000000 --- a/Extra/Random.juvix +++ /dev/null @@ -1,24 +0,0 @@ -module Extra.Random; - -import Stdlib.Prelude open; -import Anoma.Builtin.System as Builtin; -import Anoma open; -import Mtl open; - -mkPrng (seed : Nat) : PRNG := Builtin.pseudoRandomNumberGeneratorInit seed; - -trait -type Random (M : Type -> Type) := - mkRandom@{ - {{monad}} : Monad M; - genRandomBytes : Nat -> M ByteArray; - }; - -instance -StateT-Random {M : Type -> Type} {{Monad M}} : Random (StateT PRNG M) := - mkRandom@{ - genRandomBytes (n : Nat) : StateT PRNG M ByteArray := - mkStateT - \{prng := - Applicative.pure (pseudoRandomNumberGeneratorNextBytes n prng)}; - }; diff --git a/HelloWorld/Interface/Transaction.juvix b/HelloWorld/Interface/Transaction.juvix index 877d00a..8f09cee 100644 --- a/HelloWorld/Interface/Transaction.juvix +++ b/HelloWorld/Interface/Transaction.juvix @@ -3,7 +3,6 @@ module HelloWorld.Interface.Transaction; import Anoma open; import Applib open; import Stdlib.Prelude open; -import Extra.Random open; import Anoma.State.CommitmentTree open; import BaseLayer.ResourceMachine open;