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 remove. #1563

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Add contract alias remove. #1563

merged 2 commits into from
Aug 27, 2024

Conversation

fnando
Copy link
Member

@fnando fnando commented Aug 27, 2024

What

Add command to remove contract aliases.

$ cat ~/.config/soroban/contract-ids/increment.json
{"ids":{"Test SDF Network ; September 2015":"CCYBGMETD5TYZJ2ZBT3JBBCWODYJJWP274JA4LX4S7JGNUNQPXZBMNUY"}}%

$ cargo run contract alias remove increment --network standalone --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.22s
     Running `target/debug/soroban contract alias remove increment --network standalone --global`
ℹ️ Network passphrase: Standalone Network ; February 2017
error: no contract found with alias `increment`

$ cargo run contract alias remove 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.01s
     Running `target/debug/soroban contract alias remove increment --network testnet --global`
ℹ️ Network passphrase: Test SDF Network ; September 2015
ℹ️ Contract is CCYBGMETD5TYZJ2ZBT3JBBCWODYJJWP274JA4LX4S7JGNUNQPXZBMNUY
✅ Contract alias has been removed

$ cat ~/.config/soroban/contract-ids/increment.json
{"ids":{}}%

Why

#1420

Known limitations

N/A

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Couple requests inline.

cmd/soroban-cli/src/commands/contract/alias/remove.rs Outdated Show resolved Hide resolved
cmd/soroban-cli/src/commands/contract/alias/remove.rs Outdated Show resolved Hide resolved
cmd/soroban-cli/src/commands/contract/alias/remove.rs Outdated Show resolved Hide resolved
@fnando fnando merged commit 05e362b into main Aug 27, 2024
26 checks passed
@fnando fnando deleted the contract-alias-remove branch August 27, 2024 02:07
self.config_locator
.remove_contract_id(&network.network_passphrase, alias)?;

print.checkln(format!("Contract alias '{alias}' has been removed"));
Copy link
Member

Choose a reason for hiding this comment

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

"has been" is unnecessary

Suggested change
print.checkln(format!("Contract alias '{alias}' has been removed"));
print.checkln(format!("Contract alias '{alias}' removed"));

@langer933
Copy link

Fdff

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