Skip to content
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

Add str conversions for types for JSON #313

Merged
merged 22 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ doctest = false
crate-git-revision = "0.0.6"

[dependencies]
stellar-strkey = { version = "0.0.7", optional = true }
base64 = { version = "0.13.0", optional = true }
serde = { version = "1.0.139", features = ["derive"], optional = true }
serde_with = { version = "3.0.0", optional = true }
Expand All @@ -33,15 +34,15 @@ serde_json = "1.0.89"

[features]
default = ["std", "curr"]
std = ["alloc"]
std = ["alloc", "dep:stellar-strkey"]
alloc = ["dep:hex"]
curr = []
next = []

# Features dependent on optional dependencies.
base64 = ["std", "dep:base64"]
serde = ["alloc", "dep:serde", "dep:serde_with", "hex/serde"]
serde_json = ["serde", "dep:serde_json"]
serde_json = ["std", "serde", "dep:serde_json"]
arbitrary = ["std", "dep:arbitrary"]
hex = []

Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ export RUSTFLAGS=-Dwarnings -Dclippy::all -Dclippy::pedantic

CARGO_HACK_ARGS=--feature-powerset --exclude-features default --group-features base64,serde,arbitrary,hex

XDRGEN_VERSION=b405294c
CARGO_DOC_ARGS?=--open

XDRGEN_VERSION=64612a24
XDRGEN_TYPES_CUSTOM_STR_IMPL=PublicKey,AccountId,MuxedAccount,MuxedAccountMed25519,SignerKey,SignerKeyEd25519SignedPayload,NodeId

all: build test

test:
Expand Down Expand Up @@ -35,12 +37,12 @@ ifeq ($(LOCAL_XDRGEN),)
docker run -i --rm -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\
gem install specific_install -v 0.3.8 && \
gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_VERSION) && \
xdrgen --language rust --namespace generated --output src/curr $^ \
xdrgen --language rust --namespace generated --output src/curr --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL) $^ \
'
else
docker run -i --rm -v $$PWD/../xdrgen:/xdrgen -v $$PWD:/wd -w /wd docker.io/library/ruby:latest /bin/bash -c '\
pushd /xdrgen && bundle install --deployment && rake install && popd && \
xdrgen --language rust --namespace generated --output src/curr $^ \
xdrgen --language rust --namespace generated --output src/curr --rust-types-custom-str-impl $(XDRGEN_TYPES_CUSTOM_STR_IMPL) $^ \
'
endif
rustfmt $@
Expand Down
Loading