Use chain aware signer in simulated backend

This commit is contained in:
Dmitry Shulyak 2018-04-07 22:16:04 +03:00 committed by Dmitry Shulyak
parent 3f2e39d525
commit 38d7194a2a
2 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,14 @@
diff --git i/accounts/abi/bind/backends/simulated.go w/accounts/abi/bind/backends/simulated.go
index bd342a8cb..2ce30e2fa 100644
--- i/accounts/abi/bind/backends/simulated.go
+++ w/accounts/abi/bind/backends/simulated.go
@@ -295,8 +295,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error {
b.mu.Lock()
defer b.mu.Unlock()
-
- sender, err := types.Sender(types.HomesteadSigner{}, tx)
+ sender, err := types.Sender(types.NewEIP155Signer(tx.ChainId()), tx)
if err != nil {
panic(fmt.Errorf("invalid transaction: %v", err))
}

View File

@ -295,8 +295,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error {
b.mu.Lock()
defer b.mu.Unlock()
sender, err := types.Sender(types.HomesteadSigner{}, tx)
sender, err := types.Sender(types.NewEIP155Signer(tx.ChainId()), tx)
if err != nil {
panic(fmt.Errorf("invalid transaction: %v", err))
}