Skip to content

Commit f167813

Browse files
committed
feat: rename contract registry to registry
1 parent 473ee39 commit f167813

File tree

5 files changed

+29
-24
lines changed

5 files changed

+29
-24
lines changed

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/registry/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "stellar-registry-contract"
2+
name = "registry"
33
description = "A crate for managing and deploying smart contracts on the Soroban blockchain."
44
version = "0.1.0"
55
authors = ["Aha Labs <hello@ahalabs.dev>"]

contracts/registry/src/test.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ fn default_version() -> soroban_sdk::String {
1111
to_string("0.0.0")
1212
}
1313

14-
stellar_registry::import_contract_client!(stellar_registry_contract);
14+
stellar_registry::import_contract_client!(registry);
1515
// Equivalent to:
1616

17-
// mod stellar_registry_contract {
17+
// mod registry {
1818
// use super::soroban_sdk;
19-
// soroban_sdk::contractimport!(file = "../../../../target/stellar/stellar_registry_contract.wasm");
19+
// soroban_sdk::contractimport!(file = "../../../../target/stellar/registry.wasm");
2020
// }
2121

2222
fn init() -> (SorobanContractClient<'static>, Address) {
@@ -28,7 +28,7 @@ fn init() -> (SorobanContractClient<'static>, Address) {
2828
env,
2929
&env.register_at(
3030
&contract_id,
31-
stellar_registry_contract::WASM,
31+
registry::WASM,
3232
(address.clone(),),
3333
),
3434
);
@@ -48,14 +48,14 @@ fn handle_error_cases() {
4848

4949
let wasm_hash = env
5050
.deployer()
51-
.upload_contract_wasm(stellar_registry_contract::WASM);
51+
.upload_contract_wasm(registry::WASM);
5252

5353
assert_matches!(
5454
client.try_fetch_hash(name, &None).unwrap_err(),
5555
Ok(Error::NoSuchContractPublished)
5656
);
5757

58-
let bytes = Bytes::from_slice(env, stellar_registry_contract::WASM);
58+
let bytes = Bytes::from_slice(env, registry::WASM);
5959
env.mock_all_auths();
6060
let version = default_version();
6161
client.publish(name, address, &bytes, &version);
@@ -81,14 +81,14 @@ fn returns_most_recent_version() {
8181
let env = env();
8282
let name = &to_string("publisher");
8383
// client.register_name(address, name);
84-
let bytes = Bytes::from_slice(env, stellar_registry_contract::WASM);
84+
let bytes = Bytes::from_slice(env, registry::WASM);
8585
env.mock_all_auths();
8686
let version = default_version();
8787
client.publish(name, address, &bytes, &version);
8888
let fetched_hash = client.fetch_hash(name, &None);
8989
let wasm_hash = env
9090
.deployer()
91-
.upload_contract_wasm(stellar_registry_contract::WASM);
91+
.upload_contract_wasm(registry::WASM);
9292
assert_eq!(fetched_hash, wasm_hash);
9393

9494
let second_hash: BytesN<32> = BytesN::random(env);
@@ -137,16 +137,21 @@ fn validate_version() {
137137
let (client, address) = &init();
138138
let env = env();
139139
let name = &to_string("registry");
140-
let bytes = Bytes::from_slice(env, stellar_registry_contract::WASM);
140+
let bytes = Bytes::from_slice(env, registry::WASM);
141141
env.mock_all_auths();
142142
let version = default_version();
143143
client.publish(name, address, &bytes, &version);
144144
assert_eq!(
145-
client.try_publish(name, address, &bytes, &to_string("0.0.0"),),
145+
client.try_publish(name, address, &bytes, &version),
146146
Err(Ok(Error::VersionMustBeGreaterThanCurrent))
147147
);
148148
assert_eq!(
149149
client.try_publish(name, address, &bytes, &to_string("0. 0.0"),),
150150
Err(Ok(Error::InvalidVersion))
151151
);
152+
client.publish(name, address, &bytes, &to_string("0.0.1"));
153+
assert_eq!(
154+
client.try_publish(name, address, &bytes, &version),
155+
Err(Ok(Error::VersionMustBeGreaterThanCurrent))
156+
);
152157
}

crates/stellar-scaffold-test/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub fn find_registry_wasm() -> Option<PathBuf> {
259259
Some(
260260
project_root
261261
.join("target")
262-
.join("stellar/stellar_registry_contract.wasm"),
262+
.join("stellar/registry.wasm"),
263263
)
264264
}
265265

deploy_registry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
PATH=./target/bin:$PATH
55

66
stellar contract deploy --alias registry \
7-
--wasm ./target/stellar/stellar_registry_contract.wasm \
7+
--wasm ./target/stellar/registry.wasm \
88
-- \
99
--admin default
1010

0 commit comments

Comments
 (0)