Skip to content

Commit

Permalink
renamed: src/hardware/ -> src/contrib/skywallet/ ref #139
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevAlDen committed Dec 9, 2019
1 parent b8fae8c commit 57940d6
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ gen-mocks: ## Generate mocks for interface types
find src/coin/mocks/ -name '*.go' -type f -print0

test-skyhw: ## Run Hardware wallet tests
go test github.com/fibercrypto/fibercryptowallet/src/hardware
go test github.com/fibercrypto/fibercryptowallet/src/contrib/skywallet

test-sky: ## Run Skycoin plugin test suite
go test -cover -timeout 30s github.com/fibercrypto/fibercryptowallet/src/coin/skycoin
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func (sw SkyWallet) ReadyForTxn(wlt core.Wallet, txn core.Transaction) (bool, er
}
_, isSkycoinWlt := wlt.(skytypes.SkycoinWallet)
if !isSkycoinWlt {
// FIXME i18n
return false, errors.New("a non Skycoin wallet received in ReadyForTxn")
}
return hwMatchWallet(sw, wlt), nil
Expand Down Expand Up @@ -217,13 +216,11 @@ func coin2Core(txn *coin.Transaction, fee uint64) (core.Transaction, error) {
func (sw *SkyWallet) signTxn(txn *coin.Transaction, idxs []int) (*coin.Transaction, error) {
transactionInputs, err := getInputs(*txn, idxs)
if err != nil {
// FIXME i18n
logSkyWallet.WithError(err).Errorln("unable to get inputs")
return nil, fce.ErrTxnSignFailure
}
transactionOutputs, err := getOutputs(*txn)
if err != nil {
// FIXME i18n
logSkyWallet.WithError(err).Errorln("unable to get outputs")
return nil, fce.ErrTxnSignFailure
}
Expand All @@ -239,15 +236,12 @@ func (sw *SkyWallet) signTxn(txn *coin.Transaction, idxs []int) (*coin.Transacti
if msg.Kind == uint16(messages.MessageType_MessageType_Failure) {
msgStr, err := skyWallet.DecodeFailMsg(msg)
if err != nil {
// FIXME i18n
logSkyWallet.WithError(err).Errorln("error decoding failed response")
return nil, fce.ErrTxnSignFailure
}
logSkyWallet.Errorln(msgStr)
// FIXME i18n
return nil, fce.ErrTxnSignFailure
}
// FIXME i18n
logSkyWallet.WithField("msgResponse", msg).Errorln("error signing transaction with hardware wallet")
return nil, fce.ErrTxnSignFailure
}
Expand Down Expand Up @@ -292,7 +286,6 @@ func (sw *SkyWallet) signTxn(txn *coin.Transaction, idxs []int) (*coin.Transacti
}
sgn, err := cipher.NewSig(buf)
if err != nil {
// FIXME i18n
logSkyWallet.WithError(err).Errorln("unable to get Skycoin address from buffer")
return nil, errors.New("unable to get Skycoin address from buffer")
}
Expand Down Expand Up @@ -344,12 +337,11 @@ func (sw SkyWallet) SignTransaction(txn core.Transaction, pr core.PasswordReader
return txn, err
}
if isFullySigned {
// FIXME i18n or named var, this should be used in tests assertions too
// TODO named var, this should be used in tests assertions too
return nil, errors.New("Transaction is fully signed")
}
idxs, err := util.StrSlice2IntSlice(indexes)
if err != nil {
// FIXME i18n
logSkyWallet.WithError(err).Errorln("unable to get indexes slice as int slice")
return nil, fce.ErrTxnSignFailure
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"github.com/fibercrypto/fibercryptowallet/src/core"
fce "github.com/fibercrypto/fibercryptowallet/src/errors"
"github.com/fibercrypto/fibercryptowallet/src/hardware/mocks"
"github.com/fibercrypto/fibercryptowallet/src/contrib/skywallet/mocks"
"github.com/fibercrypto/skywallet-go/src/skywallet"
"github.com/fibercrypto/skywallet-go/src/skywallet/wire"
"github.com/gogo/protobuf/proto"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/models/walletsModel.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

import (
"github.com/fibercrypto/fibercryptowallet/src/hardware"
hardware "github.com/fibercrypto/fibercryptowallet/src/contrib/skywallet"
"github.com/fibercrypto/fibercryptowallet/src/util/logging"
"github.com/fibercrypto/skywallet-go/src/skywallet/wire"
"github.com/therecipe/qt/core"
Expand Down

0 comments on commit 57940d6

Please sign in to comment.