Skip to content

Commit

Permalink
Merge branch 'main' into feat/muxed_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal authored Nov 25, 2024
2 parents 24031f3 + 82082a0 commit 57700f0
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 55 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ changes quickly.

## Setting up development environment

There are 2 ways to being developing stellar-cli:
There are 2 ways to begin developing stellar-cli:

### Installing all required dependencies

Expand Down
10 changes: 5 additions & 5 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 FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ Creates, updates, or deletes a trustline Learn more about trustlines https://dev
* `--line <LINE>`
* `--limit <LIMIT>` — Limit for the trust line, 0 to remove the trust line

Default value: `18446744073709551615`
Default value: `9223372036854775807`



Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stellar CLI (stellar-cli)

![Apache 2.0 licensed](https://img.shields.io/badge/license-apache%202.0-blue.svg)
[![Apache 2.0 licensed](https://img.shields.io/badge/license-apache%202.0-blue.svg)](LICENSE)
[![Crates.io Version](https://img.shields.io/crates/v/stellar-cli?label=version&amp;color=04ac5b)](https://crates.io/crates/stellar-cli)

This repo is home to the Stellar CLI, the command-line multi-tool for running and deploying Stellar contracts on the Stellar network.
Expand Down
89 changes: 57 additions & 32 deletions cmd/crates/soroban-test/tests/fixtures/workspace/Cargo.lock

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

55 changes: 45 additions & 10 deletions cmd/crates/soroban-test/tests/it/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use predicates::prelude::predicate;
use soroban_cli::xdr::{Limited, Limits, ReadXdr, ScMetaEntry, ScMetaV0};
use soroban_spec_tools::contract::Spec;
use soroban_test::TestEnv;
use std::io::Cursor;

#[test]
fn build_all() {
Expand Down Expand Up @@ -135,18 +138,50 @@ fn build_with_metadata() {
.assert()
.success();

// verify that the metadata added in the contract code via contractmetadata! macro is present
// as well as the meta that is included on build
let wasm_path = fixture_path.join(&outdir).join("add.wasm");
sandbox
.new_assert_cmd("contract")
.current_dir(&fixture_path)
.arg("info")
.arg("meta")
.arg("--wasm")
.arg(wasm_path)
.arg("build")
.arg("--meta")
.arg("meta_replaced=some_new_meta")
.arg("--out-dir")
.arg(&outdir)
.assert()
.success()
.stdout(predicate::str::contains("Description: A test add contract"))
.stdout(predicate::str::contains("contract meta: added on build"));
.success();

// verify that the metadata added in the contract code via contractmetadata! macro is present
// as well as the meta that is included on build
let wasm_path = fixture_path.join(&outdir).join("add.wasm");
let wasm = std::fs::read(wasm_path).unwrap();
let spec = Spec::new(&wasm).unwrap();
let meta = spec.meta_base64.unwrap();
let entries = ScMetaEntry::read_xdr_base64_iter(&mut Limited::new(
Cursor::new(meta.as_bytes()),
Limits::none(),
))
.filter(|entry| match entry {
// Ignore the meta entries that the SDK embeds that capture the SDK and
// Rust version, since these will change often and are not really
// relevant to this test.
Ok(ScMetaEntry::ScMetaV0(ScMetaV0 { key, .. })) => {
let key = key.to_string();
!matches!(key.as_str(), "rsver" | "rssdkver")
}
_ => true,
})
.collect::<Result<Vec<_>, _>>()
.unwrap();

let expected_entries = vec![
ScMetaEntry::ScMetaV0(ScMetaV0 {
key: "Description".try_into().unwrap(),
val: "A test add contract".try_into().unwrap(),
}),
ScMetaEntry::ScMetaV0(ScMetaV0 {
key: "meta_replaced".try_into().unwrap(),
val: "some_new_meta".try_into().unwrap(),
}),
];

assert_eq!(entries, expected_entries);
}
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/tx/new/change_trust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct Cmd {
#[arg(long)]
pub line: builder::Asset,
/// Limit for the trust line, 0 to remove the trust line
#[arg(long, default_value = u64::MAX.to_string())]
#[arg(long, default_value = i64::MAX.to_string())]
pub limit: i64,
}

Expand Down
Loading

0 comments on commit 57700f0

Please sign in to comment.