make all ops Eq; fix test imports

This commit is contained in:
Jude Nelson
2019-02-07 16:10:53 -05:00
parent d8ebc59ecb
commit 113df58622
3 changed files with 10 additions and 8 deletions

View File

@@ -36,7 +36,7 @@ use util::hash::to_hex;
pub const OPCODE: u8 = '[' as u8;
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Eq)]
pub struct LeaderBlockCommitOp<A, K> {
pub block_header_hash: BlockHeaderHash, // hash of Stacks block header (double-sha256)
pub new_seed: VRFSeed, // new seed for this block
@@ -395,7 +395,7 @@ mod tests {
}
];
let parser = BitcoinBlockParser::new(BitcoinNetworkType::testnet, BLOCKSTACK_MAGIC_MAINNET);
let parser = BitcoinBlockParser::new(BitcoinNetworkType::Testnet, BLOCKSTACK_MAGIC_MAINNET);
for tx_fixture in tx_fixtures {
let tx = make_tx(&tx_fixture.txstr).unwrap();

View File

@@ -40,7 +40,7 @@ use util::log;
pub const OPCODE: u8 = '^' as u8;
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Eq)]
pub struct LeaderKeyRegisterOp<A, K> {
pub consensus_hash: ConsensusHash, // consensus hash at time of issuance
pub public_key: VRFPublicKey, // EdDSA public key
@@ -234,7 +234,7 @@ mod tests {
consensus_hash: ConsensusHash::from_bytes(&hex_bytes("2222222222222222222222222222222222222222").unwrap()).unwrap(),
public_key: VRFPublicKey::from_bytes(&hex_bytes("a366b51292bef4edd64063d9145c617fec373bceb0758e98cd72becd84d54c7a").unwrap()).unwrap(),
memo: vec![01, 02, 03, 04, 05],
address: BitcoinAddress::from_scriptpubkey(BitcoinNetworkType::testnet, &hex_bytes("76a9140be3e286a15ea85882761618e366586b5574100d88ac").unwrap()).unwrap(),
address: BitcoinAddress::from_scriptpubkey(BitcoinNetworkType::Testnet, &hex_bytes("76a9140be3e286a15ea85882761618e366586b5574100d88ac").unwrap()).unwrap(),
op: OPCODE,
txid: Txid::from_bytes_be(&hex_bytes("1bfa831b5fc56c858198acb8e77e5863c1e9d8ac26d49ddb914e24d8d4083562").unwrap()).unwrap(),
@@ -251,7 +251,7 @@ mod tests {
consensus_hash: ConsensusHash::from_bytes(&hex_bytes("2222222222222222222222222222222222222222").unwrap()).unwrap(),
public_key: VRFPublicKey::from_bytes(&hex_bytes("a366b51292bef4edd64063d9145c617fec373bceb0758e98cd72becd84d54c7a").unwrap()).unwrap(),
memo: vec![],
address: BitcoinAddress::from_scriptpubkey(BitcoinNetworkType::testnet, &hex_bytes("76a9140be3e286a15ea85882761618e366586b5574100d88ac").unwrap()).unwrap(),
address: BitcoinAddress::from_scriptpubkey(BitcoinNetworkType::Testnet, &hex_bytes("76a9140be3e286a15ea85882761618e366586b5574100d88ac").unwrap()).unwrap(),
op: OPCODE,
txid: Txid::from_bytes_be(&hex_bytes("2fbf8d5be32dce49790d203ba59acbb0929d5243413174ff5d26a5c6f23dea65").unwrap()).unwrap(),
@@ -284,7 +284,7 @@ mod tests {
}
];
let parser = BitcoinBlockParser::new(BitcoinNetworkType::testnet, BLOCKSTACK_MAGIC_MAINNET);
let parser = BitcoinBlockParser::new(BitcoinNetworkType::Testnet, BLOCKSTACK_MAGIC_MAINNET);
for tx_fixture in tx_fixtures {
let tx = make_tx(&tx_fixture.txstr).unwrap();

View File

@@ -39,7 +39,7 @@ use ed25519_dalek::PublicKey as VRFPublicKey;
pub const OPCODE: u8 = '_' as u8;
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Eq)]
pub struct UserBurnSupportOp<A, K> {
pub consensus_hash: ConsensusHash,
pub public_key: VRFPublicKey,
@@ -191,9 +191,11 @@ where
mod tests {
use super::*;
use burnchains::bitcoin::blocks::BitcoinBlockParser;
use burnchains::bitcoin::BitcoinNetworkType;
use burnchains::Txid;
use burnchains::BLOCKSTACK_MAGIC_MAINNET;
use burnchains::bitcoin::keys::BitcoinPublicKey;
use burnchains::bitcoin::address::BitcoinAddress;
use bitcoin::network::serialize::deserialize;
@@ -264,7 +266,7 @@ mod tests {
}
];
let parser = BitcoinBlockParser::new(BitcoinNetworkType::testnet, BLOCKSTACK_MAGIC_MAINNET);
let parser = BitcoinBlockParser::new(BitcoinNetworkType::Testnet, BLOCKSTACK_MAGIC_MAINNET);
for tx_fixture in tx_fixtures {
let tx = make_tx(&tx_fixture.txstr).unwrap();