Pass pubkey for coinbase (#159)
* store wallet output data in hashmap * cleanup up commented out code * pass pubkey/identifier and not derivation around to miner etc. * fix failing tests
This commit is contained in:
committed by
Ignotus Peverell
parent
c7f1ce965e
commit
3dd1dde00b
@@ -80,7 +80,7 @@ fn mine_empty_chain() {
|
||||
for n in 1..4 {
|
||||
let prev = chain.head_header().unwrap();
|
||||
let pk = keychain.derive_pubkey(n as u32).unwrap();
|
||||
let mut b = core::core::Block::new(&prev, vec![], &keychain, pk).unwrap();
|
||||
let mut b = core::core::Block::new(&prev, vec![], &keychain, &pk).unwrap();
|
||||
b.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
|
||||
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
|
||||
@@ -251,7 +251,7 @@ fn prepare_block_nosum(prev: &BlockHeader, diff: u64) -> Block {
|
||||
let keychain = Keychain::from_random_seed().unwrap();
|
||||
let pubkey = keychain.derive_pubkey(1).unwrap();
|
||||
|
||||
let mut b = core::core::Block::new(prev, vec![], &keychain, pubkey).unwrap();
|
||||
let mut b = core::core::Block::new(prev, vec![], &keychain, &pubkey).unwrap();
|
||||
b.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
b.header.total_difficulty = Difficulty::from_num(diff);
|
||||
b
|
||||
|
||||
@@ -39,7 +39,7 @@ fn test_various_store_indices() {
|
||||
|
||||
let chain_store = &chain::store::ChainKVStore::new(".grin".to_string()).unwrap() as &ChainStore;
|
||||
|
||||
let block = Block::new(&BlockHeader::default(), vec![], &keychain, pubkey).unwrap();
|
||||
let block = Block::new(&BlockHeader::default(), vec![], &keychain, &pubkey).unwrap();
|
||||
let commit = block.outputs[0].commitment();
|
||||
let block_hash = block.hash();
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ fn test_coinbase_maturity() {
|
||||
let pk3 = keychain.derive_pubkey(3).unwrap();
|
||||
let pk4 = keychain.derive_pubkey(4).unwrap();
|
||||
|
||||
let mut block = core::core::Block::new(&prev, vec![], &keychain, pk1.clone()).unwrap();
|
||||
let mut block = core::core::Block::new(&prev, vec![], &keychain, &pk1).unwrap();
|
||||
block.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
|
||||
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
|
||||
@@ -109,8 +109,7 @@ fn test_coinbase_maturity() {
|
||||
&keychain,
|
||||
).unwrap();
|
||||
|
||||
let mut block = core::core::Block::new(&prev, vec![&coinbase_txn], &keychain, pk3.clone())
|
||||
.unwrap();
|
||||
let mut block = core::core::Block::new(&prev, vec![&coinbase_txn], &keychain, &pk3).unwrap();
|
||||
block.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
|
||||
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
|
||||
@@ -138,7 +137,7 @@ fn test_coinbase_maturity() {
|
||||
let keychain = Keychain::from_random_seed().unwrap();
|
||||
let pk = keychain.derive_pubkey(1).unwrap();
|
||||
|
||||
let mut block = core::core::Block::new(&prev, vec![], &keychain, pk).unwrap();
|
||||
let mut block = core::core::Block::new(&prev, vec![], &keychain, &pk).unwrap();
|
||||
block.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
|
||||
let difficulty = consensus::next_difficulty(chain.difficulty_iter()).unwrap();
|
||||
@@ -157,7 +156,7 @@ fn test_coinbase_maturity() {
|
||||
|
||||
let prev = chain.head_header().unwrap();
|
||||
|
||||
let mut block = core::core::Block::new(&prev, vec![&coinbase_txn], &keychain, pk4).unwrap();
|
||||
let mut block = core::core::Block::new(&prev, vec![&coinbase_txn], &keychain, &pk4).unwrap();
|
||||
|
||||
block.header.timestamp = prev.timestamp + time::Duration::seconds(60);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user