Skip to content

Commit

Permalink
Bump mc/master (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
briancorbin authored Oct 31, 2022
1 parent e4cd3de commit 1b3b873
Show file tree
Hide file tree
Showing 24 changed files with 353 additions and 253 deletions.
441 changes: 265 additions & 176 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions full-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ mc-mobilecoind = { path = "../mobilecoin/mobilecoind" }
mc-mobilecoind-api = { path = "../mobilecoin/mobilecoind/api" }
mc-mobilecoind-json = { path = "../mobilecoin/mobilecoind-json" }
mc-sgx-css = { path = "../mobilecoin/sgx/css" }
mc-transaction-builder = { path = "../mobilecoin/transaction/builder" }
mc-transaction-core = { path = "../mobilecoin/transaction/core" }
mc-transaction-std = { path = "../mobilecoin/transaction/std" }
mc-transaction-extra = { path = "../mobilecoin/transaction/extra" }
mc-transaction-types = { path = "../mobilecoin/transaction/types" }
mc-util-from-random = { path = "../mobilecoin/util/from-random" }
mc-util-parse = { path = "../mobilecoin/util/parse" }
Expand All @@ -52,7 +53,7 @@ diesel-derive-enum = { version = "1", features = ["sqlite"] }
diesel_migrations = { version = "1.4.0", features = ["sqlite"] }
displaydoc = {version = "0.2", default-features = false }
dotenv = "0.15.0"
grpcio = "0.10.3"
grpcio = "0.11"
hex = {version = "0.4", default-features = false }
num_cpus = "1.13"
protobuf = "2.28.0"
Expand Down
3 changes: 2 additions & 1 deletion full-service/src/db/txo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ use mc_ledger_db::{Ledger, LedgerDB};
use mc_transaction_core::{
constants::MAX_INPUTS,
ring_signature::KeyImage,
tx::{TxOut, TxOutConfirmationNumber, TxOutMembershipProof},
tx::{TxOut, TxOutMembershipProof},
Amount, TokenId,
};
use mc_transaction_extra::TxOutConfirmationNumber;
use std::{fmt, str::FromStr};

use crate::{
Expand Down
6 changes: 3 additions & 3 deletions full-service/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ pub enum WalletTransactionBuilderError {
LedgerDB(mc_ledger_db::Error),

/// Tx Builder Error: {0}
TxBuilder(mc_transaction_std::TxBuilderError),
TxBuilder(mc_transaction_builder::TxBuilderError),

/// Invalid Argument: {0}
InvalidArgument(String),
Expand Down Expand Up @@ -344,8 +344,8 @@ impl From<mc_ledger_db::Error> for WalletTransactionBuilderError {
}
}

impl From<mc_transaction_std::TxBuilderError> for WalletTransactionBuilderError {
fn from(src: mc_transaction_std::TxBuilderError) -> Self {
impl From<mc_transaction_builder::TxBuilderError> for WalletTransactionBuilderError {
fn from(src: mc_transaction_builder::TxBuilderError) -> Self {
Self::TxBuilder(src)
}
}
Expand Down
2 changes: 1 addition & 1 deletion full-service/src/json_rpc/v1/models/receiver_receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::{json_rpc::v1::models::amount::MaskedAmount, service};
use mc_crypto_keys::CompressedRistrettoPublic;
use mc_transaction_core::tx::TxOutConfirmationNumber;
use mc_transaction_extra::TxOutConfirmationNumber;
use serde_derive::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand Down
2 changes: 1 addition & 1 deletion full-service/src/json_rpc/v1/models/tx_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
use mc_common::HashMap;
use mc_mobilecoind_json::data_types::{JsonOutlay, JsonTx, JsonUnspentTxOut};

use mc_transaction_core::tx::TxOutConfirmationNumber;
use mc_transaction_extra::TxOutConfirmationNumber;
use serde_derive::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand Down
2 changes: 1 addition & 1 deletion full-service/src/json_rpc/v2/api/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use mc_crypto_keys::CompressedRistrettoPublic;
use mc_fog_report_validation::FogPubkeyResolver;
use mc_mobilecoind_json::data_types::{JsonTx, JsonTxOut, JsonTxOutMembershipProof};
use mc_transaction_core::Amount;
use mc_transaction_std::BurnRedemptionMemo;
use mc_transaction_extra::BurnRedemptionMemo;
use rocket::{self};
use rocket_contrib::json::Json;
use std::{
Expand Down
2 changes: 1 addition & 1 deletion full-service/src/json_rpc/v2/e2e_tests/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ mod e2e_misc {
let error = res.get("error").unwrap();
assert_eq!(
error.get("data").unwrap().get("server_error").unwrap(),
"LedgerDB(NotFound)"
"LedgerDB(Record not found)"
);
}

Expand Down
2 changes: 1 addition & 1 deletion full-service/src/json_rpc/v2/models/receiver_receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::{json_rpc::v2::models::masked_amount::MaskedAmount, service};
use mc_crypto_keys::CompressedRistrettoPublic;
use mc_transaction_core::tx::TxOutConfirmationNumber;
use mc_transaction_extra::TxOutConfirmationNumber;
use serde_derive::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand Down
2 changes: 1 addition & 1 deletion full-service/src/service/confirmation_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use mc_connection::{BlockchainConnection, UserTxConnection};
use mc_crypto_keys::CompressedRistrettoPublic;
use mc_fog_report_validation::FogPubkeyResolver;
use mc_ledger_db::Ledger;
use mc_transaction_core::tx::TxOutConfirmationNumber;
use mc_transaction_extra::TxOutConfirmationNumber;

/// Errors for the Txo Service.
#[derive(Display, Debug)]
Expand Down
20 changes: 14 additions & 6 deletions full-service/src/service/gift_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use mc_crypto_keys::RistrettoPublic;
use mc_crypto_ring_signature_signer::NoKeysRingSigner;
use mc_fog_report_validation::FogPubkeyResolver;
use mc_ledger_db::Ledger;
use mc_transaction_builder::{InputCredentials, RTHMemoBuilder, TransactionBuilder};
use mc_transaction_core::{
constants::RING_SIZE,
get_tx_out_shared_secret,
Expand All @@ -48,9 +49,7 @@ use mc_transaction_core::{
tx::{Tx, TxOut},
Amount, Token,
};
use mc_transaction_std::{
InputCredentials, RTHMemoBuilder, SenderMemoCredential, TransactionBuilder,
};
use mc_transaction_extra::SenderMemoCredential;
use mc_util_uri::FogUri;
use rand::Rng;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -137,7 +136,7 @@ pub enum GiftCodeServiceError {
ProtoConversion(mc_api::ConversionError),

/// Error with Transaction Builder
TxBuilder(mc_transaction_std::TxBuilderError),
TxBuilder(mc_transaction_builder::TxBuilderError),

/// Error parsing URI: {0}
UriParse(mc_util_uri::UriParseError),
Expand Down Expand Up @@ -165,6 +164,9 @@ pub enum GiftCodeServiceError {

/// Ledger service error: {0}
LedgerService(LedgerServiceError),

/// Retry Error
Retry(mc_connection::RetryError<mc_connection::Error>),
}

impl From<WalletDbError> for GiftCodeServiceError {
Expand Down Expand Up @@ -227,8 +229,8 @@ impl From<mc_crypto_keys::KeyError> for GiftCodeServiceError {
}
}

impl From<mc_transaction_std::TxBuilderError> for GiftCodeServiceError {
fn from(src: mc_transaction_std::TxBuilderError) -> Self {
impl From<mc_transaction_builder::TxBuilderError> for GiftCodeServiceError {
fn from(src: mc_transaction_builder::TxBuilderError) -> Self {
Self::TxBuilder(src)
}
}
Expand Down Expand Up @@ -281,6 +283,12 @@ impl From<LedgerServiceError> for GiftCodeServiceError {
}
}

impl From<mc_connection::RetryError<mc_connection::Error>> for GiftCodeServiceError {
fn from(src: mc_connection::RetryError<mc_connection::Error>) -> Self {
Self::Retry(src)
}
}

#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct EncodedGiftCode(pub String);

Expand Down
4 changes: 2 additions & 2 deletions full-service/src/service/models/tx_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use mc_transaction_core::{
onetime_keys::recover_onetime_private_key,
ring_signature::KeyImage,
tokens::Mob,
tx::{Tx, TxOut, TxOutConfirmationNumber},
tx::{Tx, TxOut},
Amount, Token,
};
use mc_transaction_std::UnsignedTx;
use mc_transaction_extra::{TxOutConfirmationNumber, UnsignedTx};
use protobuf::Message;

use crate::{service::transaction::TransactionServiceError, util::b58::b58_decode_public_address};
Expand Down
3 changes: 2 additions & 1 deletion full-service/src/service/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use mc_account_keys::AccountKey;
use mc_connection::{BlockchainConnection, UserTxConnection};
use mc_crypto_keys::{CompressedRistrettoPublic, RistrettoPublic};
use mc_fog_report_validation::FogPubkeyResolver;
use mc_transaction_core::{get_tx_out_shared_secret, tx::TxOutConfirmationNumber, MaskedAmount};
use mc_transaction_core::{get_tx_out_shared_secret, MaskedAmount};
use mc_transaction_extra::TxOutConfirmationNumber;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand Down
32 changes: 25 additions & 7 deletions full-service/src/service/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ use mc_account_keys::AccountKey;
use mc_common::logger::log;
use mc_connection::{BlockchainConnection, RetryableUserTxConnection, UserTxConnection};
use mc_fog_report_validation::FogPubkeyResolver;
use mc_transaction_builder::{
BurnRedemptionMemoBuilder, EmptyMemoBuilder, MemoBuilder, RTHMemoBuilder,
};
use mc_transaction_core::{
constants::{MAX_INPUTS, MAX_OUTPUTS},
tokens::Mob,
Amount, Token, TokenId,
};
use mc_transaction_std::{
BurnRedemptionMemo, BurnRedemptionMemoBuilder, EmptyMemoBuilder, MemoBuilder, RTHMemoBuilder,
SenderMemoCredential,
};
use mc_transaction_extra::{BurnRedemptionMemo, SenderMemoCredential};

use crate::service::address::{AddressService, AddressServiceError};
use displaydoc::Display;
Expand Down Expand Up @@ -109,13 +109,19 @@ pub enum TransactionServiceError {
Decode(mc_util_serial::DecodeError),

/// Tx Builder Error: {0}
TxBuilder(mc_transaction_std::TxBuilderError),
TxBuilder(mc_transaction_builder::TxBuilderError),

/// Ledger service error: {0}
LedgerService(LedgerServiceError),

/// Key Error: {0}
Key(mc_crypto_keys::KeyError),

/// RetryError
Retry(mc_connection::RetryError<mc_connection::Error>),

/// Ring CT Error: {0}
RingCT(mc_transaction_core::ring_ct::Error),
}

impl From<WalletDbError> for TransactionServiceError {
Expand Down Expand Up @@ -184,8 +190,8 @@ impl From<mc_util_serial::DecodeError> for TransactionServiceError {
}
}

impl From<mc_transaction_std::TxBuilderError> for TransactionServiceError {
fn from(src: mc_transaction_std::TxBuilderError) -> Self {
impl From<mc_transaction_builder::TxBuilderError> for TransactionServiceError {
fn from(src: mc_transaction_builder::TxBuilderError) -> Self {
Self::TxBuilder(src)
}
}
Expand All @@ -202,6 +208,18 @@ impl From<LedgerServiceError> for TransactionServiceError {
}
}

impl From<mc_connection::RetryError<mc_connection::Error>> for TransactionServiceError {
fn from(src: mc_connection::RetryError<mc_connection::Error>) -> Self {
Self::Retry(src)
}
}

impl From<mc_transaction_core::ring_ct::Error> for TransactionServiceError {
fn from(src: mc_transaction_core::ring_ct::Error) -> Self {
Self::RingCT(src)
}
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum TransactionMemo {
/// Empty Transaction Memo.
Expand Down
11 changes: 4 additions & 7 deletions full-service/src/service/transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//! This module, on the other hand, builds a transaction within the context of
//! the wallet.
use super::models::tx_proposal::{OutputTxo, UnsignedInputTxo, UnsignedTxProposal};
use crate::{
db::{
account::{AccountID, AccountModel},
Expand All @@ -24,23 +25,19 @@ use mc_common::HashSet;
use mc_crypto_ring_signature_signer::OneTimeKeyDeriveData;
use mc_fog_report_validation::FogPubkeyResolver;
use mc_ledger_db::{Ledger, LedgerDB};
use mc_transaction_builder::{
DefaultTxOutputsOrdering, InputCredentials, ReservedSubaddresses, TransactionBuilder,
};
use mc_transaction_core::{
constants::RING_SIZE,
tokens::Mob,
tx::{TxOut, TxOutMembershipProof},
Amount, BlockVersion, Token, TokenId,
};

use mc_transaction_std::{
DefaultTxOutputsOrdering, InputCredentials, ReservedSubaddresses, TransactionBuilder,
};
use mc_util_uri::FogUri;

use rand::{rngs::ThreadRng, Rng};
use std::{collections::BTreeMap, str::FromStr, sync::Arc};

use super::models::tx_proposal::{OutputTxo, UnsignedInputTxo, UnsignedTxProposal};

/// Default number of blocks used for calculating transaction tombstone block
/// number.
// TODO support for making this configurable
Expand Down
6 changes: 3 additions & 3 deletions full-service/src/service/txo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub enum TxoServiceError {
From(String),

/// TxBuilderError: {0}
TxBuilder(mc_transaction_std::TxBuilderError),
TxBuilder(mc_transaction_builder::TxBuilderError),
}

impl From<WalletDbError> for TxoServiceError {
Expand Down Expand Up @@ -115,8 +115,8 @@ impl From<String> for TxoServiceError {
}
}

impl From<mc_transaction_std::TxBuilderError> for TxoServiceError {
fn from(src: mc_transaction_std::TxBuilderError) -> Self {
impl From<mc_transaction_builder::TxBuilderError> for TxoServiceError {
fn from(src: mc_transaction_builder::TxBuilderError) -> Self {
Self::TxBuilder(src)
}
}
Expand Down
5 changes: 1 addition & 4 deletions full-service/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ use crate::{
},
WalletService,
};
use diesel::{
r2d2::{ConnectionManager as CM, PooledConnection},
Connection as DSLConnection, SqliteConnection,
};
use diesel::{Connection as DSLConnection, SqliteConnection};
use diesel_migrations::embed_migrations;
use mc_account_keys::{AccountKey, PublicAddress, RootIdentity};
use mc_attest_verifier::Verifier;
Expand Down
2 changes: 1 addition & 1 deletion mirror/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mc-util-uri = { path = "../mobilecoin/util/uri" }
boring = "2.0"
futures = "0.3"
generic-array = "0.14"
grpcio = "0.10.3"
grpcio = "0.11.0"
hex = "0.4"
protobuf = "2.12"
rand = "0.8"
Expand Down
2 changes: 1 addition & 1 deletion mobilecoin
Submodule mobilecoin updated 474 files
3 changes: 2 additions & 1 deletion transaction-signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ mc-common = { path = "../mobilecoin/common", default-features = false, features
mc-crypto-keys = { path = "../mobilecoin/crypto/keys", default-features = false }
mc-crypto-ring-signature-signer = { path = "../mobilecoin/crypto/ring-signature/signer" }
mc-transaction-core = { path = "../mobilecoin/transaction/core" }
mc-transaction-std = { path = "../mobilecoin/transaction/std" }
mc-transaction-builder = { path = "../mobilecoin/transaction/builder" }
mc-transaction-extra = { path = "../mobilecoin/transaction/extra" }
mc-util-serial = { path = "../mobilecoin/util/serial", default-features = false }

mc-full-service = { path = "../full-service" }
Expand Down
2 changes: 1 addition & 1 deletion validator/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mc-fog-report-api = { path = "../../mobilecoin/fog/report/api" }
mc-util-uri = { path = "../../mobilecoin/util/uri" }

futures = "0.3"
grpcio = "0.10.3"
grpcio = "0.11.0"
protobuf = "2.28.0"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion validator/connection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ mc-util-uri = { path = "../../mobilecoin/util/uri" }

displaydoc = {version = "0.2", default-features = false }
futures = "0.3"
grpcio = "0.10.3"
grpcio = "0.11.0"
protobuf = "2.28.0"
2 changes: 1 addition & 1 deletion validator/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ mc-util-grpc = { path = "../../mobilecoin/util/grpc" }
mc-util-parse = { path = "../../mobilecoin/util/parse" }
mc-util-uri = { path = "../../mobilecoin/util/uri" }

grpcio = "0.10.3"
grpcio = "0.11.0"
structopt = "0.3"
rayon = "1.5"
Loading

0 comments on commit 1b3b873

Please sign in to comment.