-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* DIdPlc stuff (#21) * remove .so file, upgrade rustler * begin DidPlc * started DidPlc classes (don't look please) * closer to working did generation * doctest for cbor encoding * okay fine * use to_bytes * decode16 * add round trip cbor test * fix map key syntax * trying libipld for encoding dag-cbor * missing cid tag maybe? * what if we construct a tagged IPLD node with the CID tag and insert it into the result map * manually tag it? idk * fortune favors the bold * mission failed, we'll get 'em next time * update README to reflect new goals :) (#23) * fix example case in dagcbor docs (#24) --------- Co-authored-by: flicknow <[email protected]> Co-authored-by: nova <[email protected]> Co-authored-by: Samuel Newman <[email protected]> Co-authored-by: mark <[email protected]>
- Loading branch information
1 parent
0f5d8f3
commit 3ed03ca
Showing
7 changed files
with
91 additions
and
15 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,5 +1,5 @@ | ||
# hexpds | ||
A minimum viable atproto PDS in Elixir | ||
An ATProto PDS in Elixir/Rust | ||
|
||
## Installation | ||
|
||
|
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
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 |
---|---|---|
@@ -1,4 +1,22 @@ | ||
defmodule HexpdsDagcborTest do | ||
use ExUnit.Case | ||
doctest Hexpds.DagCBOR | ||
|
||
defp test_cases do | ||
[ | ||
"test text", | ||
["test text"], | ||
%{"string" => "test text"}, | ||
%{"map" => %{"string" => "test text"}}, | ||
%{"list" => ["text"]}, | ||
] | ||
end | ||
|
||
test "cbor roundtrip" do | ||
for input <- test_cases() do | ||
{:ok, cbor_encoded} = Hexpds.DagCBOR.encode_json(Jason.encode!(input)) | ||
{:ok, json_encoded} = Hexpds.DagCBOR.decode_json(cbor_encoded) | ||
assert input == Jason.decode!(json_encoded) | ||
end | ||
end | ||
end |