Skip to content

Commit 2ba7175

Browse files
authored
Merge branch 'master' into misha/return-ex-units
2 parents a301955 + 99d52dd commit 2ba7175

File tree

3 files changed

+53
-40
lines changed

3 files changed

+53
-40
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
.PHONY: hoogle pab_servers_all pab_servers_all pab_db clean_db \
66
nix_build_lib nix_build_examples build test accept_pirs watch ghci readme_contents \
7-
format lint requires_nix_shell
7+
format lint requires_nix_shell
88

99
usage:
1010
@echo "usage: make <command> [OPTIONS]"
@@ -99,7 +99,7 @@ nixpkgsfmt: requires_nix_shell
9999
nixpkgs-fmt $(NIX_SOURCES)
100100

101101
nixpkgsfmt_check: requires_nix_shell
102-
nixpkgsfmt --check $(NIX_SOURCES)
102+
nixpkgs-fmt --check $(NIX_SOURCES)
103103

104104
# Check with hlint, currently I couldn't get --refactor to work
105105
lint: requires_nix_shell

flake.nix

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -126,25 +126,26 @@
126126
allow-newer: size-based:template-haskell
127127
'';
128128

129-
haskellModules = [(
130-
{ pkgs, ... }:
131-
{
132-
packages = {
133-
marlowe.flags.defer-plugin-errors = true;
134-
plutus-use-cases.flags.defer-plugin-errors = true;
135-
plutus-ledger.flags.defer-plugin-errors = true;
136-
plutus-contract.flags.defer-plugin-errors = true;
137-
cardano-crypto-praos.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ];
138-
cardano-crypto-class.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ];
139-
cardano-wallet-core.components.library.build-tools = [
140-
pkgs.buildPackages.buildPackages.gitMinimal
141-
];
142-
cardano-config.components.library.build-tools = [
143-
pkgs.buildPackages.buildPackages.gitMinimal
144-
];
145-
};
146-
}
147-
)];
129+
haskellModules = [
130+
({ pkgs, ... }:
131+
{
132+
packages = {
133+
marlowe.flags.defer-plugin-errors = true;
134+
plutus-use-cases.flags.defer-plugin-errors = true;
135+
plutus-ledger.flags.defer-plugin-errors = true;
136+
plutus-contract.flags.defer-plugin-errors = true;
137+
cardano-crypto-praos.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ];
138+
cardano-crypto-class.components.library.pkgconfig = pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ];
139+
cardano-wallet-core.components.library.build-tools = [
140+
pkgs.buildPackages.buildPackages.gitMinimal
141+
];
142+
cardano-config.components.library.build-tools = [
143+
pkgs.buildPackages.buildPackages.gitMinimal
144+
];
145+
};
146+
}
147+
)
148+
];
148149

149150
extraSources = [
150151
{
@@ -316,7 +317,8 @@
316317
let
317318
pkgs = nixpkgsFor system;
318319
pkgs' = nixpkgsFor' system;
319-
in pkgs.haskell-nix.cabalProject' {
320+
in
321+
pkgs.haskell-nix.cabalProject' {
320322
src = ./.;
321323
inherit cabalProjectLocal extraSources;
322324
name = "bot-plutus-interface";
@@ -326,7 +328,7 @@
326328
ps.plutus-pab
327329
];
328330
withHoogle = true;
329-
tools.haskell-language-server = {};
331+
tools.haskell-language-server = { };
330332
exactDeps = true;
331333
nativeBuildInputs = with pkgs'; [
332334
cabal-install
@@ -337,12 +339,29 @@
337339
jq
338340
websocat
339341
fd
342+
nixpkgs-fmt
340343
];
341344
};
342345
modules = haskellModules;
343346
};
344347

345-
in {
348+
formatCheckFor = system:
349+
let
350+
pkgs = nixpkgsFor system;
351+
in
352+
pkgs.runCommand "format-check"
353+
{ nativeBuildInputs = [ self.devShell.${system}.nativeBuildInputs ]; } ''
354+
cd ${self}
355+
export LC_CTYPE=C.UTF-8
356+
export LC_ALL=C.UTF-8
357+
export LANG=C.UTF-8
358+
export IN_NIX_SHELL='pure'
359+
make format_check cabalfmt_check nixpkgsfmt_check lint
360+
mkdir $out
361+
'';
362+
363+
in
364+
{
346365
inherit cabalProjectLocal extraSources haskellModules;
347366

348367
project = perSystem projectFor;
@@ -360,23 +379,17 @@
360379

361380
# This will build all of the project's executables and the tests
362381
check = perSystem (system:
363-
(nixpkgsFor system).runCommand "combined-check" {
364-
nativeBuildInputs = builtins.attrValues self.checks.${system}
365-
++ builtins.attrValues self.flake.${system}.packages
366-
++ [ self.devShell.${system}.inputDerivation self.devShell.${system}.nativeBuildInputs ];
367-
} ''
368-
cd ${self}
369-
export LC_CTYPE=C.UTF-8
370-
export LC_ALL=C.UTF-8
371-
export LANG=C.UTF-8
372-
export IN_NIX_SHELL='pure'
373-
make format_check cabalfmt_check nixpkgsfmt_check lint
374-
mkdir $out
375-
'');
376-
382+
(nixpkgsFor system).runCommand "combined-check"
383+
{
384+
nativeBuildInputs = builtins.attrValues self.checks.${system}
385+
++ builtins.attrValues self.flake.${system}.packages
386+
++ [ self.devShell.${system}.inputDerivation ];
387+
} "touch $out");
377388
# NOTE `nix flake check` will not work at the moment due to use of
378389
# IFD in haskell.nix
379-
checks = perSystem (system: self.flake.${system}.checks);
390+
checks = perSystem (system: self.flake.${system}.checks // {
391+
formatCheck = formatCheckFor system;
392+
});
380393

381394
herculesCI.ciSystems = [ "x86_64-linux" ];
382395
};

src/BotPlutusInterface/Server.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ handleContractActivityChange ::
199199
ContractState w ->
200200
[CombinedWSStreamToClient]
201201
handleContractActivityChange contractInstanceID prevState currentState =
202-
catMaybes [activityChange, observableStateChange]
202+
catMaybes [observableStateChange, activityChange]
203203
where
204204
activityChange =
205205
if (csActivity <$> prevState) /= Just currentState.csActivity

0 commit comments

Comments
 (0)