Skip to content

Commit 2d5eac7

Browse files
committed
change content to string
1 parent 4007fde commit 2d5eac7

29 files changed

+165
-165
lines changed

steps/57/src/proof_of_existence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod test {
5454
struct TestConfig;
5555

5656
impl super::Config for TestConfig {
57-
type Content = &'static str;
57+
type Content = String;
5858
}
5959

6060
impl crate::system::Config for TestConfig {

steps/58/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mod test {
5757
struct TestConfig;
5858

5959
impl super::Config for TestConfig {
60-
type Content = &'static str;
60+
type Content = String;
6161
}
6262

6363
impl crate::system::Config for TestConfig {
@@ -69,14 +69,14 @@ mod test {
6969
#[test]
7070
fn basic_proof_of_existence() {
7171
let mut poe = super::Pallet::<TestConfig>::new();
72-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
73-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
74-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
72+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
73+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
74+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
7575
assert_eq!(
76-
poe.create_claim("bob".to_string(), "Hello, world!"),
76+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
7777
Err("this content is already claimed")
7878
);
79-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
80-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
79+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
80+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
8181
}
8282
}

steps/59/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ mod test {
8383
struct TestConfig;
8484

8585
impl super::Config for TestConfig {
86-
type Content = &'static str;
86+
type Content = String;
8787
}
8888

8989
impl crate::system::Config for TestConfig {
@@ -95,14 +95,14 @@ mod test {
9595
#[test]
9696
fn basic_proof_of_existence() {
9797
let mut poe = super::Pallet::<TestConfig>::new();
98-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
99-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
100-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
98+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
99+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
100+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
101101
assert_eq!(
102-
poe.create_claim("bob".to_string(), "Hello, world!"),
102+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
103103
Err("this content is already claimed")
104104
);
105-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
106-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
105+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
106+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
107107
}
108108
}

steps/60/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mod test {
8888
struct TestConfig;
8989

9090
impl super::Config for TestConfig {
91-
type Content = &'static str;
91+
type Content = String;
9292
}
9393

9494
impl crate::system::Config for TestConfig {
@@ -100,14 +100,14 @@ mod test {
100100
#[test]
101101
fn basic_proof_of_existence() {
102102
let mut poe = super::Pallet::<TestConfig>::new();
103-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
104-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
105-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
103+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
104+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
105+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
106106
assert_eq!(
107-
poe.create_claim("bob".to_string(), "Hello, world!"),
107+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
108108
Err("this content is already claimed")
109109
);
110-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
111-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
110+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
111+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
112112
}
113113
}

steps/61/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mod test {
8888
struct TestConfig;
8989

9090
impl super::Config for TestConfig {
91-
type Content = &'static str;
91+
type Content = String;
9292
}
9393

9494
impl crate::system::Config for TestConfig {
@@ -100,14 +100,14 @@ mod test {
100100
#[test]
101101
fn basic_proof_of_existence() {
102102
let mut poe = super::Pallet::<TestConfig>::new();
103-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
104-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
105-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
103+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
104+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
105+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
106106
assert_eq!(
107-
poe.create_claim("bob".to_string(), "Hello, world!"),
107+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
108108
Err("this content is already claimed")
109109
);
110-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
111-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
110+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
111+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
112112
}
113113
}

steps/62/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod types {
1616
pub type Extrinsic = crate::support::Extrinsic<AccountId, crate::RuntimeCall>;
1717
pub type Header = crate::support::Header<BlockNumber>;
1818
pub type Block = crate::support::Block<Header, Extrinsic>;
19-
pub type Content = &'static str;
19+
pub type Content = String;
2020
}
2121

2222
// These are all the calls which are exposed to the world.

steps/62/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mod test {
8888
struct TestConfig;
8989

9090
impl super::Config for TestConfig {
91-
type Content = &'static str;
91+
type Content = String;
9292
}
9393

9494
impl crate::system::Config for TestConfig {
@@ -100,14 +100,14 @@ mod test {
100100
#[test]
101101
fn basic_proof_of_existence() {
102102
let mut poe = super::Pallet::<TestConfig>::new();
103-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
104-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
105-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
103+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
104+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
105+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
106106
assert_eq!(
107-
poe.create_claim("bob".to_string(), "Hello, world!"),
107+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
108108
Err("this content is already claimed")
109109
);
110-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
111-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
110+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
111+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
112112
}
113113
}

steps/63/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod types {
1616
pub type Extrinsic = crate::support::Extrinsic<AccountId, crate::RuntimeCall>;
1717
pub type Header = crate::support::Header<BlockNumber>;
1818
pub type Block = crate::support::Block<Header, Extrinsic>;
19-
pub type Content = &'static str;
19+
pub type Content = String;
2020
}
2121

2222
// These are all the calls which are exposed to the world.

steps/63/src/proof_of_existence.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ mod test {
8888
struct TestConfig;
8989

9090
impl super::Config for TestConfig {
91-
type Content = &'static str;
91+
type Content = String;
9292
}
9393

9494
impl crate::system::Config for TestConfig {
@@ -100,14 +100,14 @@ mod test {
100100
#[test]
101101
fn basic_proof_of_existence() {
102102
let mut poe = super::Pallet::<TestConfig>::new();
103-
assert_eq!(poe.get_claim(&"Hello, world!"), None);
104-
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!"), Ok(()));
105-
assert_eq!(poe.get_claim(&"Hello, world!"), Some(&"alice".to_string()));
103+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), None);
104+
assert_eq!(poe.create_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
105+
assert_eq!(poe.get_claim(&"Hello, world!".to_string()), Some(&"alice".to_string()));
106106
assert_eq!(
107-
poe.create_claim("bob".to_string(), "Hello, world!"),
107+
poe.create_claim("bob".to_string(), "Hello, world!".to_string()),
108108
Err("this content is already claimed")
109109
);
110-
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!"), Ok(()));
111-
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!"), Ok(()));
110+
assert_eq!(poe.revoke_claim("alice".to_string(), "Hello, world!".to_string()), Ok(()));
111+
assert_eq!(poe.create_claim("bob".to_string(), "Hello, world!".to_string()), Ok(()));
112112
}
113113
}

steps/64/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod types {
1616
pub type Extrinsic = crate::support::Extrinsic<AccountId, crate::RuntimeCall>;
1717
pub type Header = crate::support::Header<BlockNumber>;
1818
pub type Block = crate::support::Block<Header, Extrinsic>;
19-
pub type Content = &'static str;
19+
pub type Content = String;
2020
}
2121

2222
// These are all the calls which are exposed to the world.
@@ -143,13 +143,13 @@ fn main() {
143143
support::Extrinsic {
144144
caller: alice.clone(),
145145
call: RuntimeCall::ProofOfExistence(proof_of_existence::Call::CreateClaim {
146-
claim: "Hello, world!",
146+
claim: "Hello, world!".to_string(),
147147
}),
148148
},
149149
support::Extrinsic {
150150
caller: bob.clone(),
151151
call: RuntimeCall::ProofOfExistence(proof_of_existence::Call::CreateClaim {
152-
claim: "Hello, world!",
152+
claim: "Hello, world!".to_string(),
153153
}),
154154
},
155155
],
@@ -161,13 +161,13 @@ fn main() {
161161
support::Extrinsic {
162162
caller: alice,
163163
call: RuntimeCall::ProofOfExistence(proof_of_existence::Call::RevokeClaim {
164-
claim: "Hello, world!",
164+
claim: "Hello, world!".to_string(),
165165
}),
166166
},
167167
support::Extrinsic {
168168
caller: bob,
169169
call: RuntimeCall::ProofOfExistence(proof_of_existence::Call::CreateClaim {
170-
claim: "Hello, world!",
170+
claim: "Hello, world!".to_string(),
171171
}),
172172
},
173173
],

0 commit comments

Comments
 (0)