Build full SPL in CI (bp #15886) (#15964)

* Build full SPL in CI

(cherry picked from commit 82269f1351)

* Avoid changing signature of ProgramTest::add_account

(cherry picked from commit 03180b502d)

Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
mergify[bot]
2021-03-17 22:46:55 +00:00
committed by GitHub
parent af45efb62c
commit f5d56eabf3
2 changed files with 11 additions and 17 deletions

View File

@@ -476,8 +476,9 @@ impl ProgramTest {
}
/// Add an account to the test environment
pub fn add_account(&mut self, address: Pubkey, account: AccountSharedData) {
self.accounts.push((address, account));
pub fn add_account(&mut self, address: Pubkey, account: Account) {
self.accounts
.push((address, AccountSharedData::from(account)));
}
/// Add an account to the test environment with the account data in the provided `filename`
@@ -490,7 +491,7 @@ impl ProgramTest {
) {
self.add_account(
address,
AccountSharedData::from(Account {
Account {
lamports,
data: read_file(find_file(filename).unwrap_or_else(|| {
panic!("Unable to locate {}", filename);
@@ -498,7 +499,7 @@ impl ProgramTest {
owner,
executable: false,
rent_epoch: 0,
}),
},
);
}
@@ -513,14 +514,14 @@ impl ProgramTest {
) {
self.add_account(
address,
AccountSharedData::from(Account {
Account {
lamports,
data: base64::decode(data_base64)
.unwrap_or_else(|err| panic!("Failed to base64 decode: {}", err)),
owner,
executable: false,
rent_epoch: 0,
}),
},
);
}
@@ -576,13 +577,13 @@ impl ProgramTest {
self.add_account(
program_id,
AccountSharedData::from(Account {
Account {
lamports: Rent::default().minimum_balance(data.len()).min(1),
data,
owner: loader,
executable: true,
rent_epoch: 0,
}),
},
);
} else {
info!("\"{}\" program loaded as native code", program_name);