-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
239 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
lockbox = "http://0.0.0.0:18080" | ||
network = "testnet" | ||
lockheight_init = 1000 | ||
lh_decrement = 10 | ||
connection_string = "postgresql://postgres:postgres@localhost/mercury" | ||
batch_timeout = 120 # seconds | ||
batch_timeout = 120 # seconds | ||
|
||
[[enclaves]] | ||
url = "http://0.0.0.0:18080" | ||
allow_deposit = true | ||
|
||
[[enclaves]] | ||
url = "http://0.0.0.0:18080" | ||
allow_deposit = false | ||
|
||
[[enclaves]] | ||
url = "http://0.0.0.0:18080" | ||
allow_deposit = true | ||
|
||
[[enclaves]] | ||
url = "http://0.0.0.0:18080" | ||
allow_deposit = true | ||
|
||
[[enclaves]] | ||
url = "http://0.0.0.0:18080" | ||
allow_deposit = true | ||
|
||
# env var: ENCLAVES='[{"url": "http://0.0.0.0:18080", "allow_deposit": true}, {"url": "http://0.0.0.0:18080", "allow_deposit": false}]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ pub mod transfer_sender; | |
pub mod transfer_receiver; | ||
pub mod transfer; | ||
pub mod deposit; | ||
pub mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use sqlx::Row; | ||
|
||
pub async fn get_enclave_index_from_database(pool: &sqlx::PgPool, statechain_id: &str) -> Option<i32> { | ||
|
||
let query = "SELECT enclave_index \ | ||
FROM statechain_data \ | ||
WHERE statechain_id = $1"; | ||
|
||
let row = sqlx::query(query) | ||
.bind(statechain_id) | ||
.fetch_optional(pool) | ||
.await | ||
.unwrap(); | ||
|
||
if row.is_none() { | ||
return None; | ||
} | ||
|
||
let row = row.unwrap(); | ||
|
||
let enclave_index: i32 = row.get("enclave_index"); | ||
|
||
Some(enclave_index) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.