diff options
Diffstat (limited to 'plugin/evm/service.go')
-rw-r--r-- | plugin/evm/service.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugin/evm/service.go b/plugin/evm/service.go index 8ede1b0..6c56631 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 { @@ -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) } |