-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: patch
Arbitrary PoolMetadata
to always have 32 bytes for pmHash
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs b/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs | ||
index a0e9c8359..9943c7b66 100644 | ||
--- a/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs | ||
+++ b/testlib/Test/Cardano/Ledger/Core/Arbitrary.hs | ||
@@ -142,6 +142,7 @@ import Cardano.Ledger.UTxO (UTxO (..)) | ||
import Control.Monad (replicateM) | ||
import Control.Monad.Identity (Identity) | ||
import Control.Monad.Trans.Fail.String (errorFail) | ||
+import qualified Data.ByteString | ||
import Data.GenValidity | ||
import Data.Int (Int64) | ||
import Data.Map.Strict (Map) | ||
@@ -497,7 +498,7 @@ instance Crypto c => Arbitrary (PoolParams c) where | ||
<*> arbitrary | ||
|
||
instance Arbitrary PoolMetadata where | ||
- arbitrary = PoolMetadata <$> arbitrary <*> arbitrary | ||
+ arbitrary = PoolMetadata <$> arbitrary <*> (Data.ByteString.pack <$> vectorOf 32 arbitrary) | ||
|
||
instance Arbitrary StakePoolRelay where | ||
arbitrary = genericArbitraryU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/nix/haskell.nix b/nix/haskell.nix | ||
index ec137f412..cdeb9877b 100644 | ||
--- a/nix/haskell.nix | ||
+++ b/nix/haskell.nix | ||
@@ -110,6 +110,11 @@ let | ||
# | ||
modules = | ||
[ | ||
+ ({ lib, pkgs, ... }: { | ||
+ packages.cardano-ledger-core.patches = [ | ||
+ ./cardano-ledger-core--Arbitrary-PoolMetadata.diff | ||
+ ]; | ||
+ }) | ||
({ lib, pkgs, ... }: { | ||
packages.cardano-tracer.package.buildable = with pkgs.stdenv.hostPlatform; lib.mkForce (!isMusl); | ||
packages.cardano-node-chairman.components.tests.chairman-tests.buildable = lib.mkForce pkgs.stdenv.hostPlatform.isUnix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters