Skip to content

Commit a68eb39

Browse files
Fix Address constructor and stale SDK version in EVM basics migration guide (#2690)
* Fix fabricated Address constructor and stale SDK version in EVM basics migration guide ### What Replace the non-existent `Address::new(...)` call with the SDK's actual way to get an address in this context, and bump the pinned soroban-sdk version. ### Why `Address` has no public byte-array constructor, so the example as written can't compile, and the pinned SDK version was a full major behind current. * Use Address::from_str instead of a testutils-only constructor ### What Construct the example address with `Address::from_str` instead of the test-only `Address::generate` helper. ### Why This snippet is general reference code, not a test, so it shouldn't rely on an API that's only available under the `testutils` feature. * Use a placeholder strkey instead of a fabricated real-looking address ### What Show `"G..."` as the strkey argument instead of a made-up full-looking public key. ### Why A real-looking G-address reads as if it were meaningful; a placeholder makes clear it's just illustrating the argument shape.
1 parent 85e5080 commit a68eb39

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/learn/migrate/evm/solidity-and-rust-basics.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ let vec = vec![&env, 0, 1, 2, 3];
181181
let map = map![&env, (2, 20), (1, 10)];
182182

183183
// Address
184-
let address = Address::new([0u8; 32]);
184+
let address = Address::from_str(&env, "G...");
185185

186186
// Struct (named fields)
187187
pub struct State {
@@ -573,10 +573,10 @@ crate-type = ["cdylib"]
573573
testutils = ["soroban-sdk/testutils"]
574574

575575
[dependencies]
576-
soroban-sdk = "26"
576+
soroban-sdk = "27"
577577

578578
[dev-dependencies]
579-
soroban-sdk = { version = "26", features = ["testutils"] }
579+
soroban-sdk = { version = "27", features = ["testutils"] }
580580

581581
[profile.release]
582582
opt-level = "z"

0 commit comments

Comments
 (0)