Browse Source
253: A few fixes r=bonomat a=bonomat
A few fixes
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
compile-for-aarch64
bors[bot]
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
13 deletions
cfd_protocol/tests/cfds.rs
daemon/src/model/cfd.rs
daemon/src/taker.rs
@ -1043,14 +1043,8 @@ impl OliviaData {
)
}
/// An example of all the data necessary from `olivia` to test the
/// CFD protocol.
///
/// Data comes from this event:
/// https://outcome.observer/h00.ooo/x/BitMEX/BXBT/2021-10-05T02:00:00.price?n=20.
///
/// Note: Due to removal of historic data these events cannot actually be retrieved from the
/// Oracle anymore.
/// Generate an example of all the data from `olivia` needed to test the
/// CFD protocol end-to-end.
fn example ( id : & str , price : u64 , nonce_pks : & [ & str ] , attestations : & [ & str ] ) -> Self {
let oracle_pk = schnorrsig ::PublicKey ::from_str ( Self ::OLIVIA_PK ) . unwrap ( ) ;
@ -154,8 +154,7 @@ fn calculate_liquidation_price(
#[ derive(Debug, Clone, Serialize, Deserialize) ]
pub enum Error {
// TODO
ConnectionLost ,
Connect ,
}
#[ derive(Debug, Clone, Serialize, Deserialize) ]
@ -53,9 +53,9 @@ pub struct Db(sqlx::SqlitePool);
#[ derive(Clap) ]
struct Opts {
/// The IP address of the taker to connect to .
/// The IP address of the other party (i.e. the maker) .
#[ clap(long, default_value = " 127.0.0.1:9999 " ) ]
t aker : SocketAddr ,
m aker : SocketAddr ,
/// The port to listen on for the HTTP API.
#[ clap(long, default_value = " 8000 " ) ]
@ -155,7 +155,7 @@ async fn main() -> Result<()> {
let ( read , write ) = loop {
let socket = tokio ::net ::TcpSocket ::new_v4 ( ) ? ;
if let Ok ( connection ) = socket . connect ( opts . t aker) . await {
if let Ok ( connection ) = socket . connect ( opts . m aker) . await {
break connection . into_split ( ) ;
} else {
tracing ::warn ! (