Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 15 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ console_error_panic_hook = { version = "0.1.7", optional = true }
# serde-wasm-bindgen = "0.6.5"

[dependencies.stellar-xdr]
version = "27.0.0"
version = "28.0.0"
features = ["std", "base64", "serde", "serde_json", "schemars", "type_enum"]
# git = "https://github.com/stellar/rs-stellar-xdr"
# rev = "89a8bcde36aeda551cb0e3f9aa3e9fcf315fe1cc"
Expand Down
6 changes: 4 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ allow = [
]
deny = [
]
skip = [
]
# stellar-xdr 28 build-depends on crate-git-revision 0.0.9 but pins stellar-strkey
# 0.0.13, which still build-depends on 0.0.6. Both are build-only deps, so nothing
# extra ships in the wasm. Remove when stellar-xdr loosens the stellar-strkey pin.
skip = [{ name = "crate-git-revision", version = "0.0.6" }]
skip-tree = [
]

Expand Down
18 changes: 10 additions & 8 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ fn list_of_types() {
"ScSpecEventV0",
"ScSpecEntryKind",
"ScSpecEntry",
"ScBytes",
"ScString",
"ScSymbol",
"ScValType",
"ScErrorType",
"ScErrorCode",
Expand All @@ -110,15 +113,13 @@ fn list_of_types() {
"UInt256Parts",
"Int256Parts",
"ContractExecutableType",
"ContractExecutable",
"ScAddressType",
"MuxedEd25519Account",
"ScAddress",
"ContractExecutableExternalRef",
"ContractExecutable",
"ScVec",
"ScMap",
"ScBytes",
"ScString",
"ScSymbol",
"ScNonceKey",
"ScContractInstance",
"ScVal",
Expand Down Expand Up @@ -219,6 +220,7 @@ fn list_of_types() {
"LedgerCloseValueSignature",
"StellarValue",
"StellarValueExt",
"StellarValueProposedValue",
"LedgerHeaderFlags",
"LedgerHeaderExtensionV1",
"LedgerHeaderExtensionV1Ext",
Expand Down Expand Up @@ -538,11 +540,11 @@ fn decode_iter_success() {
"ScSpecEntry".to_string(),
"AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAAAwAAAAAAAAAPdG9rZW5fd2FzbV9oYXNoAAAAA+4AAAAgAAAAAAAAAAd0b2tlbl9hAAAAABMAAAAAAAAAB3Rva2VuX2IAAAAAEwAAAAAAAAAAAAAAAAAAAAhzaGFyZV9pZAAAAAAAAAABAAAAEwAAAAAAAAAAAAAAB2RlcG9zaXQAAAAABQAAAAAAAAACdG8AAAAAABMAAAAAAAAACWRlc2lyZWRfYQAAAAAAAAsAAAAAAAAABW1pbl9hAAAAAAAACwAAAAAAAAAJZGVzaXJlZF9iAAAAAAAACwAAAAAAAAAFbWluX2IAAAAAAAALAAAAAAAAAAAAAAAAAAAABHN3YXAAAAAEAAAAAAAAAAJ0bwAAAAAAEwAAAAAAAAAFYnV5X2EAAAAAAAABAAAAAAAAAANvdXQAAAAACwAAAAAAAAAGaW5fbWF4AAAAAAALAAAAAAAAAAAAAAAAAAAACHdpdGhkcmF3AAAABAAAAAAAAAACdG8AAAAAABMAAAAAAAAADHNoYXJlX2Ftb3VudAAAAAsAAAAAAAAABW1pbl9hAAAAAAAACwAAAAAAAAAFbWluX2IAAAAAAAALAAAAAQAAA+0AAAACAAAACwAAAAsAAAAAAAAAAAAAAAlnZXRfcnNydnMAAAAAAAAAAAAAAQAAA+0AAAACAAAACwAAAAs=".to_string(),
),
Ok([r#"{"function_v0":{"doc":"","name":"initialize","inputs":[{"doc":"","name":"token_wasm_hash","type_":{"bytes_n":{"n":32}}},{"doc":"","name":"token_a","type_":"address"},{"doc":"","name":"token_b","type_":"address"}],"outputs":[]}}"#,
Ok([r#"{"function_v0":{"doc":"","name":"initialize","inputs":[{"doc":"","name":"token_wasm_hash","type":{"bytes_n":{"n":32}}},{"doc":"","name":"token_a","type":"address"},{"doc":"","name":"token_b","type":"address"}],"outputs":[]}}"#,
r#"{"function_v0":{"doc":"","name":"share_id","inputs":[],"outputs":["address"]}}"#,
r#"{"function_v0":{"doc":"","name":"deposit","inputs":[{"doc":"","name":"to","type_":"address"},{"doc":"","name":"desired_a","type_":"i128"},{"doc":"","name":"min_a","type_":"i128"},{"doc":"","name":"desired_b","type_":"i128"},{"doc":"","name":"min_b","type_":"i128"}],"outputs":[]}}"#,
r#"{"function_v0":{"doc":"","name":"swap","inputs":[{"doc":"","name":"to","type_":"address"},{"doc":"","name":"buy_a","type_":"bool"},{"doc":"","name":"out","type_":"i128"},{"doc":"","name":"in_max","type_":"i128"}],"outputs":[]}}"#,
r#"{"function_v0":{"doc":"","name":"withdraw","inputs":[{"doc":"","name":"to","type_":"address"},{"doc":"","name":"share_amount","type_":"i128"},{"doc":"","name":"min_a","type_":"i128"},{"doc":"","name":"min_b","type_":"i128"}],"outputs":[{"tuple":{"value_types":["i128","i128"]}}]}}"#,
r#"{"function_v0":{"doc":"","name":"deposit","inputs":[{"doc":"","name":"to","type":"address"},{"doc":"","name":"desired_a","type":"i128"},{"doc":"","name":"min_a","type":"i128"},{"doc":"","name":"desired_b","type":"i128"},{"doc":"","name":"min_b","type":"i128"}],"outputs":[]}}"#,
r#"{"function_v0":{"doc":"","name":"swap","inputs":[{"doc":"","name":"to","type":"address"},{"doc":"","name":"buy_a","type":"bool"},{"doc":"","name":"out","type":"i128"},{"doc":"","name":"in_max","type":"i128"}],"outputs":[]}}"#,
r#"{"function_v0":{"doc":"","name":"withdraw","inputs":[{"doc":"","name":"to","type":"address"},{"doc":"","name":"share_amount","type":"i128"},{"doc":"","name":"min_a","type":"i128"},{"doc":"","name":"min_b","type":"i128"}],"outputs":[{"tuple":{"value_types":["i128","i128"]}}]}}"#,
r#"{"function_v0":{"doc":"","name":"get_rsrvs","inputs":[],"outputs":[{"tuple":{"value_types":["i128","i128"]}}]}}"#
].iter().map(ToString::to_string).collect::<Vec<String>>()),
);
Expand Down
Loading