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

fix(ts bindings): handle SAC spec #1795

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions cmd/soroban-cli/src/commands/contract/bindings/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub enum Error {
FailedToGetFileName(PathBuf),
#[error(transparent)]
WasmOrContract(#[from] wasm_or_contract::Error),
#[error(transparent)]
Xdr(#[from] crate::xdr::Error),
}

#[async_trait::async_trait]
Expand All @@ -62,9 +64,9 @@ impl NetworkRunnable for Cmd {
wasm_or_contract::fetch_wasm(&self.wasm_or_hash_or_contract_id, &print).await?;

let spec = if let Some(spec) = spec {
Spec::new(&spec)?
Spec::new(&spec)?.spec
} else {
Spec::new(&soroban_sdk::token::StellarAssetSpec::spec_xdr())?
soroban_spec::read::parse_raw(&soroban_sdk::token::StellarAssetSpec::spec_xdr())?
};

if self.output_dir.is_file() {
Expand Down Expand Up @@ -94,7 +96,7 @@ impl NetworkRunnable for Cmd {
contract_address.as_deref(),
network.as_ref().map(|n| n.rpc_url.as_ref()),
network.as_ref().map(|n| n.network_passphrase.as_ref()),
&spec.spec,
&spec,
)?;
print.checkln("Generated!");
print.infoln(format!(
Expand Down
Loading