Add program and runtime support for Durable Transaction Nonces (#6845)

* Rework transaction processing result forwarding

Durable nonce prereq

* Add Durable Nonce program API

* Add runtime changes for Durable Nonce program

* Register Durable Nonce program

* Concise comments and bad math

* Fix c/p error

* Add rent sysvar to withdraw ix

* Remove rent exempt required balance from Meta struct

* Use the helper
This commit is contained in:
Trent Nelson
2019-12-07 12:54:10 -07:00
committed by GitHub
parent 6469606baf
commit 1ffd6b4b4d
18 changed files with 1832 additions and 143 deletions

View File

@@ -1,4 +1,9 @@
use crate::{account::Account, hash::Hash, sysvar::Sysvar};
use crate::{
account::Account,
hash::{hash, Hash},
sysvar::Sysvar,
};
use bincode::serialize;
use std::collections::BinaryHeap;
use std::iter::FromIterator;
use std::ops::Deref;
@@ -69,6 +74,13 @@ where
account
}
pub fn create_test_recent_blockhashes(start: usize) -> RecentBlockhashes {
let bhq: Vec<_> = (start..start + (MAX_ENTRIES - 1))
.map(|i| hash(&serialize(&i).unwrap()))
.collect();
RecentBlockhashes::from_iter(bhq.iter())
}
#[cfg(test)]
mod tests {
use super::*;