Skip to content

Commit

Permalink
done testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Eric Cook committed Mar 23, 2022
1 parent e6dc5aa commit 7030343
Show file tree
Hide file tree
Showing 14 changed files with 1,691 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.0.4 (03.23.2022)

- Added tests
- Added high level methods of interacting with system / core / gateway apis via core.ex, gateway.ex and core.ex
- Added mnemonic support

## 0.0.3 (02.21.2022)

- Added new endpoints from [Gateway API V1.1.1](https://github.com/radixdlt/radixdlt-network-gateway/releases/tag/1.1.1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The package can be installed by adding `radixir` to your list of dependencies in
```elixir
def deps do
[
{:radixir, "~> 0.0.3"}
{:radixir, "~> 0.0.4"}
]
end
```
Expand Down Expand Up @@ -37,7 +37,7 @@ config :radixir, Radixir.Config,
```

The following will need to be set in `config.exs` or `runtime.exs`;
The following will need to be set in `config.exs` or `runtime.exs`:

```
config :block_keys, :ec_module, :libsecp256k1
Expand Down
8 changes: 6 additions & 2 deletions lib/radixir/core.ex
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ defmodule Radixir.Core do
def build_operation_data_validator_metadata(action, name, url) do
[]
|> Request.BuildTransaction.Operation.data(action: action)
|> Request.BuildTransaction.Operation.DataObject.ValidatorMetadata.type()
|> Request.BuildTransaction.Operation.DataObject.ValidatorMetadata.name(name: name)
|> Request.BuildTransaction.Operation.DataObject.ValidatorMetadata.url(url: url)
|> Util.stitch()
Expand All @@ -911,6 +912,7 @@ defmodule Radixir.Core do
def build_operation_data_validator_bft_data(action, proposals_completed, proposals_missed) do
[]
|> Request.BuildTransaction.Operation.data(action: action)
|> Request.BuildTransaction.Operation.DataObject.ValidatorBFTdata.type()
|> Request.BuildTransaction.Operation.DataObject.ValidatorBFTdata.proposals_completed(
proposals_completed: proposals_completed
)
Expand All @@ -932,6 +934,7 @@ defmodule Radixir.Core do
def build_operation_data_validator_allow_delegation(action, allow_delegation) do
[]
|> Request.BuildTransaction.Operation.data(action: action)
|> Request.BuildTransaction.Operation.DataObject.ValidatorAllowDelegation.type()
|> Request.BuildTransaction.Operation.DataObject.ValidatorAllowDelegation.allow_delegation(
allow_delegation: allow_delegation
)
Expand All @@ -951,9 +954,9 @@ defmodule Radixir.Core do
- `validator_address` (optional, string): Validator address.
- `epoch_unlock` (optional, integer): Epoch unlock.
"""
@spec build_operation_data_prepared_validator_data(action, address, registered, fee, options) ::
@spec build_operation_data_validator_data(action, address, registered, fee, options) ::
map
def build_operation_data_prepared_validator_data(
def build_operation_data_validator_data(
action,
address,
registered,
Expand Down Expand Up @@ -989,6 +992,7 @@ defmodule Radixir.Core do
def build_operation_data_validator_system_metadata(action, data) do
[]
|> Request.BuildTransaction.Operation.data(action: action)
|> Request.BuildTransaction.Operation.DataObject.ValidatorSystemMetadata.type()
|> Request.BuildTransaction.Operation.DataObject.ValidatorSystemMetadata.data(data: data)
|> Util.stitch()
end
Expand Down
2 changes: 1 addition & 1 deletion lib/radixir/core/request/build_transaction/operation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule Radixir.Core.Request.BuildTransaction.Operation do
"""
@spec sub_entity(stitch_plans, params) :: stitch_plans
def sub_entity(stitch_plans, params) do
StitchPlan.sub_entity(stitch_plans, params, [:entity_identifer])
StitchPlan.sub_entity(stitch_plans, params, [:entity_identifier])
end

@doc """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ defmodule Radixir.Core.Request.BuildTransaction.Operation.DataObject.TokenMetaDa
"""
@spec url(stitch_plans, params) :: stitch_plans
def url(stitch_plans, params) do
StitchPlan.type(stitch_plans, params, [:data, :data_object])
StitchPlan.url(stitch_plans, params, [:data, :data_object])
end

@doc """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Radixir.Core.Request.BuildTransaction.Operation.DataObject.ValidatorBF
"""
@spec type(stitch_plans) :: stitch_plans
def type(stitch_plans) do
StitchPlan.type(stitch_plans, [type: "ValidatorBFTdata"], [:data, :data_object])
StitchPlan.type(stitch_plans, [type: "ValidatorBFTData"], [:data, :data_object])
end

@doc """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defmodule Radixir.Core.Request.BuildTransaction.Operation.DataObject.ValidatorSy
NimbleOptions.validate!(params, schema)
|> Keyword.get(:data)

stitch_plan = [[keys: [:data, :data_object, :date], value: data]]
stitch_plan = [[keys: [:data, :data_object, :data], value: data]]

stitch_plan ++ stitch_plans
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Radixir.MixProject do
use Mix.Project

@source_url "https://github.com/radixir/radixir"
@version "0.0.3"
@version "0.0.4"

def project() do
[
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
%{
"block_keys": {:hex, :block_keys, "0.1.10", "1d76bed50d7fd93a1b9e42b3a1ed0b7bf4224c0bba4e4fd48e720b3ba8b1faa9", [:mix], [{:keccakf1600, "~> 2.0", [hex: :keccakf1600_otp23, repo: "hexpm", optional: false]}, {:libsecp256k1, "~> 0.1.9", [hex: :libsecp256k1, repo: "hexpm", optional: false]}], "hexpm", "db7392e0d71de8791a5df5e8bab5b94150fc9af9f0b66dfd4691d5e5cc555a22"},
"castore": {:hex, :castore, "0.1.15", "dbb300827d5a3ec48f396ca0b77ad47058578927e9ebe792abd99fcbc3324326", [:mix], [], "hexpm", "c69379b907673c7e6eb229f09a0a09b60bb27cfb9625bcb82ea4c04ba82a8442"},
"castore": {:hex, :castore, "0.1.16", "2675f717adc700475345c5512c381ef9273eb5df26bdd3f8c13e2636cf4cc175", [:mix], [], "hexpm", "28ed2c43d83b5c25d35c51bc0abf229ac51359c170cba76171a462ced2e4b651"},
"curvy": {:hex, :curvy, "0.3.0", "cd097f77434baf783cd18a8374e1eae37dc203588902a3b59d1b4056ac9e7366", [:mix], [], "hexpm", "1fa6104cb458cfe6962b8353a0a6563bd191f9e72807fca0fa22b5a61809695c"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"earmark_parser": {:hex, :earmark_parser, "1.4.20", "89970db71b11b6b89759ce16807e857df154f8df3e807b2920a8c39834a9e5cf", [:mix], [], "hexpm", "1eb0d2dabeeeff200e0d17dc3048a6045aab271f73ebb82e416464832eb57bdd"},
"ex_doc": {:hex, :ex_doc, "0.28.2", "e031c7d1a9fc40959da7bf89e2dc269ddc5de631f9bd0e326cbddf7d8085a9da", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "51ee866993ffbd0e41c084a7677c570d0fc50cb85c6b5e76f8d936d9587fa719"},
"earmark_parser": {:hex, :earmark_parser, "1.4.24", "344f8d2a558691d3fcdef3f9400157d7c4b3b8e58ee5063297e9ae593e8326d9", [:mix], [], "hexpm", "1f6451b0116dd270449c8f5b30289940ee9c0a39154c783283a08e55af82ea34"},
"ex_doc": {:hex, :ex_doc, "0.28.3", "6eea2f69995f5fba94cd6dd398df369fe4e777a47cd887714a0976930615c9e6", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "05387a6a2655b5f9820f3f627450ed20b4325c25977b2ee69bed90af6688e718"},
"finch": {:hex, :finch, "0.8.3", "54455e5141ef23962abc1252fadde019a125e472d741962d595bdf5083241ec9", [:mix], [{:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.3.5", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9d12a283dbaa60fd789aba5be5b918a107e725f2e9516cddc460fbbb6802e0d7"},
"hpax": {:hex, :hpax, "0.1.1", "2396c313683ada39e98c20a75a82911592b47e5c24391363343bde74f82396ca", [:mix], [], "hexpm", "0ae7d5a0b04a8a60caf7a39fcf3ec476f35cc2cc16c05abea730d3ce6ac6c826"},
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"keccakf1600": {:hex, :keccakf1600_otp23, "2.0.0", "77f7a1002b9f2972d991cfddb771fb71f600b6f0c125e82f01dff619a9292cb3", [:rebar3], [], "hexpm", "627691e1049eeccec3a12f3fa5d9df33f06dd5a7b81b5f7ebcb152c96d5c87c9"},
"libsecp256k1": {:hex, :libsecp256k1, "0.1.10", "d27495e2b9851c7765129b76c53b60f5e275bd6ff68292c50536bf6b8d091a4d", [:make, :mix], [{:mix_erlang_tasks, "0.1.0", [hex: :mix_erlang_tasks, repo: "hexpm", optional: false]}], "hexpm", "09ea06239938571124f7f5a27bc9ac45dfb1cfc2df40d46ee9b59c3d51366652"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"},
"mint": {:hex, :mint, "1.4.1", "49b3b6ea35a9a38836d2ad745251b01ca9ec062f7cb66f546bf22e6699137126", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "cd261766e61011a9079cccf8fa9d826e7a397c24fbedf0e11b49312bea629b58"},
Expand Down

0 comments on commit 7030343

Please sign in to comment.