Skip to content

Conversation

@KyrylR
Copy link
Collaborator

@KyrylR KyrylR commented Dec 24, 2025

No description provided.

use crate::filter::Filter;

static MIGRATOR: Migrator = sqlx::migrate!();
const BLINDING_KEY_LEN: usize = 32;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a single constant, look whether elements already have it (related to the SEED_LEN)


let results: Vec<UtxoQueryResult> = wallet.store().query(&[filter]).await?;

// todo: add merging
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use TODO(whoisgoingtodothat): ....

.sign_p2pk(&tx, utxos, 0, config.address_params(), *LIQUID_TESTNET_GENESIS)?;
let native_utxo = (*native_entry.outpoint(), native_entry.txout().clone());

// todo: maybe even in transfer native extract fee from input utxo (use as separate one)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not understand this todo

Comment on lines 79 to 83
Utxos {
/// Sets script for filtering in wallet
#[arg(long, long = "mine", default_value_t = false)]
is_mine: bool,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add it yet

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I envision a different implementation for that

}

impl Broadcaster {
/// Broadcasts created transaction or returns raw transaction as hex string
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this commit pls (let's not have comments that state the same thing as function name)


impl Broadcaster {
/// Broadcasts created transaction or returns raw transaction as hex string
pub async fn broadcast_tx(&self, wallet: &Wallet, tx: &Transaction, outpoints: &[OutPoint]) -> Result<(), Error> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need outpoints if we have tx

Comment on lines 28 to 39
CREATE TABLE option_params
(
script_pubkey BLOB NOT NULL PRIMARY KEY,
start_time BLOB NOT NULL,
expiry_time BLOB NOT NULL,
collateral_per_contract BLOB NOT NULL,
settlement_per_contract BLOB NOT NULL,
collateral_asset_id BLOB NOT NULL,
settlement_asset_id BLOB NOT NULL,
option_token_entropy BLOB NOT NULL,
grantor_token_entropy BLOB NOT NULL
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad design.....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss it offline, though in a nutshell this module should not be responsible for that

Comment on lines 17 to 40
async fn insert(&self, name: &str, asset_id: AssetId) -> Result<(), StoreError> {
let asset_entropy = asset_id.into_inner().0;

let existing: Option<(i64,)> = sqlx::query_as("SELECT 1 FROM assets WHERE asset_name = ?")
.bind(name)
.fetch_optional(&self.pool)
.await?;

if existing.is_some() {
return Err(StoreError::AssetIdAlreadyExists(name.to_string()));
}

let mut tx = self.pool.begin().await?;

sqlx::query("INSERT INTO assets (asset_name, asset_id) VALUES (?, ?)")
.bind(name)
.bind(asset_entropy.as_slice())
.execute(&mut *tx)
.await?;

tx.commit().await?;

Ok(())
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not according to how I see this thing

@KyrylR KyrylR force-pushed the feature/basic-cli branch from 2be661f to 63d87b8 Compare January 3, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants