Commit 7c608d46 authored by QM's avatar QM

fix tesh.sh

parent 7b570ee2
......@@ -42,6 +42,12 @@ function down() {
docker-compose down --rmi local
fi
# shellcheck disable=SC2155
local isGanacheExit=$(docker ps | grep ganachetest)
if [[ ${isGanacheExit} != "" ]]; then
docker stop ganachetest
docker rm ganachetest
fi
}
# run script
......
......@@ -2,6 +2,7 @@ package ethinterface
import (
"context"
"errors"
"math/big"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
......@@ -24,3 +25,12 @@ type SimExtend struct {
func (sim *SimExtend) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) {
return sim.Blockchain().CurrentBlock().Header(), nil
}
func (sim *SimExtend) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
receipt, err := sim.SimulatedBackend.TransactionReceipt(ctx, txHash)
if receipt == nil {
err = errors.New("not found")
}
return receipt, err
}
......@@ -84,9 +84,9 @@ func Test_RelayOracleClaimToEthereum(t *testing.T) {
require.Nil(t, err)
assert.Equal(t, txhash, "0x6fa087c7a2a8a4421f6e269fbc6c0838e99fa59d5760155a71cd7eb1c01aafad")
//hash := "0xc0c22aa6198fdde0dbe47ddadbe449f736b82ed4a498871de5d5f4ad9ae122a0"
//status := GetEthTxStatus(sim, common.HexToHash(hash))
//fmt.Println(status)
hash := "0xc0c22aa6198fdde0dbe47ddadbe449f736b82ed4a498871de5d5f4ad9ae122a0"
status := GetEthTxStatus(sim, common.HexToHash(hash))
assert.Equal(t, status, EthTxPending.String())
_, err = revokeNonce(para.Operator)
require.Nil(t, err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment