Skip to content

Commit

Permalink
fix git foo
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Jul 20, 2020
1 parent 272da27 commit 458b131
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions tests/feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ extern crate random_access_memory as ram;
mod common;

use common::create_feed;
use hypercore::{generate_keypair, Event, Feed, NodeTrait, PublicKey, SecretKey, Storage};
use futures::stream::StreamExt;
use hypercore::{generate_keypair, Feed, NodeTrait, PublicKey, SecretKey, Storage};
use hypercore::{storage_disk, storage_memory};
use std::env::temp_dir;
use std::fs;
Expand Down Expand Up @@ -188,17 +187,7 @@ async fn put_with_data() {
let mut a = create_feed(50).await.unwrap();

// Create a second feed with the first feed's key.
<<<<<<< HEAD
let (public, secret) = copy_keys(&a);
let storage = storage_memory().await.unwrap();
let mut b = Feed::builder(public, storage)
.secret_key(secret)
.build()
.await
.unwrap();
=======
let mut b = create_clone(&a).await.unwrap();
>>>>>>> c79679a... Make dyn storage Send

// Append 4 blocks of data to the writable feed.
a.append(b"hi").await.unwrap();
Expand Down Expand Up @@ -256,7 +245,6 @@ async fn create_with_stored_keys() {
);
}

<<<<<<< HEAD
fn copy_keys(feed: &Feed) -> (PublicKey, SecretKey) {
match &feed.secret_key() {
Some(secret) => {
Expand All @@ -272,8 +260,6 @@ fn copy_keys(feed: &Feed) -> (PublicKey, SecretKey) {
}
}

=======
>>>>>>> c79679a... Make dyn storage Send
#[async_std::test]
async fn audit() {
let mut feed = create_feed(50).await.unwrap();
Expand Down Expand Up @@ -368,3 +354,13 @@ async fn try_open_file_as_dir() {
panic!("Opening path that points to a file must result in error");
}
}

async fn create_clone(feed: &Feed) -> Result<Feed, anyhow::Error> {
let (public, secret) = copy_keys(&feed);
let storage = storage_memory().await?;
let clone = Feed::builder(public, storage)
.secret_key(secret)
.build()
.await?;
Ok(clone)
}

0 comments on commit 458b131

Please sign in to comment.