Skip to content

Commit 26ff608

Browse files
committed
Merge remote-tracking branch 'origin/master' into jordan/10.6-node-release
2 parents a6be460 + 2543d89 commit 26ff608

File tree

49 files changed

+1251
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1251
-323
lines changed

.github/workflows/github-page.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Haddock documentation"
1+
name: "Update github pages"
22

33
on:
44
push:
@@ -34,27 +34,34 @@ jobs:
3434
run: |
3535
cabal build all
3636
37-
- name: Build documentation
37+
- name: Build haddock documentation
3838
run: |
39-
cabal haddock-project --output=./haddocks --internal --foreign-libraries
39+
mkdir website
40+
cabal haddock-project --output=./website --internal --foreign-libraries
4041
41-
- name: Compress haddocks
42+
- name: Build typedoc documentation
4243
run: |
43-
tar -czf haddocks.tgz -C haddocks .
44+
nix build .#wasm-typedoc
45+
mkdir -p website/cardano-wasm/typedoc
46+
cp -r result/. website/cardano-wasm/typedoc/
4447
45-
- name: Upload haddocks artifact
48+
- name: Compress website
49+
run: |
50+
tar -czf website.tgz -C website .
51+
52+
- name: Upload website artifact
4653
uses: actions/upload-artifact@v4
4754
if: ${{ always() }}
4855
continue-on-error: true
4956
with:
50-
name: haddocks
51-
path: ./haddocks.tgz
57+
name: website
58+
path: ./website.tgz
5259

5360
- name: Deploy documentation to gh-pages 🚀
5461
if: github.ref == 'refs/heads/master'
5562
uses: peaceiris/actions-gh-pages@v4
5663
with:
5764
github_token: ${{ secrets.GITHUB_TOKEN || github.token }}
58-
publish_dir: haddocks
65+
publish_dir: website
5966
cname: cardano-api.cardano.intersectmbo.org
6067
force_orphan: true

.github/workflows/haskell-wasm.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ jobs:
144144
145145
- name: Prepare example
146146
run: |
147-
cp $(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1) cardano-wasm/examples/basic/
148-
$(wasm32-wasi-ghc --print-libdir)/post-link.mjs -i "$(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1)" -o cardano-wasm/examples/basic/cardano-wasm.js
147+
cp $(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1) cardano-wasm/lib-wrapper/
148+
$(wasm32-wasi-ghc --print-libdir)/post-link.mjs -i "$(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1)" -o cardano-wasm/lib-wrapper/cardano-wasm.js
149149
cp cardano-wasm/lib-wrapper/* cardano-wasm/examples/basic/
150150
151151
- uses: rrbutani/use-nix-shell-action@v1
@@ -181,6 +181,18 @@ jobs:
181181
# with:
182182
# limit-access-to-actor: true
183183

184+
- name: Build grpc bridge
185+
run: |
186+
nix build .#proto-js-bundle
187+
cp result/cardano_node_grpc_web_pb.js cardano-wasm/lib-wrapper/
188+
189+
- name: Upload built wasm library
190+
uses: actions/upload-artifact@v4
191+
with:
192+
name: cardano-wasm
193+
path: cardano-wasm/lib-wrapper/*
194+
compression-level: 9
195+
184196
wasm-builds-complete:
185197
needs: [build]
186198
if: ${{ always() }}

.github/workflows/hls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
HLS_CACHE_VERSION: "2025-09-23"
1818

1919
runs-on: ubuntu-latest
20-
timeout-minutes: 60
20+
timeout-minutes: 90
2121
steps:
2222
- uses: actions/checkout@v4
2323

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ cardano-wasm/examples/*/cardano-wasm.wasm
7979
cardano-wasm/examples/*/cardano-wasm.js
8080
cardano-wasm/examples/*/*.d.ts
8181
cardano-wasm/examples/*/cardano-api.js
82+
cardano-wasm/examples/*/main.js
8283
cardano-wasm/examples/*/cardano_node_grpc_web_pb.js
8384
.ghc-wasm/
8485

.hlint.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
# - ignore: {name: Use let}
5858
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
5959

60+
# Allow snake_case naming in test modules (following Haskell test property convention)
61+
- ignore: {name: Use camelCase, within: [Test.Cardano.Api.**, Test.Golden.Cardano.Api.**]}
62+
63+
- ignore: {name: Eta reduce}
64+
- ignore: {name: Use + directly}
65+
- ignore: {name: Use fmap}
6066

6167
# Define some custom infix operators
6268
# - fixity: infixr 3 ~^#^~

cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extra-packages: Cabal, process
2828
if impl(ghc < 9.8)
2929
constraints: interpolatedstring-perl6:setup.time source
3030

31-
3231
-- It may slow down build plan preparation, but without it cabal has problems
3332
-- with solving constraints. Remove this when not needed anymore.
3433
max-backjumps: 50000

cardano-api/gen/Test/Hedgehog/Roundtrip/CBOR.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import GHC.Stack qualified as GHC
2323
import Hedgehog qualified as H
2424
import Hedgehog.Internal.Property (failWith)
2525

26-
{- HLINT ignore "Use camelCase" -}
27-
2826
-- | Assert that CBOR serialisation and deserialisation roundtrips.
2927
trippingCbor
3028
:: ()

cardano-api/src/Cardano/Api/Address.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
{-# LANGUAGE TypeApplications #-}
1010
{-# LANGUAGE TypeFamilies #-}
1111

12-
{- HLINT ignore "Avoid lambda using `infix`" -}
13-
1412
-- | Cardano addresses: payment and stake addresses.
1513
module Cardano.Api.Address
1614
( -- * Payment addresses
@@ -55,6 +53,7 @@ module Cardano.Api.Address
5553
, StakeExtendedKey
5654

5755
-- * Conversion functions
56+
, shelleyPayAddrToPaymentKeyHash
5857
, shelleyPayAddrToPlutusPubKHash
5958

6059
-- * Internal conversion functions
@@ -115,6 +114,7 @@ import Data.Bifunctor (first)
115114
import Data.ByteString.Base58 qualified as Base58
116115
import Data.Char (isAsciiLower, isAsciiUpper, isDigit)
117116
import Data.Either.Combinators (rightToMaybe)
117+
import Data.Maybe (isJust)
118118
import Data.Text (Text)
119119
import Data.Text qualified as Text
120120
import Data.Text.Encoding qualified as Text
@@ -614,10 +614,13 @@ makeStakeAddress nw sc =
614614
-- | Is the UTxO at the address only spendable via a key witness.
615615
isKeyAddress :: AddressInEra era -> Bool
616616
isKeyAddress (AddressInEra ByronAddressInAnyEra _) = True
617-
isKeyAddress (AddressInEra (ShelleyAddressInEra _) (ShelleyAddress _ pCred _)) =
617+
isKeyAddress (AddressInEra (ShelleyAddressInEra _) addr) = isJust $ shelleyPayAddrToPaymentKeyHash addr
618+
619+
shelleyPayAddrToPaymentKeyHash :: Address ShelleyAddr -> Maybe (Hash PaymentKey)
620+
shelleyPayAddrToPaymentKeyHash (ShelleyAddress _ pCred _) =
618621
case fromShelleyPaymentCredential pCred of
619-
PaymentCredentialByKey _ -> True
620-
PaymentCredentialByScript _ -> False
622+
PaymentCredentialByKey key -> Just key
623+
PaymentCredentialByScript _ -> Nothing
621624

622625
-- | Converts a Shelley payment address to a Plutus public key hash.
623626
shelleyPayAddrToPlutusPubKHash :: Address ShelleyAddr -> Maybe PlutusAPI.PubKeyHash

cardano-api/src/Cardano/Api/Block.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ import Data.ByteString.Short qualified as SBS
8181
import Data.Foldable (Foldable (toList))
8282
import Data.Text (Text)
8383

84-
{- HLINT ignore "Use lambda" -}
85-
{- HLINT ignore "Use lambda-case" -}
86-
8784
-- ----------------------------------------------------------------------------
8885
-- Blocks in an era
8986
--

cardano-api/src/Cardano/Api/Byron/Internal/Proposal.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ import Ouroboros.Consensus.Byron.Ledger.Mempool qualified as Mempool
5757

5858
import Data.ByteString (ByteString)
5959
import Data.ByteString.Lazy qualified as LB
60+
import Data.Functor (void)
6061
import Data.Map.Strict qualified as M
6162
import Data.Word
6263
import Numeric.Natural
6364

64-
{- HLINT ignore "Use void" -}
65-
6665
-- | Byron era update proposal
6766
newtype ByronUpdateProposal
6867
= ByronUpdateProposal {unByronUpdateProposal :: AProposal ByteString}
@@ -193,7 +192,7 @@ instance HasTypeProxy ByronVote where
193192
proxyToAsType _ = AsByronVote
194193

195194
instance SerialiseAsRawBytes ByronVote where
196-
serialiseToRawBytes (ByronVote vote) = Binary.serialize' $ fmap (const ()) vote
195+
serialiseToRawBytes (ByronVote vote) = Binary.serialize' $ void vote
197196
deserialiseFromRawBytes AsByronVote bs =
198197
let lBs = LB.fromStrict bs
199198
in case Binary.decodeFull lBs of

0 commit comments

Comments
 (0)