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 contract alias show. #1567

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Add contract alias show. #1567

merged 2 commits into from
Aug 27, 2024

Conversation

fnando
Copy link
Member

@fnando fnando commented Aug 27, 2024

What

$ cargo run contract alias show increment --network testnet --global
   Compiling soroban-cli v21.4.1 (/Users/fnando/Projects/stellar/stellar-cli/cmd/soroban-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.05s
     Running `target/debug/soroban contract alias show increment --network testnet --global`
ℹ️ Contract alias 'increment' references CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY on network 'Test SDF Network ; September 2015'
CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY

$ cargo run contract alias show increment --network testnet --global > /tmp/id.txt
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s
     Running `target/debug/soroban contract alias show increment --network testnet --global`
ℹ️ Contract alias 'increment' references CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY on network 'Test SDF Network ; September 2015'

$ cat /tmp/id.txt
CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY

$ cargo run contract alias show hello --network testnet --global
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/soroban contract alias show hello --network testnet --global`
error: no contract found with alias `hello`

Why

#1420

Known limitations

N/A

Copy link
Member

@willemneal willemneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question

@fnando fnando merged commit 5b4776c into main Aug 27, 2024
26 checks passed
@fnando fnando deleted the contract-alias-show branch August 27, 2024 22:58
Comment on lines +48 to +52
print.infoln(format!(
"Contract alias '{alias}' references {contract} on network '{network_passphrase}'"
));

println!("{contract}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻 The split of user friendly message on stderr along with outputting the contract addresses to stdout is 👨🏻‍🍳💋.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants