Skip to content

Commit

Permalink
nit: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
julienbrs committed Nov 18, 2023
1 parent 26414bd commit d8622b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ mod ExampleConstructor {
names: LegacyMap::<ContractAddress, felt252>,
}

// The constructor is decorated with a `#[constructor]` attribute.
// It is not inside an `impl` block.
#[constructor]
fn constructor(ref self: ContractState, name: felt252, address: ContractAddress) {
self.names.write(address, name);
}

impl ExampleConstructor of super::IExampleConstructor<ContractState> {
// The constructor is decorated with a `#[constructor]` attribute.
// It is not inside an `impl` block.

#[abi(embed_v0)]
impl ExampleConstructor of super::IExampleConstructor<ContractState> {
fn get_name(self: @ContractState, address: ContractAddress) -> felt252 {
self.names.read(address)
}
Expand Down
2 changes: 1 addition & 1 deletion listings/ch00-getting-started/constructor/src/tests.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod tests {

#[test]
#[available_gas(2000000000)]
fn should_deploy() {
fn should_init_correctly() {
let name = 'alice';
let caller_address: ContractAddress = contract_address_const::<'caller'>();
let contract = deploy(name, caller_address);
Expand Down

0 comments on commit d8622b0

Please sign in to comment.