generated from kommitters/.template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5487801
commit 3cc3cbd
Showing
9 changed files
with
156 additions
and
228 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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
defmodule Kadena.Chainweb.Pact do | ||
@moduledoc """ | ||
Specifies the API for processing HTTP requests. | ||
Exposes functions to interact with the Pact API endpoints. | ||
""" | ||
|
||
alias Kadena.Chainweb.Pact.Local | ||
defdelegate local(request, network \\ :testnet04, chain_id \\ "0"), to: Local, as: :process | ||
alias Kadena.Chainweb.Pact.{Local, Send} | ||
|
||
# defdelegate send(request, network \\ :test, chain_id \\ "0"), to: Send, as: :process | ||
# defdelegate poll(request, network \\ :test, chain_id \\ "0"), to: Poll, as: :process | ||
# defdelegate listen(request, network \\ :test, chain_id \\ "0"), to: Listen, as: :process | ||
# defdelegate spv(request, network \\ :test, chain_id \\ "0"), to: SPV, as: :process | ||
@default_network_opts [network_id: :testnet04, chain_id: 0] | ||
|
||
defdelegate send(cmds, network_opts \\ @default_network_opts), to: Send, as: :process | ||
defdelegate local(cmds, network_opts \\ @default_network_opts), to: Local, as: :process | ||
end |
This file was deleted.
Oops, something went wrong.
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
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
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,29 @@ | ||
defmodule Kadena.Chainweb.Pact.Spec do | ||
@moduledoc """ | ||
Specifies the contracts to build the Pact's endpoints. | ||
""" | ||
|
||
alias Kadena.Chainweb.Pact.{ | ||
ListenResponse, | ||
LocalResponse, | ||
PollResponse, | ||
SendResponse, | ||
SPVResponse | ||
} | ||
|
||
alias Kadena.Chainweb.Error | ||
alias Kadena.Types.Command | ||
|
||
@type data :: list(Command.t()) | Command.t() | ||
@type error :: {:error, Error.t()} | ||
@type chain_id :: 0..19 | String.t() | ||
@type network_opts :: [network_id: atom(), chain_id: chain_id()] | ||
@type response :: | ||
ListenResponse.t() | ||
| LocalResponse.t() | ||
| PollResponse.t() | ||
| SendResponse.t() | ||
| SPVResponse.t() | ||
|
||
@callback process(data :: data(), network_opts :: network_opts()) :: {:ok, response()} | error() | ||
end |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.