Skip to content
Permalink
Browse files

refactor: renamed interledger-store crate in prep for new stores

  • Loading branch information
bstrie committed Nov 22, 2019
1 parent 3fe4273 commit 9e6d239cc8e2281196a3eda92952dfb501d3c7d4
Showing with 40 additions and 37 deletions.
  1. +2 −2 Cargo.lock
  2. +1 −1 Cargo.toml
  3. +1 −0 crates/ilp-node/Cargo.toml
  4. +5 −1 crates/ilp-node/src/node.rs
  5. +1 −1 crates/ilp-node/tests/test_helpers.rs
  6. +0 −12 crates/interledger-store-redis/src/lib.rs
  7. +3 −3 crates/{interledger-store-redis → interledger-store}/Cargo.toml
  8. 0 crates/{interledger-store-redis → interledger-store}/README.md
  9. BIN crates/{interledger-store-redis → interledger-store}/external/libredis_cell.dylib
  10. BIN crates/{interledger-store-redis → interledger-store}/external/libredis_cell.so
  11. 0 crates/{interledger-store-redis → interledger-store}/redis-example.conf
  12. 0 crates/{interledger-store-redis → interledger-store}/src/account.rs
  13. 0 crates/{interledger-store-redis → interledger-store}/src/crypto.rs
  14. +7 −0 crates/interledger-store/src/lib.rs
  15. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/account_from_username.lua
  16. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/load_accounts.lua
  17. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/process_fulfill.lua
  18. 0 ...s/{interledger-store-redis/src → interledger-store/src/redis}/lua/process_incoming_settlement.lua
  19. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/process_prepare.lua
  20. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/process_reject.lua
  21. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/lua/refund_settlement.lua
  22. +3 −3 crates/{interledger-store-redis/src/store.rs → interledger-store/src/redis/mod.rs}
  23. 0 crates/{interledger-store-redis/src → interledger-store/src/redis}/reconnect.rs
  24. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/accounts_test.rs
  25. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/balances_test.rs
  26. 0 crates/{interledger-store-redis → interledger-store}/tests/btp_test.rs
  27. 0 crates/{interledger-store-redis → interledger-store}/tests/common/fixtures.rs
  28. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/common/mod.rs
  29. 0 crates/{interledger-store-redis → interledger-store}/tests/common/redis_helpers.rs
  30. +4 −1 crates/{interledger-store-redis → interledger-store}/tests/common/store_helpers.rs
  31. 0 crates/{interledger-store-redis → interledger-store}/tests/http_test.rs
  32. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/rate_limiting_test.rs
  33. 0 crates/{interledger-store-redis → interledger-store}/tests/rates_test.rs
  34. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/routing_test.rs
  35. +1 −1 crates/{interledger-store-redis → interledger-store}/tests/settlement_test.rs
  36. +3 −3 crates/interledger/Cargo.toml
  37. +3 −3 crates/interledger/src/lib.rs
  38. +1 −1 docker/redis.conf

Some generated files are not rendered by default. Learn more.

@@ -15,6 +15,6 @@ members = [
"./crates/interledger-service-util",
"./crates/interledger-settlement",
"./crates/interledger-spsp",
"./crates/interledger-store-redis",
"./crates/interledger-store",
"./crates/interledger-stream",
]
@@ -26,6 +26,7 @@ lazy_static = { version = "1.4.0", default-features = false }
metrics = { version = "0.12.0", default-features = false, features = ["std"] }
metrics-core = { version = "0.5.1", default-features = false }
metrics-runtime = { version = "0.12.0", default-features = false, features = ["metrics-observer-prometheus"] }
redis = { version = "0.13.0", default-features = false, features = ["executor"] }
ring = { version = "0.16.9", default-features = false }
serde = { version = "1.0.101", default-features = false }
tokio = { version = "0.1.22", default-features = false }
@@ -33,12 +33,16 @@ use interledger::{
MaxPacketAmountService, RateLimitService, ValidatorService,
},
settlement::api::{create_settlements_filter, SettlementMessageService},
store_redis::{Account, AccountId, ConnectionInfo, IntoConnectionInfo, RedisStoreBuilder},
store::{
account::{Account, AccountId},
redis::RedisStoreBuilder,
},
stream::StreamReceiverService,
};
use lazy_static::lazy_static;
use metrics_core::{Builder, Drain, Observe};
use metrics_runtime;
use redis::{ConnectionInfo, IntoConnectionInfo};
use ring::hmac;
use serde::{de::Error as DeserializeError, Deserialize, Deserializer};
use std::{convert::TryFrom, net::SocketAddr, str, str::FromStr, time::Duration};
@@ -4,7 +4,7 @@ use interledger::stream::StreamDelivery;
use interledger::{
packet::Address,
service::Account as AccountTrait,
store_redis::{Account, AccountId},
store::account::{Account, AccountId},
};
use ring::rand::{SecureRandom, SystemRandom};
use serde::Serialize;

This file was deleted.

@@ -1,14 +1,14 @@
[package]
name = "interledger-store-redis"
name = "interledger-store"
version = "0.4.0"
authors = ["Evan Schwartz <evan@ripple.com>"]
description = "Data store for Interledger.js using Redis"
description = "Data stores for Interledger.rs"
license = "Apache-2.0"
edition = "2018"
repository = "https://github.com/interledger-rs/interledger-rs"

[lib]
name = "interledger_store_redis"
name = "interledger_store"
path = "src/lib.rs"

[dependencies]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,7 @@
//! # interledger-store
//!
//! Backend databases for storing account details, balances, the routing table, etc.

pub mod account;
pub mod crypto;
pub mod redis;
@@ -14,10 +14,11 @@
// smembers <key> list the members of a set
// get <key> get the value of a key
// hgetall <key> the flattened list of every key/value entry within a hash
mod reconnect;
use reconnect::RedisReconnect;

use super::account::*;
use super::account::{Account, AccountId, AccountWithEncryptedTokens};
use super::crypto::{encrypt_token, generate_keys, DecryptionKey, EncryptionKey};
use super::reconnect::RedisReconnect;
use bytes::Bytes;
use futures::{
future::{err, ok, result, Either},
@@ -27,7 +28,6 @@ use futures::{
use log::{debug, error, trace, warn};
use std::collections::{HashMap, HashSet};

use super::account::AccountId;
use http::StatusCode;
use interledger_api::{AccountDetails, AccountSettings, EncryptedAccountSettings, NodeStore};
use interledger_btp::BtpStore;
@@ -11,7 +11,7 @@ use interledger_packet::Address;
use interledger_service::Account as AccountTrait;
use interledger_service::{AccountStore, AddressStore, Username};
use interledger_service_util::BalanceStore;
use interledger_store_redis::AccountId;
use interledger_store::account::AccountId;
use log::{debug, error};
use redis::Client;
use secrecy::SecretString;
@@ -9,7 +9,7 @@ use interledger_service_util::BalanceStore;
use std::str::FromStr;

use interledger_service::{Account as AccountTrait, AddressStore};
use interledger_store_redis::AccountId;
use interledger_store::account::{Account, AccountId};

#[test]
fn get_balance() {
File renamed without changes.
@@ -4,6 +4,6 @@ mod store_helpers;

pub use fixtures::*;
pub use futures::Future;
pub use interledger_store_redis::*;
pub use interledger_store::redis::*;
pub use redis_helpers::*;
pub use store_helpers::*;
@@ -5,7 +5,10 @@ use futures::Future;
use interledger_api::NodeStore;
use interledger_packet::Address;
use interledger_service::{Account as AccountTrait, AddressStore};
use interledger_store_redis::{Account, RedisStore, RedisStoreBuilder};
use interledger_store::{
account::Account,
redis::{RedisStore, RedisStoreBuilder},
};
use lazy_static::lazy_static;
use parking_lot::Mutex;
use std::str::FromStr;
File renamed without changes.
@@ -3,7 +3,7 @@ use common::*;
use futures::future::join_all;
use interledger_service::AddressStore;
use interledger_service_util::{RateLimitError, RateLimitStore};
use interledger_store_redis::AccountId;
use interledger_store::account::{Account, AccountId};

#[test]
fn rate_limits_number_of_packets() {
@@ -6,7 +6,7 @@ use interledger_ccp::RouteManagerStore;
use interledger_packet::Address;
use interledger_router::RouterStore;
use interledger_service::{Account as AccountTrait, AddressStore, Username};
use interledger_store_redis::AccountId;
use interledger_store::account::{Account, AccountId};
use std::str::FromStr;
use std::{collections::HashMap, time::Duration};
use tokio_timer::sleep;
@@ -11,7 +11,7 @@ use interledger_settlement::core::{
idempotency::{IdempotentData, IdempotentStore},
types::{LeftoversStore, SettlementAccount, SettlementStore},
};
use interledger_store_redis::AccountId;
use interledger_store::account::AccountId;
use lazy_static::lazy_static;
use num_bigint::BigUint;
use redis::{aio::SharedConnection, cmd};
@@ -19,7 +19,7 @@ node = [
"service-util",
"settlement",
"spsp",
"store-redis",
"store",
"stream",
"trace",
]
@@ -32,7 +32,7 @@ router = ["interledger-router"]
service-util = ["interledger-service-util"]
settlement = ["interledger-settlement" ]
spsp = ["interledger-spsp", "stream"]
store-redis = ["interledger-store-redis"]
store = ["interledger-store"]
stream = ["interledger-stream", "ildcp"]
trace = ["interledger-service/trace"]

@@ -49,7 +49,7 @@ interledger-service-util = { path = "../interledger-service-util", version = "^0
interledger-settlement = { path = "../interledger-settlement", version = "^0.3.0", optional = true, default-features = false }
interledger-spsp = { path = "../interledger-spsp", version = "^0.4.0", optional = true, default-features = false }
interledger-stream = { path = "../interledger-stream", version = "^0.4.0", optional = true, default-features = false }
interledger-store-redis = { path = "../interledger-store-redis", version = "^0.4.0", optional = true, default-features = false }
interledger-store = { path = "../interledger-store", version = "^0.4.0", optional = true, default-features = false }

[badges]
circle-ci = { repository = "interledger-rs/interledger-rs" }
@@ -115,9 +115,9 @@ pub mod spsp {
}

/// Store implementation backed by Redis
#[cfg(feature = "store-redis")]
pub mod store_redis {
pub use interledger_store_redis::*;
#[cfg(feature = "store")]
pub mod store {
pub use interledger_store::*;
}

/// STREAM Protocol sender and receiver
@@ -15,6 +15,6 @@ appendonly yes
appendfsync everysec

# Load redis-cell module, which is used for rate limiting
loadmodule ./interledger-store-redis/external/libredis_cell.so
loadmodule ./interledger-store/external/libredis_cell.so

daemonize yes

0 comments on commit 9e6d239

Please sign in to comment.
You can’t perform that action at this time.