-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
extern crate base64; | ||
extern crate sniffglue; | ||
extern crate env_logger; | ||
|
||
use data_encoding::BASE64; | ||
use sniffglue::errors::*; | ||
use std::env; | ||
|
||
fn main() { | ||
fn main() -> Result<()> { | ||
env_logger::init(); | ||
|
||
for arg in env::args().skip(1) { | ||
let bytes = base64::decode(&arg).unwrap(); | ||
let bytes = BASE64 | ||
.decode(arg.as_bytes()) | ||
.context("Failed to base64 decode")?; | ||
println!("{:?}", bytes); | ||
|
||
let packet = sniffglue::centrifuge::parse_eth(&bytes); | ||
println!("{:?}", packet); | ||
} | ||
|
||
Ok(()) | ||
} |