zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit 450152f8d499397c38edfc91ab41c172327f4f91
parent 5f51520c3f00c52cdba047cfd403839216d19003
Author: Alberto Lerda <albertolerda97@gmail.com>
Date:   Thu,  5 Jan 2023 13:26:09 +0100

Person: renamed schnorr to bitcoin

Diffstat:
Mpriv/repo/migrations/20211111175352_fill_vf_agent.exs | 4++--
Msrc/zenflows/vf/agent.ex | 4++--
Msrc/zenflows/vf/person.ex | 8++++----
Msrc/zenflows/vf/person/type.ex | 10+++++-----
Mtest/help/factory.ex | 2+-
Mtest/vf/agent/type.test.exs | 4++--
Mtest/vf/person/domain.test.exs | 8++++----
Mtest/vf/person/type.test.exs | 8++++----
8 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/priv/repo/migrations/20211111175352_fill_vf_agent.exs b/priv/repo/migrations/20211111175352_fill_vf_agent.exs @@ -34,7 +34,7 @@ OR AND eddsa_public_key IS NULL AND ethereum_address IS NULL AND reflow_public_key IS NULL - AND schnorr_public_key IS NULL + AND bitcoin_public_key IS NULL ) """ @@ -55,7 +55,7 @@ def change() do add :eddsa_public_key, :text add :ethereum_address, :text add :reflow_public_key, :text - add :schnorr_public_key, :text + add :bitcoin_public_key, :text # organization add :classified_as, {:array, :text} diff --git a/src/zenflows/vf/agent.ex b/src/zenflows/vf/agent.ex @@ -40,7 +40,7 @@ alias Zenflows.VF.SpatialThing eddsa_public_key: String.t() | nil, ethereum_address: String.t() | nil, reflow_public_key: String.t() | nil, - schnorr_public_key: String.t() | nil, + bitcoin_public_key: String.t() | nil, # organization classified_as: [String.t()] | nil, @@ -62,7 +62,7 @@ schema "vf_agent" do field :eddsa_public_key, :string field :ethereum_address, :string field :reflow_public_key, :string - field :schnorr_public_key, :string + field :bitcoin_public_key, :string # organization field :classified_as, {:array, :string} diff --git a/src/zenflows/vf/person.ex b/src/zenflows/vf/person.ex @@ -37,7 +37,7 @@ alias Zenflows.VF.SpatialThing eddsa_public_key: String.t() | nil, ethereum_address: String.t() | nil, reflow_public_key: String.t() | nil, - schnorr_public_key: String.t() | nil, + bitcoin_public_key: String.t() | nil, } schema "vf_agent" do @@ -52,7 +52,7 @@ schema "vf_agent" do field :eddsa_public_key, :string field :ethereum_address, :string field :reflow_public_key, :string - field :schnorr_public_key, :string + field :bitcoin_public_key, :string timestamps() end @@ -63,7 +63,7 @@ end eddsa_public_key ethereum_address reflow_public_key - schnorr_public_key + bitcoin_public_key ]a # TODO: Maybe add email to @update_cast as well? # TODO: Maybe add the pubkeys to @update_cast as well? @@ -85,7 +85,7 @@ def changeset(params) do |> Validate.key(:eddsa_public_key) |> Validate.key(:ethereum_address) |> Validate.key(:reflow_public_key) - |> Validate.key(:schnorr_public_key) + |> Validate.key(:bitcoin_public_key) |> Validate.email(:email) |> Changeset.unique_constraint(:user) |> Changeset.unique_constraint(:name) diff --git a/src/zenflows/vf/person/type.ex b/src/zenflows/vf/person/type.ex @@ -40,7 +40,7 @@ who have no physical location. @eddsa_public_key "eddsa public key, encoded by zenroom" @ethereum_address "ethereum address, encoded by zenroom" @reflow_public_key "reflow public key, encoded by zenroom" -@schnorr_public_key "schnorr public key, encoded by zenroom" +@bitcoin_public_key "bitcoin public key, encoded by zenroom" @desc "A natural person." object :person do @@ -79,8 +79,8 @@ object :person do @desc @reflow_public_key field :reflow_public_key, :string - @desc @schnorr_public_key - field :schnorr_public_key, :string + @desc @bitcoin_public_key + field :bitcoin_public_key, :string end @desc "Person eddsa public key" @@ -120,8 +120,8 @@ input_object :person_create_params do @desc @reflow_public_key field :reflow_public_key, :string - @desc @schnorr_public_key - field :schnorr_public_key, :string + @desc @bitcoin_public_key + field :bitcoin_public_key, :string end input_object :person_update_params do diff --git a/test/help/factory.ex b/test/help/factory.ex @@ -273,7 +273,7 @@ def build(:person) do eddsa_public_key: Base.encode64("some eddsa_public_key"), ethereum_address: Base.encode64("some ethereum_address"), reflow_public_key: Base.encode64("some reflow_public_key"), - schnorr_public_key: Base.encode64("some schnorr_public_key"), + bitcoin_public_key: Base.encode64("some bitcoin_public_key"), } end diff --git a/test/vf/agent/type.test.exs b/test/vf/agent/type.test.exs @@ -98,7 +98,7 @@ describe "Query agent()" do eddsaPublicKey ethereumAddress reflowPublicKey - schnorrPublicKey + bitcoinPublicKey } } } @@ -115,7 +115,7 @@ describe "Query agent()" do assert data["eddsaPublicKey"] == per.eddsa_public_key assert data["ethereumAddress"] == per.ethereum_address assert data["reflowPublicKey"] == per.reflow_public_key - assert data["schnorrPublicKey"] == per.schnorr_public_key + assert data["bitcoinPublicKey"] == per.bitcoin_public_key end test "as Organization", %{org: org} do diff --git a/test/vf/person/domain.test.exs b/test/vf/person/domain.test.exs @@ -33,7 +33,7 @@ setup do eddsa_public_key: Base.encode64("eddsa_public_key"), ethereum_address: Base.encode64("ethereum_address"), reflow_public_key: Base.encode64("reflow_public_key"), - schnorr_public_key: Base.encode64("schnorr_public_key"), + bitcoin_public_key: Base.encode64("bitcoin_public_key"), }, inserted: Factory.insert!(:person), } @@ -67,7 +67,7 @@ describe "create/1" do assert new.eddsa_public_key == params.eddsa_public_key assert new.ethereum_address == params.ethereum_address assert new.reflow_public_key == params.reflow_public_key - assert new.schnorr_public_key == params.schnorr_public_key + assert new.bitcoin_public_key == params.bitcoin_public_key end test "with bad params: doesn't create a Person" do @@ -87,7 +87,7 @@ describe "update/2" do assert new.eddsa_public_key == old.eddsa_public_key assert new.ethereum_address == old.ethereum_address assert new.reflow_public_key == old.reflow_public_key - assert new.schnorr_public_key == old.schnorr_public_key + assert new.bitcoin_public_key == old.bitcoin_public_key end test "with bad params: doesn't update the Person", %{inserted: old} do @@ -101,7 +101,7 @@ describe "update/2" do assert new.eddsa_public_key == old.eddsa_public_key assert new.ethereum_address == old.ethereum_address assert new.reflow_public_key == old.reflow_public_key - assert new.schnorr_public_key == old.schnorr_public_key + assert new.bitcoin_public_key == old.bitcoin_public_key end end diff --git a/test/vf/person/type.test.exs b/test/vf/person/type.test.exs @@ -30,7 +30,7 @@ setup do "eddsaPublicKey" => Base.encode64("eddsa_public_key"), "ethereumAddress" => Base.encode64("ethereum_address"), "reflowPublicKey" => Base.encode64("reflow_public_key"), - "schnorrPublicKey" => Base.encode64("schnorr_public_key"), + "bitcoinPublicKey" => Base.encode64("bitcoin_public_key"), }, inserted: Factory.insert!(:person), } @@ -48,7 +48,7 @@ fragment person on Person { eddsaPublicKey ethereumAddress reflowPublicKey - schnorrPublicKey + bitcoinPublicKey } """ @@ -73,7 +73,7 @@ describe "Query" do assert data["eddsaPublicKey"] == new.eddsa_public_key assert data["ethereumAddress"] == new.ethereum_address assert data["reflowPublicKey"] == new.reflow_public_key - assert data["schnorrPublicKey"] == new.schnorr_public_key + assert data["bitcoinPublicKey"] == new.bitcoin_public_key end end @@ -139,7 +139,7 @@ describe "Mutation" do assert data["eddsaPublicKey"] == old.eddsa_public_key assert data["ethereumAddress"] == old.ethereum_address assert data["reflowPublicKey"] == old.reflow_public_key - assert data["schnorrPublicKey"] == old.schnorr_public_key + assert data["bitcoinPublicKey"] == old.bitcoin_public_key end test "deletePerson: doesn't delete the person without the admin key", %{inserted: new} do