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:
@@ -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::*;
|
||||
|
Reference in New Issue
Block a user