Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 7a4400c

Browse files
bors[bot]Franck Royer
andauthored
Merge #221
221: Upgrade to cnd 0.4.0 r=mergify[bot] a=D4nte Co-authored-by: Franck Royer <franck@coblox.tech>
2 parents f33478a + e19499a commit 7a4400c

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## Changed
1010
- `separate_apps` example now uses the negotiation protocol provided by comit-sdk.
11+
- Upgrade to `comit-rs:0.4.0`
1112

1213
## [0.4.0] - 2019-11-20
1314

src/cnd_settings.rs

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ use std::net::{IpAddr, Ipv4Addr};
44

55
#[derive(Clone, Debug, Serialize, Default)]
66
pub struct Settings {
7-
pub comit: Comit,
87
pub network: Network,
9-
pub http_api: HttpSocket,
8+
pub http_api: HttpApi,
109
pub logging: Logging,
1110
pub bitcoin: Bitcoin,
1211
pub ethereum: Ethereum,
@@ -23,11 +22,42 @@ pub struct Network {
2322
pub listen: Vec<String>,
2423
}
2524
#[derive(Clone, Debug, Serialize)]
26-
pub struct HttpSocket {
25+
pub struct HttpApi {
26+
pub socket: Socket,
27+
pub cors: Cors,
28+
}
29+
30+
#[derive(Clone, Debug, Serialize)]
31+
pub struct Socket {
2732
pub address: IpAddr,
2833
pub port: u16,
2934
}
3035

36+
#[derive(Clone, Debug, Serialize)]
37+
pub struct Cors {
38+
pub allowed_origins: AllowedOrigins,
39+
}
40+
41+
#[derive(Clone, Debug, Serialize)]
42+
#[serde(untagged)]
43+
pub enum AllowedOrigins {
44+
All(All),
45+
None(None),
46+
Some(Vec<String>),
47+
}
48+
49+
#[derive(Clone, Debug, Serialize)]
50+
#[serde(rename_all = "lowercase")]
51+
pub enum All {
52+
All,
53+
}
54+
55+
#[derive(Clone, Debug, Serialize)]
56+
#[serde(rename_all = "lowercase")]
57+
pub enum None {
58+
None,
59+
}
60+
3161
#[derive(Clone, Debug, Serialize)]
3262
pub struct Logging {
3363
pub level: String,
@@ -63,15 +93,32 @@ impl Default for Network {
6393
}
6494
}
6595

66-
impl Default for HttpSocket {
67-
fn default() -> HttpSocket {
68-
HttpSocket {
96+
impl Default for HttpApi {
97+
fn default() -> HttpApi {
98+
HttpApi {
99+
socket: Socket::default(),
100+
cors: Cors::default(),
101+
}
102+
}
103+
}
104+
105+
impl Default for Socket {
106+
fn default() -> Socket {
107+
Socket {
69108
address: IpAddr::V4(Ipv4Addr::UNSPECIFIED),
70109
port: 8080,
71110
}
72111
}
73112
}
74113

114+
impl Default for Cors {
115+
fn default() -> Cors {
116+
Cors {
117+
allowed_origins: AllowedOrigins::All(All::All),
118+
}
119+
}
120+
}
121+
75122
impl Default for Logging {
76123
fn default() -> Self {
77124
Logging {

src/docker/cnd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const HTTP_URL_PREFIX: &str = "HTTP_URL_";
55
pub struct Cnd;
66

77
impl Image for Cnd {
8-
const IMAGE: &'static str = "comitnetwork/cnd:0.3.0";
8+
const IMAGE: &'static str = "comitnetwork/cnd:0.4.0";
99
const LOG_READY: &'static str = "Starting HTTP server on";
1010

1111
fn arguments_for_create() -> Vec<&'static str> {

tests/start_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "Running $0"
1212
$CCA start-env > /dev/null &
1313
PID=$!
1414

15-
TIMEOUT=60
15+
TIMEOUT=300
1616
TEST_PASSED=false
1717

1818
# Count the number of containers

0 commit comments

Comments
 (0)