From a725a6a16c53f508681484e36729ebe65a5b33b1 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Tue, 22 Sep 2020 16:45:12 -0400 Subject: Add test for ExportTx Verify --- plugin/evm/service.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'plugin/evm/service.go') 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) } -- cgit v1.2.3