Skip to content

Commit

Permalink
Add env values to Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamaguchi committed Jun 23, 2024
1 parent 84d7882 commit 57f5a6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
runs-on: ${{ matrix.os }}
env:
RUST_LOG: tapyrusd=debug
NETWORK_ID: 1905960821
PRIVATE_KEY: cUJN5RVzYWFoeY8rUztd47jzXCu1p57Ay8V7pqCzsBD3PEXN7Dd4
GENESIS_BLOCK: 0100000000000000000000000000000000000000000000000000000000000000000000002b5331139c6bc8646bb4e5737c51378133f70b9712b75548cb3c05f9188670e7440d295e7300c5640730c4634402a3e66fb5d921f76b48d8972a484cc0361e66ef74f45e012103af80b90d25145da28c583359beb47b21796b2fe1a23c1511e443e7a64dfdb27d40e05f064662d6b9acf65ae416379d82e11a9b78cdeb3a316d1057cd2780e3727f70a61f901d10acbe349cd11e04aa6b4351e782c44670aefbe138e99a5ce75ace01010000000100000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a010000001976a91445d405b9ed450fec89044f9b7a99a4ef6fe2cd3f88ac00000000
strategy:
fail-fast: false
matrix:
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,18 @@ impl Default for Conf<'_> {
}
}

fn get_network_id() -> String {
pub fn get_network_id() -> String {
std::env::var("NETWORK_ID").expect("NETWORK_ID must be set")
}

fn get_genesis_block() -> String {
pub fn get_genesis_block() -> String {
std::env::var("GENESIS_BLOCK").expect("GENESIS_BLOCK must be set")
}

pub fn get_private_key() -> String {
std::env::var("PRIVATE_KEY").expect("PRIVATE_KEY must be set")
}

impl TapyrusD {
/// Launch the tapyrusd process from the given `exe` executable with default args.
///
Expand Down Expand Up @@ -587,10 +591,6 @@ mod test {
use tapyruscore_rpc::RpcApi;
use tempfile::TempDir;

fn get_private_key() -> String {
std::env::var("PRIVATE_KEY").expect("PRIVATE_KEY must be set")
}

#[test]
fn test_local_ip() {
assert_eq!("127.0.0.1", format!("{}", LOCAL_IP));
Expand Down

0 comments on commit 57f5a6c

Please sign in to comment.