-
Notifications
You must be signed in to change notification settings - Fork 92
Prepare for wasm #5229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Prepare for wasm #5229
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
|
|
||
| ### Non-Breaking | ||
|
|
||
| - Patched so that it compiles to wasm | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Non-Breaking | ||
|
|
||
| - Patched so that it compiles to wasm | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -313,6 +313,8 @@ socketAsChannel socket = | |||||
| --- | ||||||
| --- This is primarily for testing purposes since it does not allow actual IPC. | ||||||
| --- | ||||||
| -- __Exceptions:__ | ||||||
| -- May throw 'IOError' when compiling to @wasm@. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The original suggests that Template Haskell is used. |
||||||
| createSocketConnectedChannels :: Socket.Family -- ^ Usually AF_UNIX or AF_INET | ||||||
| -> IO (ByteChannel IO, | ||||||
| ByteChannel IO) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Non-Breaking | ||
|
|
||
| - Patched so that it compiles to wasm | ||
|
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -647,7 +647,8 @@ optionParser = | |||||
| <> showDefault | ||||||
| ) | ||||||
|
|
||||||
|
|
||||||
| -- | __Exceptions:__ | ||||||
| -- May throw 'IOError' when compiling to @wasm@. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| run :: (Addr, Port) | ||||||
| -> (Addr, Port) | ||||||
| -> DiffTime -- ^ protocol idle timeout | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -346,6 +346,8 @@ type SocketSnocket = Snocket IO Socket SockAddr | |||||
| -- | Create a 'Snocket' for the given 'Socket.Family'. In the 'bind' method set | ||||||
| -- 'Socket.ReuseAddr` and 'Socket.ReusePort'. | ||||||
| -- | ||||||
| -- __Exceptions:__ | ||||||
| -- May throw 'IOError' when compiling to @wasm@. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| socketSnocket | ||||||
| :: IOManager | ||||||
| -- ^ 'IOManager' interface. We use it when we create a new socket and when we | ||||||
|
|
@@ -452,6 +454,8 @@ type LocalSnocket = Snocket IO LocalSocket LocalAddress | |||||
| -- around this, the address passed to 'open' via 'LocalFamily' will be | ||||||
| -- referenced by 'LocalSocket'. | ||||||
| -- | ||||||
| -- __Exceptions:__ | ||||||
| -- May throw 'IOError' when compiling to @wasm@. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| localSnocket :: IOManager -> LocalSnocket | ||||||
| #if defined(mingw32_HOST_OS) | ||||||
| localSnocket ioManager = Snocket { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,5 @@ | ||||||
| {-# LANGUAGE BangPatterns #-} | ||||||
| {-# LANGUAGE CPP #-} | ||||||
| {-# LANGUAGE DataKinds #-} | ||||||
| {-# LANGUAGE FlexibleContexts #-} | ||||||
| {-# LANGUAGE FlexibleInstances #-} | ||||||
|
|
@@ -129,7 +130,11 @@ testVersionCodecCBORTerm !_ = | |||||
| decodeTerm :: CBOR.Term -> Either Text TestVersionData | ||||||
| decodeTerm (CBOR.TList [CBOR.TInt x]) | ||||||
| | x >= 0 | ||||||
| #if !defined(wasm32_HOST_ARCH) | ||||||
| , x <= 0xffffffff | ||||||
| #else | ||||||
| , x <= 0x7fffffff | ||||||
| #endif | ||||||
| = Right | ||||||
| TestVersionData { | ||||||
| networkMagic = NetworkMagic (fromIntegral x) | ||||||
|
|
@@ -180,7 +185,8 @@ prop_socket_demo :: TestBlockChainAndUpdates -> Property | |||||
| prop_socket_demo (TestBlockChainAndUpdates chain updates) = | ||||||
| ioProperty $ demo chain updates | ||||||
|
|
||||||
|
|
||||||
| -- | __Exceptions:__ | ||||||
| -- May throw 'IOError' when compiling to @wasm@. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| demo :: forall block . | ||||||
| ( Chain.HasHeader block | ||||||
| , Serialise (Chain.HeaderHash block) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You accidentally removed an empty line which delimits two definitions.