// Store the given chain as the blocks for the `network` and set the
// network's genesis block to the hash of `GENESIS_BLOCK`
Store the given chain as the blocks for the `network` and set the
network's genesis block to the hash of `GENESIS_BLOCK`
Store the given chain as the blocks for the ` network ` and set the network ' s genesis block to the hash of ` GENESIS_BLOCK `
pub fn insert(chain: Chain, network: &str) {
        let url = super::postgres_test_url();
        let conn = PgConnection::establish(url.as_str()).expect("Failed to connect to Postgres");
        use db_schema::ethereum_networks as n;
        let hash = format!("{:x}", super::GENESIS_PTR.hash);
        diesel::insert_into(n::table)
            .values((
                &n::name.eq(network),
                &n::genesis_block_hash.eq(&hash),
                &n::net_version.eq(super::NETWORK_VERSION),
            ))
            .execute(&conn)
            .expect("Failed to insert test network");
        for block in chain {
            block.insert(&conn);
        }
    }
pub fn insert ( chain : Chain , network : & str ) { let url = super :: postgres_test_url ( ) ; let conn = PgConnection :: establish ( url . as_str ( ) ) . expect ( " " ) ; use db_schema :: ethereum_networks as n ; let hash = format ! ( " " super GENESIS_PTR hash ) ; diesel :: insert_into ( n :: table ) . values ( ( & n :: name . eq ( network ) , & n :: genesis_block_hash . eq ( & hash ) , & n :: net_version . eq ( super :: NETWORK_VERSION ) , ) ) . execute ( & conn ) . expect ( " " ) ; for block in chain { block . insert ( & conn ) ; } }
Store the given chain as the blocks for the `network` and set the
network's genesis block to the hash of `GENESIS_BLOCK`
Store the given chain as the blocks for the ` network ` and set the network ' s genesis block to the hash of ` GENESIS_BLOCK `
chain
Chain
network
&str