Skip to content

Commit

Permalink
Release v0.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shaynekellyii committed Aug 23, 2023
1 parent a1eb237 commit eb50144
Show file tree
Hide file tree
Showing 70 changed files with 4,245 additions and 3,570 deletions.
78 changes: 1 addition & 77 deletions examples/bank-emulator/Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -797,21 +797,6 @@ in
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling."0.12.4" = overridableMkRustCrate (profileName: rec {
name = "darling";
version = "0.12.4";
registry = "registry+https://github.com/rust-lang/crates.io-index";
src = fetchCratesIo { inherit name version; sha256 = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c"; };
features = builtins.concatLists [
[ "default" ]
[ "suggestions" ]
];
dependencies = {
darling_core = rustPackages."registry+https://github.com/rust-lang/crates.io-index".darling_core."0.12.4" { inherit profileName; };
darling_macro = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".darling_macro."0.12.4" { profileName = "__noProfile"; };
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling."0.13.4" = overridableMkRustCrate (profileName: rec {
name = "darling";
version = "0.13.4";
Expand All @@ -827,25 +812,6 @@ in
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling_core."0.12.4" = overridableMkRustCrate (profileName: rec {
name = "darling_core";
version = "0.12.4";
registry = "registry+https://github.com/rust-lang/crates.io-index";
src = fetchCratesIo { inherit name version; sha256 = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36"; };
features = builtins.concatLists [
[ "strsim" ]
[ "suggestions" ]
];
dependencies = {
fnv = rustPackages."registry+https://github.com/rust-lang/crates.io-index".fnv."1.0.7" { inherit profileName; };
ident_case = rustPackages."registry+https://github.com/rust-lang/crates.io-index".ident_case."1.0.1" { inherit profileName; };
proc_macro2 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".proc-macro2."1.0.43" { inherit profileName; };
quote = rustPackages."registry+https://github.com/rust-lang/crates.io-index".quote."1.0.21" { inherit profileName; };
strsim = rustPackages."registry+https://github.com/rust-lang/crates.io-index".strsim."0.10.0" { inherit profileName; };
syn = rustPackages."registry+https://github.com/rust-lang/crates.io-index".syn."1.0.99" { inherit profileName; };
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling_core."0.13.4" = overridableMkRustCrate (profileName: rec {
name = "darling_core";
version = "0.13.4";
Expand All @@ -865,18 +831,6 @@ in
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling_macro."0.12.4" = overridableMkRustCrate (profileName: rec {
name = "darling_macro";
version = "0.12.4";
registry = "registry+https://github.com/rust-lang/crates.io-index";
src = fetchCratesIo { inherit name version; sha256 = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a"; };
dependencies = {
darling_core = rustPackages."registry+https://github.com/rust-lang/crates.io-index".darling_core."0.12.4" { inherit profileName; };
quote = rustPackages."registry+https://github.com/rust-lang/crates.io-index".quote."1.0.21" { inherit profileName; };
syn = rustPackages."registry+https://github.com/rust-lang/crates.io-index".syn."1.0.99" { inherit profileName; };
};
});

"registry+https://github.com/rust-lang/crates.io-index".darling_macro."0.13.4" = overridableMkRustCrate (profileName: rec {
name = "darling_macro";
version = "0.13.4";
Expand Down Expand Up @@ -1945,31 +1899,6 @@ in
};
});

"registry+https://github.com/rust-lang/crates.io-index".looking-glass."0.1.1" = overridableMkRustCrate (profileName: rec {
name = "looking-glass";
version = "0.1.1";
registry = "registry+https://github.com/rust-lang/crates.io-index";
src = fetchCratesIo { inherit name version; sha256 = "5c311ec9da7cda12221490d53fc41d89c75d834128c6ca002757f39fb7aa617e"; };
dependencies = {
bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.2.1" { inherit profileName; };
smol_str = rustPackages."registry+https://github.com/rust-lang/crates.io-index".smol_str."0.1.23" { inherit profileName; };
thiserror = rustPackages."registry+https://github.com/rust-lang/crates.io-index".thiserror."1.0.34" { inherit profileName; };
};
});

"registry+https://github.com/rust-lang/crates.io-index".looking-glass-derive."0.1.1" = overridableMkRustCrate (profileName: rec {
name = "looking-glass-derive";
version = "0.1.1";
registry = "registry+https://github.com/rust-lang/crates.io-index";
src = fetchCratesIo { inherit name version; sha256 = "72b6895088b502e0f3faab50b1a4420e9e9175c33e90a7f7361dc8077720953a"; };
dependencies = {
darling = rustPackages."registry+https://github.com/rust-lang/crates.io-index".darling."0.12.4" { inherit profileName; };
proc_macro2 = rustPackages."registry+https://github.com/rust-lang/crates.io-index".proc-macro2."1.0.43" { inherit profileName; };
quote = rustPackages."registry+https://github.com/rust-lang/crates.io-index".quote."1.0.21" { inherit profileName; };
syn = rustPackages."registry+https://github.com/rust-lang/crates.io-index".syn."1.0.99" { inherit profileName; };
};
});

"unknown".m10-bank-emulator."0.1.0" = overridableMkRustCrate (profileName: rec {
name = "m10-bank-emulator";
version = "0.1.0";
Expand All @@ -1990,7 +1919,6 @@ in
hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; };
hyper = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyper."0.14.20" { inherit profileName; };
m10_bank_emulator_protos = rustPackages."unknown".m10-bank-emulator-protos."0.1.0" { inherit profileName; };
m10_protos = rustPackages."unknown".m10-protos."0.5.0" { inherit profileName; };
m10_rds_pool = rustPackages."unknown".m10-rds-pool."0.1.0" { inherit profileName; };
m10_sdk = rustPackages."unknown".m10-sdk."0.4.0" { inherit profileName; };
oneline_eyre = rustPackages."registry+https://github.com/rust-lang/crates.io-index".oneline-eyre."0.1.0" { inherit profileName; };
Expand Down Expand Up @@ -2046,20 +1974,16 @@ in
features = builtins.concatLists [
[ "client" ]
[ "default" ]
[ "dynamic2" ]
[ "grpc" ]
[ "looking-glass" ]
[ "looking-glass-derive" ]
[ "tonic" ]
];
dependencies = {
bytes = rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.2.1" { inherit profileName; };
hex = rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; };
looking_glass = rustPackages."registry+https://github.com/rust-lang/crates.io-index".looking-glass."0.1.1" { inherit profileName; };
looking_glass_derive = buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".looking-glass-derive."0.1.1" { profileName = "__noProfile"; };
once_cell = rustPackages."registry+https://github.com/rust-lang/crates.io-index".once_cell."1.14.0" { inherit profileName; };
prost = rustPackages."registry+https://github.com/rust-lang/crates.io-index".prost."0.8.0" { inherit profileName; };
prost_types = rustPackages."registry+https://github.com/rust-lang/crates.io-index".prost-types."0.8.0" { inherit profileName; };
ring = rustPackages."registry+https://github.com/rust-lang/crates.io-index".ring."0.16.20" { inherit profileName; };
serde = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde."1.0.144" { inherit profileName; };
serde_with = rustPackages."registry+https://github.com/rust-lang/crates.io-index".serde_with."1.14.0" { inherit profileName; };
tonic = rustPackages."registry+https://github.com/rust-lang/crates.io-index".tonic."0.5.2" { inherit profileName; };
Expand Down
3 changes: 1 addition & 2 deletions examples/bank-emulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ tonic = "0.5"
uuid = { version = "0.8", features = ["serde"] }

m10-bank-emulator-protos = { path = "../../shared/rust/bank-emulator-protos", features = ["client"] }
m10-protos = { version = "0.29.11", features = ["dynamic2"] }
m10-rds-pool = { path = "../rds-pool" }
m10-sdk = "0.29.11"
m10-sdk = "0.30.0"
pala-types = { path = "../../shared/rust/pala-types" }
4 changes: 2 additions & 2 deletions examples/bank-emulator/flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
description = "m10-bank-emulator";
inputs = {
rust-overlay.url = "github:oxalica/rust-overlay?rev=50ee0fa4d0eeadd97c63be57e14b01d531e79ed7";
rust-overlay.url = "github:oxalica/rust-overlay?rev=dea24da3d3be23ab53ee80314474afd5fcb03c1c";
flake-utils.url = "github:numtide/flake-utils";
cargo2nix.url = "github:cargo2nix/cargo2nix?rev=c149357cc3d17f2849c73eb7a09d07a307cdcfe8";
nixpkgs.follows = "cargo2nix/nixpkgs";
Expand All @@ -20,7 +20,7 @@
m10-protos = import ../../nix/protos.nix { inherit pkgs; };
rust-overrides = import ../../nix/rust-overrides.nix { inherit m10-protos; };
rustPkgs = pkgs.rustBuilder.makePackageSet {
rustChannel = "1.67.0";
rustChannel = "1.71.1";
packageFun = import ./Cargo.nix;
packageOverrides = rust-overrides;
};
Expand Down
2 changes: 1 addition & 1 deletion examples/bank-emulator/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ tonic = "0.5"
tokio = { version = "1.7.0", features = ["full"] }
uuid = { version = "0.8", features = ["serde"] }
m10-bank-emulator = { path = ".." }
m10-sdk = "0.29.11"
m10-sdk = "0.30.0"
3 changes: 1 addition & 2 deletions examples/bank-emulator/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use m10_bank_emulator_protos::emulator::rtgs::{
AccountRequest, AccountType, BankRegistrationRequest, OpenAccountRequest,
RequisitionFundsRequest,
};
use m10_protos::sdk::GetBankRequest;
use m10_sdk::Signer;
use m10_sdk::{sdk::GetBankRequest, Signer};
use rust_decimal::Decimal;
use serde::Deserialize;
use sqlx::Acquire;
Expand Down
9 changes: 6 additions & 3 deletions examples/bank-emulator/src/controllers/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ use actix_web::{
web::{Data, Json, Path, Query},
HttpResponse, Scope,
};
use m10_protos::sdk::{
transaction, CreateTransfer, Deposit, GetTransferRequest, SelfTransfer, TransferStep, Withdraw,
use m10_sdk::{
sdk::{
transaction, CreateTransfer, Deposit, GetTransferRequest, SelfTransfer, SetFreezeState,
TransferStep, Withdraw,
},
LedgerClient, Metadata, Signer,
};
use m10_sdk::{sdk::SetFreezeState, LedgerClient, Metadata, Signer};
use serde_json::{json, Value};
use sqlx::Acquire;
use tracing::info;
Expand Down
2 changes: 1 addition & 1 deletion examples/bank-emulator/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl ResponseError for Error {
fn error_response(&self) -> actix_web::HttpResponse {
let mut res = actix_web::HttpResponse::new(self.status_code());
let resp = ErrorResponse::new(self);
let buf: _ = serde_json::to_vec(&resp).unwrap_or_else(|_| resp.msg.into_bytes());
let buf = serde_json::to_vec(&resp).unwrap_or_else(|_| resp.msg.into_bytes());

res.headers_mut().insert(
actix_web::http::header::CONTENT_TYPE,
Expand Down
2 changes: 1 addition & 1 deletion examples/bank-emulator/src/liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use m10_bank_emulator_protos::emulator::rtgs::{
requisition_funds_request::RequisitionType, rtgs_service_client::RtgsServiceClient,
AccountRequest, AccountType, BalanceRequest, RequisitionFundsRequest, TransferRequest,
};
use m10_protos::{sdk::Withdraw, Metadata};
use m10_sdk::{sdk::Withdraw, Metadata};
use serde_json::json;
use tonic::Request;
use tracing::info;
Expand Down
9 changes: 2 additions & 7 deletions examples/bank-emulator/src/models/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ use crate::{auth::AuthScope, error::Error};

use super::{Asset, AssetType, ContactType, NextPageToken};

#[derive(sqlx::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(sqlx::Type, Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[sqlx(rename_all = "snake_case")]
#[sqlx(type_name = "account_status")]
pub enum AccountStatus {
#[default]
Pending,
Open,
PendingClosure,
Closed,
}

impl Default for AccountStatus {
fn default() -> Self {
AccountStatus::Pending
}
}

#[derive(sqlx::FromRow, Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Account {
pub id: i64,
Expand Down
9 changes: 2 additions & 7 deletions examples/bank-emulator/src/models/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@ pub struct AssetTypeQuery {
pub r#type: Option<AssetType>,
}

#[derive(sqlx::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(sqlx::Type, Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[sqlx(rename_all = "snake_case")]
#[sqlx(type_name = "asset_type")]
pub enum AssetType {
#[default]
Regulated,
Cbdc,
IndirectCbdc,
}

impl Default for AssetType {
fn default() -> Self {
AssetType::Regulated
}
}

impl fmt::Display for AssetType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Expand Down
9 changes: 2 additions & 7 deletions examples/bank-emulator/src/models/contacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ use crate::{auth::AuthScope, error::Error};

use super::{Asset, NextPageToken};

#[derive(sqlx::Type, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[derive(sqlx::Type, Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[sqlx(rename_all = "snake_case")]
#[sqlx(type_name = "contact_type")]
pub enum ContactType {
#[default]
Individual,
LegalEntity,
}

impl Default for ContactType {
fn default() -> Self {
ContactType::Individual
}
}

#[derive(sqlx::FromRow, Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Contact {
pub id: i64,
Expand Down
2 changes: 1 addition & 1 deletion examples/bank-emulator/src/models/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;
use std::{cmp::Ordering, ops::RangeInclusive};

#[cfg(test)]
use m10_protos::sdk::TransferStep;
use m10_sdk::sdk::TransferStep;
use rust_decimal::Decimal;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use sqlx::{types::Json, Executor, Postgres};
Expand Down
9 changes: 2 additions & 7 deletions examples/bank-emulator/src/models/transfers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ use sqlx::{postgres::PgArguments, query::QueryAs, Executor, Postgres};

use crate::error::Error;

#[derive(sqlx::Type, Debug, Clone, Copy, PartialEq, Eq)]
#[derive(sqlx::Type, Default, Debug, Clone, Copy, PartialEq, Eq)]
#[sqlx(rename_all = "snake_case")]
#[sqlx(type_name = "transfer_handler")]
pub enum TransferHandler {
#[default]
CbdcLimits,
CbdcReserves,
DrcReserves,
}

impl Default for TransferHandler {
fn default() -> Self {
TransferHandler::CbdcLimits
}
}

#[derive(sqlx::FromRow, Debug, Clone)]
#[sqlx(type_name = "ledger_transfers")]
pub(crate) struct LedgerTransfer {
Expand Down
10 changes: 3 additions & 7 deletions examples/bank-emulator/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ use crate::error::Error;
use crate::models::{AssetType, TransferChain};
use crate::{context::Context, models::Payment};

use m10_protos::{
prost::Any,
sdk::{CreateTransfer, TransferStep},
MetadataExt,
};
use m10_sdk::{
account::AccountId,
contract::FinalizedContractExt,
directory::{alias, Alias},
sdk::{self, transaction_data::Data},
EnhancedTransfer, LedgerClient, Signer,
prost::Any,
sdk::{self, transaction_data::Data, CreateTransfer, TransferStep},
EnhancedTransfer, LedgerClient, MetadataExt, Signer,
};
use tracing::{error, info};
use uuid::Uuid;
Expand Down
2 changes: 1 addition & 1 deletion examples/cbdc-admin/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async-trait = "0.1"
base64 = "0.13"
config = { version = "0.11", default-features = false, features = ["toml"] }
hex = "0.4"
m10-sdk = "0.29.11"
m10-sdk = "0.30.0"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_with = "1"
Expand Down
6 changes: 4 additions & 2 deletions examples/m10_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ futures-lite = "1.11"
hex = "0.4"
hyper = "0.14"
hyper-rustls = "0.22"
m10-sdk = "0.29.11"
m10-protos = { version = "0.29.11", features = ["dynamic2"] }
libxid = { path = "../crates/libxid" }
m10-sdk = "0.30.0"
m10-protos = { version = "0.30.0", features = ["dynamic2"] }
ring = { version = "0.16", features = ["std"] }
ron = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
Expand Down
8 changes: 5 additions & 3 deletions examples/m10_cli/src/commands/batch.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use crate::context::Context;
use clap::{ArgGroup, Parser};
use m10_protos::sdk;
use m10_protos::sdk::TransactionError;
use m10_sdk::{error::M10Error, DocumentBuilder, WithContext};
use m10_sdk::{
error::M10Error,
sdk::{self, TransactionError},
DocumentBuilder, WithContext,
};
use serde::{Deserialize, Serialize};
use std::{fs::File, io::BufReader};

Expand Down
3 changes: 1 addition & 2 deletions examples/m10_cli/src/commands/convert/deserialize.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{collections::*, utils};
use clap::{Parser, Subcommand};
use m10_protos::prost::Message;
use m10_sdk::{sdk, Format, PrettyPrint};
use m10_sdk::{prost::Message, sdk, Format, PrettyPrint};
use serde::{Deserialize, Serialize};
use std::fmt::Debug;

Expand Down
Loading

0 comments on commit eb50144

Please sign in to comment.