Skip to content

Commit 29cb3a4

Browse files
authored
Merge pull request #37 from FuelLabs/bitzoic-SRC_5-to-SRC5
Remove `Ownerhship` struct and change `SRC_5` abi to `SRC5`
2 parents 3deceb3 + 3347f67 commit 29cb3a4

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

examples/src_5/initialized_example/src/initialized_example.sw

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
contract;
22

3-
use src_5::{Ownership, SRC_5, State};
3+
use src_5::{SRC5, State};
44
use std::constants::ZERO_B256;
55

66
configurable {
@@ -10,12 +10,10 @@ configurable {
1010

1111
storage {
1212
/// The owner in storage.
13-
owner: Ownership = Ownership {
14-
state: State::Initialized(INITIAL_OWNER),
15-
},
13+
owner: State = State::Initialized(INITIAL_OWNER),
1614
}
1715

18-
impl SRC_5 for Contract {
16+
impl SRC5 for Contract {
1917
/// Returns the owner.
2018
///
2119
/// # Return Values
@@ -42,6 +40,6 @@ impl SRC_5 for Contract {
4240
/// ```
4341
#[storage(read)]
4442
fn owner() -> State {
45-
storage.owner.read().state
43+
storage.owner.read()
4644
}
4745
}

examples/src_5/uninitialized_example/src/uninitialized_example.sw

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
contract;
22

3-
use src_5::{Ownership, SRC_5, State};
3+
use src_5::{SRC5, State};
44

55
storage {
66
/// The owner in storage.
7-
owner: Ownership = Ownership {
8-
state: State::Uninitialized,
9-
},
7+
owner: State = State::Uninitialized,
108
}
119

12-
impl SRC_5 for Contract {
10+
impl SRC5 for Contract {
1311
/// Returns the owner.
1412
///
1513
/// # Return Values
@@ -36,6 +34,6 @@ impl SRC_5 for Contract {
3634
/// ```
3735
#[storage(read)]
3836
fn owner() -> State {
39-
storage.owner.read().state
37+
storage.owner.read()
4038
}
4139
}

standards/src_5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use std::constants::ZERO_B256;
8181
use standards::src_5::*;
8282

8383
storage {
84-
owner: Ownership = Ownership::initialized(Identity::Address(Address::from(ZERO_B256))),
84+
owner: State = Identity::Address(Address::from(ZERO_B256)),
8585
}
8686

8787
impl SRC_5 for MyContract {

standards/src_5/src/src_5.sw

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ pub enum AccessError {
2929
NotOwner: (),
3030
}
3131

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 {
3933
/// Returns the owner.
4034
///
4135
/// # Return Values

0 commit comments

Comments
 (0)