github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/tests/bats/genesis.bats (about) 1 #!/usr/bin/env bats 2 3 : ${GETH_CMD:=$GOPATH/bin/geth} 4 5 setup() { 6 DATA_DIR=`mktemp -d` 7 # Default constants. 8 GENESIS_MAINNET=0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3 9 GENESIS_TESTNET=0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303 10 } 11 12 teardown() { 13 rm -fr $DATA_DIR 14 unset GENESIS_MAINNET 15 unset GENESIS_TESTNET 16 } 17 18 # Mainnet. 19 @test "defaults: genesis block hash mainnet constant @ _" { 20 run $GETH_CMD --data-dir $DATA_DIR --exec 'eth.getBlock(0).hash' console 21 echo "$output" 22 23 [ "$status" -eq 0 ] 24 [[ "$output" == *'"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"'* ]] 25 } 26 27 # Testnet. 28 @test "defaults: genesis block hash constant @ --chain=morden" { 29 run $GETH_CMD --chain=morden --data-dir $DATA_DIR --exec 'eth.getBlock(0).hash' console 30 echo "$output" 31 32 [ "$status" -eq 0 ] 33 [[ "$output" == *'"0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"'* ]] 34 } 35 36 @test "defaults: genesis block hash constant @ --chain=testnet" { 37 run $GETH_CMD --chain=testnet --data-dir $DATA_DIR --exec 'eth.getBlock(0).hash' console 38 echo "$output" 39 40 [ "$status" -eq 0 ] 41 [[ "$output" == *'"0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"'* ]] 42 } 43 44 @test "defaults: genesis block hash constant @ --testnet" { 45 run $GETH_CMD --testnet --data-dir $DATA_DIR --exec 'eth.getBlock(0).hash' console 46 echo "$output" 47 48 [ "$status" -eq 0 ] 49 [[ "$output" == *'"0x0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303"'* ]] 50 }