Skip to content

Commit

Permalink
Merge branch 'master' into mempool-perf
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsutton committed Oct 6, 2023
2 parents d01ebd6 + b247698 commit acc3016
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crypto/txscript/src/data_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn deserialize_i64(v: &[u8]) -> Result<i64, TxScriptError> {
l if l > size_of::<i64>() => {
Err(TxScriptError::NotMinimalData(format!("numeric value encoded as {v:x?} is longer than 8 bytes")))
}
l if l == 0 => Ok(0),
0 => Ok(0),
_ => {
check_minimal_data_encoding(v)?;
let msb = v[v.len() - 1];
Expand Down
1 change: 1 addition & 0 deletions kos/src/imports.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub use crate::core::MetricsCtl;
pub use crate::core::*;
pub use crate::error::Error;
pub use crate::ipc::*;
Expand Down
1 change: 0 additions & 1 deletion rpc/grpc/client/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ macro_rules! route {
return __ret;
}
let __self = self;
let request = request;
let __ret: RpcResult<[<$name Response>]> =
{ __self.inner.call(RpcApiOps::$name, request).await?.as_ref().try_into() };
#[allow(unreachable_code)]
Expand Down
10 changes: 0 additions & 10 deletions rpc/grpc/server/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ impl Connection {
match payload {
Payload::NotifyBlockAddedRequest(ref request) => match kaspa_rpc_core::NotifyBlockAddedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(listener_id, Scope::BlockAdded(BlockAddedScope::default()), request.command)
Expand All @@ -328,7 +327,6 @@ impl Connection {
Payload::NotifyVirtualChainChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyVirtualChainChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -348,7 +346,6 @@ impl Connection {
Payload::NotifyFinalityConflictRequest(ref request) => {
match kaspa_rpc_core::NotifyFinalityConflictRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand Down Expand Up @@ -376,7 +373,6 @@ impl Connection {
Payload::NotifyUtxosChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyUtxosChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -394,7 +390,6 @@ impl Connection {
Payload::NotifySinkBlueScoreChangedRequest(ref request) => {
match kaspa_rpc_core::NotifySinkBlueScoreChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -412,7 +407,6 @@ impl Connection {
Payload::NotifyVirtualDaaScoreChangedRequest(ref request) => {
match kaspa_rpc_core::NotifyVirtualDaaScoreChangedRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -430,7 +424,6 @@ impl Connection {
Payload::NotifyPruningPointUtxoSetOverrideRequest(ref request) => {
match kaspa_rpc_core::NotifyPruningPointUtxoSetOverrideRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -448,7 +441,6 @@ impl Connection {
Payload::NotifyNewBlockTemplateRequest(ref request) => {
match kaspa_rpc_core::NotifyNewBlockTemplateRequest::try_from(request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -468,7 +460,6 @@ impl Connection {
let response: StopNotifyingUtxosChangedResponseMessage =
match kaspa_rpc_core::NotifyUtxosChangedRequest::try_from(&notify_request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand All @@ -489,7 +480,6 @@ impl Connection {
let response: StopNotifyingPruningPointUtxoSetOverrideResponseMessage =
match kaspa_rpc_core::NotifyPruningPointUtxoSetOverrideRequest::try_from(&notify_request) {
Ok(request) => {
let listener_id = listener_id;
let result = notifier
.clone()
.execute_subscribe_command(
Expand Down
6 changes: 3 additions & 3 deletions wallet/core/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ where
None
};

let list = if list.is_none() {
let list = if let Some(value) = list {
value
} else {
Value::Object(Map::from_iter(<K as DefaultSettings>::defaults().await.into_iter().map(|(k, v)| {
let ks = to_value(k).unwrap();
let ks = ks.as_str().expect("Unable to convert key to string");

(ks.to_string(), v)
})))
} else {
list.unwrap()
};

self.map.clear();
Expand Down
2 changes: 1 addition & 1 deletion wallet/core/src/utxo/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct UtxoProcessor {

impl UtxoProcessor {
pub fn new(rpc: Option<Rpc>, network_id: Option<NetworkId>, multiplexer: Option<Multiplexer<Box<Events>>>) -> Self {
let multiplexer = multiplexer.unwrap_or_else(Multiplexer::new);
let multiplexer = multiplexer.unwrap_or_default();
UtxoProcessor { inner: Arc::new(Inner::new(rpc, network_id, multiplexer)) }
}

Expand Down

0 comments on commit acc3016

Please sign in to comment.