Skip to content

Commit 25294b9

Browse files
committed
--bootstrap-value is now serialized
1 parent 8265425 commit 25294b9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

connectors/connector-lib/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ serde_json = "1.0.57"
1414
reqwest = { version = "0.10.7", features = ["blocking"] }
1515
thiserror = "1.0.20"
1616
openssl = { version = "0.10", features = ["vendored"] }
17-
anyhow = "1.0.32"
17+
anyhow = "1.0.32"
18+
sigma-tree = { git = "https://github.com/ergoplatform/sigma-rust", branch = "develop", features = ["with-serde"] }

connectors/connector-lib/src/connector.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::oracle_core::{get_core_api_port, OracleCore};
22
use anyhow::Result;
3+
use sigma_tree::ast::Constant;
34
use std::env;
45
use std::thread;
56
use std::time::Duration;
@@ -35,7 +36,10 @@ impl Connector {
3536
let args: Vec<String> = env::args().collect();
3637
if args.len() > 1 && &args[1] == "--bootstrap-value" {
3738
if let Ok(price) = (self.get_datapoint)() {
38-
println!("Bootstrap {} Value: {}", self.title, price);
39+
// Convert the price into a sigma `Constant`
40+
let constant: Constant = (price as i64).into();
41+
42+
println!("Bootstrap {} Value: {}", self.title, constant.base16_str());
3943
std::process::exit(0);
4044
} else {
4145
panic!("Failed to fetch Erg/USD from CoinGecko");

0 commit comments

Comments
 (0)