forked from cerc-io/laconicd-deprecated
update web3 transaction hash from RLP (#250)
* remove ethereum hash of web3 transaction type (always amino hash) * Update changelog
This commit is contained in:
@@ -198,18 +198,6 @@ func (msg *MsgEthereumTx) DecodeRLP(s *rlp.Stream) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Hash hashes the RLP encoding of a transaction.
|
||||
func (msg *MsgEthereumTx) Hash() ethcmn.Hash {
|
||||
if hash := msg.hash.Load(); hash != nil {
|
||||
return hash.(ethcmn.Hash)
|
||||
}
|
||||
|
||||
v := rlpHash(msg)
|
||||
msg.hash.Store(v)
|
||||
|
||||
return v
|
||||
}
|
||||
|
||||
// Sign calculates a secp256k1 ECDSA signature and signs the transaction. It
|
||||
// takes a private key and chainID to sign an Ethereum transaction according to
|
||||
// EIP155 standard. It mutates the transaction as it populates the V, R, S
|
||||
|
||||
@@ -89,14 +89,6 @@ func TestMsgEthereumTxRLPDecode(t *testing.T) {
|
||||
require.Equal(t, expectedMsg.Data, msg.Data)
|
||||
}
|
||||
|
||||
func TestMsgEthereumTxHash(t *testing.T) {
|
||||
addr := ethcmn.BytesToAddress([]byte("test_address"))
|
||||
msg := NewMsgEthereumTx(0, &addr, nil, 100000, nil, []byte("test"))
|
||||
|
||||
hash := msg.Hash()
|
||||
require.Equal(t, "E2AA2E68E7586AE9700F1D3D643330866B6AC2B6CA4C804F7C85ECB11D0B0B29", fmt.Sprintf("%X", hash))
|
||||
}
|
||||
|
||||
func TestMsgEthereumTxSig(t *testing.T) {
|
||||
chainID := big.NewInt(3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user