func EncodeRlp(t *types.Transaction) []byte {
	return rlp.Encode([]interface{}{
		rlp.EncodeUint64ToBytes(t.Nonce),
		t.GasPrice.Bytes(),
		rlp.EncodeUint64ToBytes(t.GasLimit),
		utils.Hex2Bytes(t.To[2:]),
		t.Value.Bytes(),
		t.Data,
		t.Signature[64:],
		t.Signature[0:32],
		t.Signature[32:64],
	})
}
EncodeRlp returns the rlp encoded content of a signed transaction
package signer
import (
	"crypto/ecdsa"
	"github.com/HydroProtocol/hydro-sdk-backend/sdk/crypto"
	"github.com/HydroProtocol/hydro-sdk-backend/sdk/rlp"
	"github.com/HydroProtocol/hydro-sdk-backend/sdk/types"
	"github.com/HydroProtocol/hydro-sdk-backend/utils"
)
func HomesteadHash(t *types.Transaction) []byte {
	rlpTx := rlp.Encode([]interface{}{
		rlp.EncodeUint64ToBytes(t.Nonce),
		t.GasPrice.Bytes(),
		rlp.EncodeUint64ToBytes(t.GasLimit),
		utils.Hex2Bytes(t.To[2:]),
		t.Value.Bytes(),
		t.Data,
	})
	hash := crypto.Keccak256(rlpTx)
	return hash
}