github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/tests/bats/api_eth.bats (about)

     1  #!/usr/bin/env bats
     2  
     3  # Current build.
     4  : ${GETH_CMD:=$GOPATH/bin/geth}
     5  : ${GETH_OPTS:=--datadir $BATS_TMPDIR \
     6                 		--lightkdf \
     7                 		--verbosity 0 \
     8                 		--display 0 \
     9                 		--port 33333 \
    10                 		--no-discover \
    11                 		--keystore $GOPATH/src/github.com/ethereumproject/go-ethereum/accounts/testdata/keystore \
    12                 		--unlock "f466859ead1932d743d622cb74fc058882e8648a" \
    13      }
    14  
    15  setup() {
    16  	# GETH_TMP_DATA_DIR=`mktemp -d`
    17  	# mkdir "$BATS_TMPDIR/mainnet"
    18      testacc=f466859ead1932d743d622cb74fc058882e8648a
    19  	tesetacc_pass=foobar
    20  	regex_signature_success='0x[0-9a-f]{130}'
    21  }
    22  
    23  # teardown() {
    24  # }
    25  
    26  @test "eth_sign1" {
    27  		run $GETH_CMD $GETH_OPTS \
    28  				--password=<(echo $tesetacc_pass) \
    29          --exec="eth.sign('"$testacc"', '"$d"');" console 2> /dev/null
    30  		echo "$output"
    31  		[ "$status" -eq 0 ]
    32      [[ "$output" =~ $regex_signature_success ]]
    33  }
    34  
    35  @test "eth_sign2" {
    36      run $GETH_CMD $GETH_OPTS \
    37  				--password=<(echo $tesetacc_pass) \
    38          --exec="eth.sign('"$testacc"', web3.fromAscii('Schoolbus'));" console 2> /dev/null
    39  		echo "$output"
    40  		[ "$status" -eq 0 ]
    41      [[ "$output" =~ $regex_signature_success ]]
    42  }