Skip to content

Commit a973469

Browse files
committed
update the program
1 parent e9b71ec commit a973469

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ tokio-codec = "0.1"
112112
untrusted = "0.6.2"
113113

114114
[dev-dependencies]
115-
noop = { path = "programs/noop" }
115+
dummy = { path = "programs/dummy" }
116116
print = { path = "programs/print" }
117-
move_funds = { path = "programs/move_funds" }
117+
token_transfer = { path = "programs/token_transfer" }
118118

119119
[[bench]]
120120
name = "bank"
@@ -135,14 +135,14 @@ name = "sigverify"
135135
members = [
136136
".",
137137
"common",
138-
"programs/noop",
138+
"programs/dummy",
139139
"programs/print",
140-
"programs/move_funds",
140+
"programs/token_transfer",
141141
]
142142
default-members = [
143143
".",
144144
"common",
145-
"programs/noop",
145+
"programs/dummy",
146146
"programs/print",
147-
"programs/move_funds",
147+
"programs/token_transfer",
148148
]

programs/noop/Cargo.toml renamed to programs/dummy/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "noop"
2+
name = "dummy"
33
version = "0.1.0"
44
authors = [
55
"John Casper<[email protected]>",
@@ -16,6 +16,6 @@ authors = [
1616
xpz_program_interface = { path = "../../common" }
1717

1818
[lib]
19-
name = "noop"
19+
name = "dummy"
2020
crate-type = ["dylib"]
2121

File renamed without changes.

programs/move_funds/Cargo.toml renamed to programs/token_transfer/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "move_funds"
2+
name = "token_transfer"
33
version = "0.1.0"
44
authors = [
55
"John Casper<[email protected]>",
@@ -18,6 +18,6 @@ generic-array = { version = "0.12.0", default-features = false, features = ["ser
1818
xpz_program_interface = { path = "../../common" }
1919

2020
[lib]
21-
name = "move_funds"
21+
name = "token_transfer"
2222
crate-type = ["dylib"]
2323

programs/move_funds/src/lib.rs renamed to programs/token_transfer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod tests {
2626
use xpz_program_interface::pubkey::Pubkey;
2727

2828
#[test]
29-
fn test_move_funds() {
29+
fn test_token_transfer() {
3030
let tokens: i64 = 100;
3131
let data: Vec<u8> = serialize(&tokens).unwrap();
3232
let keys = vec![Pubkey::default(); 2];

src/builtin_pgm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mod test {
110110
use transaction::Transaction;
111111

112112
#[test]
113-
fn test_create_noop() {
113+
fn test_create_dummy() {
114114
let from = Keypair::new();
115115
let to = Keypair::new();
116116
let mut accounts = vec![Account::default(), Account::default()];
@@ -228,7 +228,7 @@ mod test {
228228
Hash::default(),
229229
0,
230230
program_id,
231-
"move_funds".to_string(),
231+
"token_transfer".to_string(),
232232
);
233233

234234
SystemProgram::process_transaction(&tx, &mut accounts, &loaded_programs);
@@ -281,7 +281,7 @@ mod test {
281281
Hash::default(),
282282
0,
283283
program_id,
284-
"move_funds".to_string(),
284+
"token_transfer".to_string(),
285285
);
286286

287287
SystemProgram::process_transaction(&tx, &mut accounts, &loaded_programs);

src/dynamic_program.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,16 @@ mod tests {
106106

107107
#[test]
108108
fn test_create_library_path() {
109-
let path = create_library_path("noop");
109+
let path = create_library_path("dummy");
110110
assert_eq!(true, Path::new(&path).exists());
111111
let path = create_library_path("print");
112112
assert_eq!(true, Path::new(&path).exists());
113-
let path = create_library_path("move_funds");
113+
let path = create_library_path("token_transfer");
114114
assert_eq!(true, Path::new(&path).exists());
115115
}
116116

117117
#[test]
118-
fn test_program_noop() {
118+
fn test_program_dummy() {
119119
let data: Vec<u8> = vec![0];
120120
let keys = vec![Pubkey::default(); 2];
121121
let mut accounts = vec![Account::default(), Account::default()];
@@ -129,7 +129,7 @@ mod tests {
129129
.map(|(key, account)| KeyedAccount { key, account })
130130
.collect();
131131

132-
let dp = DynamicProgram::new("noop".to_string());
132+
let dp = DynamicProgram::new("dummy".to_string());
133133
dp.call(&mut infos, &data);
134134
}
135135
}
@@ -156,7 +156,7 @@ mod tests {
156156
}
157157

158158
#[test]
159-
fn test_program_move_funds_success() {
159+
fn test_program_token_transfer_success() {
160160
let tokens: i64 = 100;
161161
let data: Vec<u8> = serialize(&tokens).unwrap();
162162
let keys = vec![Pubkey::default(); 2];
@@ -171,15 +171,15 @@ mod tests {
171171
.map(|(key, account)| KeyedAccount { key, account })
172172
.collect();
173173

174-
let dp = DynamicProgram::new("move_funds".to_string());
174+
let dp = DynamicProgram::new("token_transfer".to_string());
175175
dp.call(&mut infos, &data);
176176
}
177177
assert_eq!(0, accounts[0].tokens);
178178
assert_eq!(101, accounts[1].tokens);
179179
}
180180

181181
#[test]
182-
fn test_program_move_funds_insufficient_funds() {
182+
fn test_program_token_transfer_insufficient_funds() {
183183
let tokens: i64 = 100;
184184
let data: Vec<u8> = serialize(&tokens).unwrap();
185185
let keys = vec![Pubkey::default(); 2];
@@ -194,15 +194,15 @@ mod tests {
194194
.map(|(key, account)| KeyedAccount { key, account })
195195
.collect();
196196

197-
let dp = DynamicProgram::new("move_funds".to_string());
197+
let dp = DynamicProgram::new("token_transfer".to_string());
198198
dp.call(&mut infos, &data);
199199
}
200200
assert_eq!(10, accounts[0].tokens);
201201
assert_eq!(1, accounts[1].tokens);
202202
}
203203

204204
#[test]
205-
fn test_program_move_funds_succes_many_threads() {
205+
fn test_program_token_transfer_succes_many_threads() {
206206
let num_threads = 42; // number of threads to spawn
207207
let num_iters = 100; // number of iterations of test in each thread
208208
let mut threads = Vec::new();
@@ -224,7 +224,7 @@ mod tests {
224224
.map(|(key, account)| KeyedAccount { key, account })
225225
.collect();
226226

227-
let dp = DynamicProgram::new("move_funds".to_string());
227+
let dp = DynamicProgram::new("token_transfer".to_string());
228228
dp.call(&mut infos, &data);
229229
}
230230
assert_eq!(0, accounts[0].tokens);

0 commit comments

Comments
 (0)