Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware wallet signer fixes #139 #253

Merged

Conversation

stdevAlDen
Copy link
Contributor

@stdevAlDen stdevAlDen commented Nov 18, 2019

Fixes #139

Changes:

  • Remove vendor/github.com/SkycoinProject/skycoin git submodule, use it from vendors.
  • Run skywallet in travis to run integration tests against it.
  • Fix bug in GetInputs, previous cached value.
  • Add skywallet-go dependency
  • Implement signer iterator interface.
  • GetSignerUID and GetSignerDescription could return error.
  • Implement EnumerateSignServices for local/remote wallet.
  • Implement get wallet matching the first address
  • Add TestTransactionSignInputFromDevice for the hardware wallet signer.
  • Implement signer for hardware wallet.
  • Add QSigner and SignerModel models
  • Add gui to select signer in simple mode for sending

Does this change need to mentioned in CHANGELOG.md?
yes

Requires changes in protobuf specs?
no

Requires testing
yes

…let_signer

Conflicts:
	.travis.yml
	Makefile
	vendor/github.com/skycoin/hardware-wallet-go/src/skywallet/messages.go
	vendor/github.com/skycoin/hardware-wallet-go/src/skywallet/skywallet.go
	vendor/github.com/skycoin/hardware-wallet-protob/go/google/protobuf/descriptor.pb.go
	vendor/github.com/skycoin/hardware-wallet-protob/go/messages.pb.go
	vendor/github.com/skycoin/hardware-wallet-protob/go/types.pb.go
	vendor/golang.org/x/sys/windows/syscall_windows.go
	vendor/golang.org/x/sys/windows/zsyscall_windows.go
ref fibercrypto#139
@@ -812,7 +816,31 @@ func NewWalletDirectory(dirPath string) *WalletDirectory {
type WalletDirectory struct {
// Implements WallentEnv interface
WalletDir string
wltService *SkycoinLocalWallet
wltService core.PersistibleSet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stdevAlDen why this change ?

"github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/params"
"github.com/fibercrypto/fibercryptowallet/src/coin/skycoin/skytypes"
"github.com/fibercrypto/fibercryptowallet/src/core"
fce "github.com/fibercrypto/fibercryptowallet/src/errors"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fce => fcwerrors

return inputs, nil
}

func spendingOutputFromRemote(inputHash cipher.SHA256) (*readable.SpentOutput, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated . Reuse the logic in Skycoin altcoin plugin .

return
}

func readableTxn2Transaction(txn skytypes.ReadableTxn) (*coin.Transaction, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated . Reuse Skycoin altcoin plugin code .


func rawTxn2Transaction (txn skytypes.SkycoinTxn) (*coin.Transaction, error) {
buf, err := txn.EncodeSkycoinTransaction()
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens on error ?

@@ -0,0 +1,428 @@
package hardware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package name should match folder name . skywallet ?

@@ -24,6 +24,11 @@ type WalletSet interface {
SupportedWalletTypes() []string
}

type PersistibleSet interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need be renamed .

@@ -618,6 +618,10 @@ func (walletM *WalletManager) signTxn(wltIds, address []string, source string, t
logWalletManager.WithError(err).Warnf("No signer %s for wallet %v", source, wlts[0])
return nil
}
if suid, err := signer.GetSignerUID(); err != nil && wlts[0].GetId() == string(suid) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition should be err == nil , right ?

}
return false
}
// FIXME: consider a double checking here instead of hadHwConnected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this FIXME tag ? Shall this remain ?

@@ -0,0 +1,23 @@
package util
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be under skywallet contrib package ?

@olemis olemis changed the title [WIP]Hardware wallet signer ref #139 [WIP]Hardware wallet signer fixes #139 Feb 27, 2020
@olemis olemis added the skywallet SkyWallet hardware wallet label Feb 27, 2020
@stdevAlDen stdevAlDen changed the title [WIP]Hardware wallet signer fixes #139 Hardware wallet signer fixes #139 Feb 28, 2020
@olemis olemis merged commit 44dd804 into fibercrypto:develop Mar 4, 2020
FiberCrypto wallet - Iteration 1 automation moved this from In progress to Done Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qml_models QML models to connect to core interface skywallet SkyWallet hardware wallet wallet-hw Hardware wallet integration
Development

Successfully merging this pull request may close these issues.

Implement hardware wallet transaction signing strategy
3 participants