diff options
author | Determinant <[email protected]> | 2020-08-20 02:21:57 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-08-20 02:21:57 -0400 |
commit | b3fb1dc6ed3c5610c03abdd6f2ff7bf164fb83ca (patch) | |
tree | fd8de359333b11f9178b05b054c9bbd3380bd903 /plugin/evm/vm.go | |
parent | a054d19f05a31a0421d6fe1bc534da46921481d5 (diff) |
add flow check for ExportTx
Diffstat (limited to 'plugin/evm/vm.go')
-rw-r--r-- | plugin/evm/vm.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/evm/vm.go b/plugin/evm/vm.go index 8823380..98ecb6f 100644 --- a/plugin/evm/vm.go +++ b/plugin/evm/vm.go @@ -175,6 +175,7 @@ func (vm *VM) getAtomicTx(block *types.Block) *Tx { panic(err) } } + atx.Sign(vm.codec, nil) return atx } @@ -719,8 +720,12 @@ func (vm *VM) GetAtomicUTXOs( } func GetEthAddress(privKey *crypto.PrivateKeySECP256K1R) common.Address { + return PublicKeyToEthAddress(privKey.PublicKey()) +} + +func PublicKeyToEthAddress(pubKey crypto.PublicKey) common.Address { return ethcrypto.PubkeyToAddress( - (*privKey.PublicKey().(*crypto.PublicKeySECP256K1R).ToECDSA())) + (*pubKey.(*crypto.PublicKeySECP256K1R).ToECDSA())) } func (vm *VM) GetSpendableCanonical(keys []*crypto.PrivateKeySECP256K1R, amount uint64) ([]EVMInput, [][]*crypto.PrivateKeySECP256K1R, error) { |