make accounts_db own the directory paths (#5230)

* change paths to something accounts_db (the singleton) owns, fixes SIGILL

* fail deserialize if paths don't work
serialize paths, too

* test that paths are populated from a bank snapshot
This commit is contained in:
Rob Walker
2019-07-23 13:47:48 -07:00
committed by GitHub
parent b41e8333b1
commit 8a12ed029c
4 changed files with 145 additions and 240 deletions

View File

@@ -2750,10 +2750,7 @@ mod tests {
let mut rdr = Cursor::new(&buf[..]);
let mut dbank: Bank = deserialize_from(&mut rdr).unwrap();
let mut reader = BufReader::new(&buf[rdr.position() as usize..]);
dbank.set_bank_rc(
&BankRc::new(Some(bank0.accounts().paths.clone()), 0),
&StatusCacheRc::default(),
);
dbank.set_bank_rc(&BankRc::new(None, 0), &StatusCacheRc::default());
assert!(dbank.rc.update_from_stream(&mut reader).is_ok());
assert_eq!(dbank.get_balance(&key.pubkey()), 10);
bank.compare_bank(&dbank);