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 add. #1565

Merged
merged 3 commits into from
Aug 27, 2024
Merged

Add contract alias add. #1565

merged 3 commits into from
Aug 27, 2024

Conversation

fnando
Copy link
Member

@fnando fnando commented Aug 27, 2024

What

$ cargo run contract alias add increment --id CDUQDWIBBXWYHEEROXASCIBNZOZ45WJ3EOMAGMG4VTY36O2SGQTWCM23 --network testnet --global --overwrite
   Compiling soroban-cli v21.4.1 (/Users/fnando/Projects/stellar/stellar-cli/cmd/soroban-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.09s
     Running `target/debug/soroban contract alias add increment --id CDUQDWIBBXWYHEEROXASCIBNZOZ45WJ3EOMAGMG4VTY36O2SGQTWCM23 --network testnet --global --overwrite`
ℹ️ Contract alias 'increment' will reference CDUQDWIBBXWYHEEROXASCIBNZOZ45WJ3EOMAGMG4VTY36O2SGQTWCM23 on network 'Test SDF Network ; September 2015'
✅ Contract alias 'increment' has been added

$ cargo run contract alias add increment --id CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY --network testnet --global
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/soroban contract alias add increment --id CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY --network testnet --global`
error: alias 'increment' is already referencing contract 'CDUQDWIBBXWYHEEROXASCIBNZOZ45WJ3EOMAGMG4VTY36O2SGQTWCM23' on network 'Test SDF Network ; September 2015'

$ cargo run contract alias add increment --id CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY --network testnet --global --overwrite
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/soroban contract alias add increment --id CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY --network testnet --global --overwrite`
ℹ️ Contract alias 'increment' will reference CALLOOCCCJRZ6AZAJSKNCTDZ766N4ANVRKRJPHC65KDV7RJCS37PS4XY on network 'Test SDF Network ; September 2015'
✅ Contract alias 'increment' has been added

$ cargo run contract alias add increment --id invalid --network testnet --global --overwrite
   Compiling soroban-cli v21.4.1 (/Users/fnando/Projects/stellar/stellar-cli/cmd/soroban-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.17s
     Running `target/debug/soroban contract alias add increment --id invalid --network testnet --global --overwrite`
error: invalid value 'invalid' for '--id <CONTRACT_ID>': the strkey is invalid

For more information, try '--help'.

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

Why

#1420

Known limitations

N/A

@fnando fnando merged commit a781e44 into main Aug 27, 2024
26 checks passed
@fnando fnando deleted the contract-alias-add branch August 27, 2024 21:22
alias,
)?;

print.checkln(format!("Contract alias '{alias}' has been added"));
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 added"));
print.checkln(format!("Contract alias '{alias}' added"));

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