aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/service.go
diff options
context:
space:
mode:
authorStephen Buttolph <stephen@avalabs.org>2020-10-08 21:09:53 -0400
committerGitHub <noreply@github.com>2020-10-08 21:09:53 -0400
commit8a8ef56dd1a0f2cd28c6d4b3a579b16cdda6e2cf (patch)
tree6411831faacdf02265fa5847a06613875afbb833 /plugin/evm/service.go
parent8cc21e15b96ccbe246bb06bece08c22df786069d (diff)
parent1ff4b686e32eec9c04a8e93c879e4852f41da3f4 (diff)
Merge pull request #42 from ava-labs/v1.0.2-rc.1-bumpv0.3.5
V1.0.2 rc.1 bump
Diffstat (limited to 'plugin/evm/service.go')
-rw-r--r--plugin/evm/service.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugin/evm/service.go b/plugin/evm/service.go
index 8ede1b0..a844f10 100644
--- a/plugin/evm/service.go
+++ b/plugin/evm/service.go
@@ -151,7 +151,7 @@ type ExportKeyReply struct {
func (service *AvaxAPI) ExportKey(r *http.Request, args *ExportKeyArgs, reply *ExportKeyReply) error {
log.Info("EVM: ExportKey called")
- address, err := service.vm.ParseEthAddress(args.Address)
+ address, err := ParseEthAddress(args.Address)
if err != nil {
return fmt.Errorf("couldn't parse %s to address: %s", args.Address, err)
}
@@ -200,10 +200,7 @@ func (service *AvaxAPI) ImportKey(r *http.Request, args *ImportKeyArgs, reply *a
sk := skIntf.(*crypto.PrivateKeySECP256K1R)
// TODO: return eth address here
- reply.Address, err = service.vm.FormatEthAddress(GetEthAddress(sk))
- if err != nil {
- return fmt.Errorf("problem formatting address: %w", err)
- }
+ reply.Address = FormatEthAddress(GetEthAddress(sk))
db, err := service.vm.ctx.Keystore.GetDatabase(args.Username, args.Password)
if err != nil {
@@ -234,7 +231,7 @@ func (service *AvaxAPI) ImportAVAX(_ *http.Request, args *ImportArgs, response *
return service.Import(nil, args, response)
}
-// ImportAVAX issues a transaction to import AVAX from the X-chain. The AVAX
+// Import issues a transaction to import AVAX from the X-chain. The AVAX
// must have already been exported from the X-Chain.
func (service *AvaxAPI) Import(_ *http.Request, args *ImportArgs, response *api.JsonTxID) error {
log.Info("EVM: ImportAVAX called")
@@ -244,7 +241,7 @@ func (service *AvaxAPI) Import(_ *http.Request, args *ImportArgs, response *api.
return fmt.Errorf("problem parsing chainID %q: %w", args.SourceChain, err)
}
- to, err := service.vm.ParseEthAddress(args.To)
+ to, err := ParseEthAddress(args.To)
if err != nil { // Parse address
return fmt.Errorf("couldn't parse argument 'to' to an address: %w", err)
}