File tree Expand file tree Collapse file tree 4 files changed +10
-20
lines changed
uninitialized_example/src Expand file tree Collapse file tree 4 files changed +10
-20
lines changed Original file line number Diff line number Diff line change 1
1
contract ;
2
2
3
- use src_5 :: {Ownership , SRC_5 , State };
3
+ use src_5 :: {SRC5 , State };
4
4
use std :: constants :: ZERO_B256;
5
5
6
6
configurable {
@@ -10,12 +10,10 @@ configurable {
10
10
11
11
storage {
12
12
/// The owner in storage.
13
- owner : Ownership = Ownership {
14
- state : State :: Initialized (INITIAL_OWNER ),
15
- },
13
+ owner : State = State :: Initialized (INITIAL_OWNER ),
16
14
}
17
15
18
- impl SRC_5 for Contract {
16
+ impl SRC5 for Contract {
19
17
/// Returns the owner.
20
18
///
21
19
/// # Return Values
@@ -42,6 +40,6 @@ impl SRC_5 for Contract {
42
40
/// ```
43
41
#[storage(read)]
44
42
fn owner () -> State {
45
- storage . owner. read (). state
43
+ storage . owner. read ()
46
44
}
47
45
}
Original file line number Diff line number Diff line change 1
1
contract ;
2
2
3
- use src_5 :: {Ownership , SRC_5 , State };
3
+ use src_5 :: {SRC5 , State };
4
4
5
5
storage {
6
6
/// The owner in storage.
7
- owner : Ownership = Ownership {
8
- state : State :: Uninitialized ,
9
- },
7
+ owner : State = State :: Uninitialized ,
10
8
}
11
9
12
- impl SRC_5 for Contract {
10
+ impl SRC5 for Contract {
13
11
/// Returns the owner.
14
12
///
15
13
/// # Return Values
@@ -36,6 +34,6 @@ impl SRC_5 for Contract {
36
34
/// ```
37
35
#[storage(read)]
38
36
fn owner () -> State {
39
- storage . owner. read (). state
37
+ storage . owner. read ()
40
38
}
41
39
}
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ use std::constants::ZERO_B256;
81
81
use standards :: src_5 :: * ;
82
82
83
83
storage {
84
- owner : Ownership = Ownership :: initialized ( Identity :: Address (Address :: from (ZERO_B256 ) )),
84
+ owner : State = Identity :: Address (Address :: from (ZERO_B256 )),
85
85
}
86
86
87
87
impl SRC_5 for MyContract {
Original file line number Diff line number Diff line change @@ -29,13 +29,7 @@ pub enum AccessError {
29
29
NotOwner : (),
30
30
}
31
31
32
- /// Contains the ownership state.
33
- pub struct Ownership {
34
- /// Represents the state of ownership.
35
- state : State ,
36
- }
37
-
38
- abi SRC_5 {
32
+ abi SRC5 {
39
33
/// Returns the owner.
40
34
///
41
35
/// # Return Values
You can’t perform that action at this time.
0 commit comments