diff --git a/.golangci.yml b/.golangci.yml index 9c98528..cdf46a5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -136,7 +136,7 @@ linters-settings: range-loops: true # Report preallocation suggestions on range loops, true by default for-loops: false # Report preallocation suggestions on for loops, false by default goimports: - local-prefixes: github.com/skycoin/hardware-wallet-go + local-prefixes: github.com/fibercrypto/skywallet-go linters: diff --git a/.travis.yml b/.travis.yml index 547fde8..a3d62dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,9 @@ before_install: - source ./ci-scripts/install-$TRAVIS_OS_NAME.sh install: - - if [[ ! -d $GOPATH/src/github.com/skycoin/hardware-wallet-go ]]; then mkdir -p $GOPATH/src/github.com/skycoin; ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/skycoin/hardware-wallet-go; fi + - if [[ ! -d $GOPATH/src/github.com/fibercrypto/skywallet-go ]]; then mkdir -p $GOPATH/src/github.com/skycoin; ln -s $TRAVIS_BUILD_DIR $GOPATH/src/github.com/fibercrypto/skywallet-go; fi - go get github.com/vektra/mockery/.../ - - cd $GOPATH/src/github.com/skycoin/hardware-wallet-go + - cd $GOPATH/src/github.com/fibercrypto/skywallet-go - make mocks - make install-linters - make lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 527b730..4c3fa11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed ### Changed +- Change `protobuf` file definitions from http://github.com/skycoin/hardware-wallet-protob.git to http://github.com/fibercrypto/skywallet-go.git ### Removed @@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +- Add flag `walletType` for `addressGen`, `signMessage` and `transactionSign`. - Add travis CD instructions for github releases. - Add BitEncodedFlags to encode/decode flags from/to a string. - Add remove PIN code. diff --git a/Gopkg.lock b/Gopkg.lock index 839761d..3936fe4 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -1,6 +1,14 @@ # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. +[[projects]] + digest = "1:7cb4fdca4c251b3ef8027c90ea35f70c7b661a593b9eeae34753c65499098bb1" + name = "github.com/cpuguy83/go-md2man" + packages = ["md2man"] + pruneopts = "UT" + revision = "7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19" + version = "v1.0.10" + [[projects]] digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" @@ -10,12 +18,23 @@ version = "v1.1.1" [[projects]] - digest = "1:48092bf6632f55839850666c33469f546f6d45fdbd59a66759ec12e84d853dc2" + branch = "develop" + digest = "1:ec1a1f7bbfba1362708324d1b7aff4153086c837cdfe13eabd241a4cc9bac44d" + name = "github.com/fibercrypto/skywallet-protob" + packages = [ + "go", + "go/google/protobuf", + ] + pruneopts = "UT" + revision = "8ce918b0c1c3d7e3d315ee19e2d097ea4ee78838" + +[[projects]] + digest = "1:4caab6f14c6b9654ccb7d398791d1f71a2d4e693ea508d29659a173e1b2e644a" name = "github.com/gogo/protobuf" packages = ["proto"] pruneopts = "UT" - revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" - version = "v1.2.1" + revision = "5628607bb4c51c3157aacc3a50f0ab707582b805" + version = "v1.3.1" [[projects]] digest = "1:31e761d97c76151dde79e9d28964a812c46efc5baee4085b86f68f0c654450de" @@ -26,20 +45,20 @@ version = "v1.0.2" [[projects]] - digest = "1:7c084e0e780596dd2a7e20d25803909a9a43689c153de953520dfbc0b0e51166" + digest = "1:4a29eeb25603debe8f2098a9902c4d3851034cf70d33be428826e86e8c30a1b0" name = "github.com/mattn/go-colorable" packages = ["."] pruneopts = "UT" - revision = "8029fb3788e5a4a9c00e415f586a6d033f5d38b3" - version = "v0.1.2" + revision = "98ec13f34aabf44cc914c65a1cfb7b9bc815aef1" + version = "v0.1.4" [[projects]] - digest = "1:9b90c7639a41697f3d4ad12d7d67dfacc9a7a4a6e0bbfae4fc72d0da57c28871" + digest = "1:d62282425ffb75047679d7e2c3b980eea7f82c05ef5fb9142ee617ebac6e7432" name = "github.com/mattn/go-isatty" packages = ["."] pruneopts = "UT" - revision = "1311e847b0cb909da63b5fecfb5370aa66236465" - version = "v0.0.8" + revision = "88ba11cfdc67c7588b30042edf244b2875f892b6" + version = "v0.0.10" [[projects]] branch = "master" @@ -57,6 +76,14 @@ revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" +[[projects]] + digest = "1:b36a0ede02c4c2aef7df7f91cbbb7bb88a98b5d253509d4f997dda526e50c88c" + name = "github.com/russross/blackfriday" + packages = ["."] + pruneopts = "UT" + revision = "05f3235734ad95d0016f6a23902f06461fcf567a" + version = "v1.5.2" + [[projects]] digest = "1:04457f9f6f3ffc5fea48e71d62f2ca256637dee0a04d710288e27e05c8b41976" name = "github.com/sirupsen/logrus" @@ -65,16 +92,6 @@ revision = "839c75faf7f98a33d445d181f3018b5c3409a45e" version = "v1.4.2" -[[projects]] - digest = "1:c6d4676e48550d1af188ed2c0d844ec9d31432277080c3ea33126ad7ceeb1421" - name = "github.com/skycoin/hardware-wallet-protob" - packages = [ - "go", - "go/google/protobuf", - ] - pruneopts = "UT" - revision = "bd9f95c53447f97ac56f24a415c25d04680552de" - [[projects]] branch = "develop" digest = "1:738ae44a75f643024f215f9b5c3c79f46c72f4327dc2fbeaec7ed92d7443f207" @@ -88,7 +105,7 @@ "src/util/logging", ] pruneopts = "UT" - revision = "94955dd52540845631475ecb7b87916fc820f233" + revision = "d7e4b2f3e31ea96bdcaba595507fde42baa156b9" [[projects]] digest = "1:ac83cf90d08b63ad5f7e020ef480d319ae890c208f8524622a2f3136e2686b02" @@ -99,7 +116,7 @@ version = "v0.1.1" [[projects]] - digest = "1:288e2ba4192b77ec619875ab54d82e2179ca8978e8baa690dcb4343a4a1f4da7" + digest = "1:d88ba57c4e8f5db6ce9ab6605a89f4542ee751b576884ba5271c2ba3d4b6f2d2" name = "github.com/stretchr/testify" packages = [ "assert", @@ -108,16 +125,16 @@ "suite", ] pruneopts = "UT" - revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" - version = "v1.3.0" + revision = "221dbe5ed46703ee255b1da0dec05086f5035f62" + version = "v1.4.0" [[projects]] - digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" + digest = "1:1d3ef3dd057d2eb1819e945f88cc83835296c9b7fb13ad3194c937c4e2891fee" name = "github.com/urfave/cli" packages = ["."] pruneopts = "UT" - revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" - version = "v1.20.0" + revision = "bfe2e925cfb6d44b40ad3a779165ea7e8aff9212" + version = "v1.22.0" [[projects]] branch = "master" @@ -125,25 +142,33 @@ name = "golang.org/x/crypto" packages = ["ssh/terminal"] pruneopts = "UT" - revision = "4def268fd1a49955bfb3dda92fe3db4f924f2285" + revision = "e1110fd1c708ef015366ea01799a23c459593c47" [[projects]] branch = "master" - digest = "1:f99b0e9035cf86cdc14cb2848308e831193d5e19ab9a23a8493cd925bdc3952b" + digest = "1:a8d09768b9b35851f498a4ba24ef08b7a72aa29bdb1673324394443e076bb440" name = "golang.org/x/sys" packages = [ "unix", "windows", ] pruneopts = "UT" - revision = "fc99dfbffb4e5ed5758a37e31dd861afe285406b" + revision = "4c7a9d0fe056d9d1de37e1409ca8a5c17accb46a" + +[[projects]] + digest = "1:f26a5d382387e03a40d1471dddfba85dfff9bf05352d7e42d37612677c4d3c5c" + name = "gopkg.in/yaml.v2" + packages = ["."] + pruneopts = "UT" + revision = "f90ceb4f409096b60e2e9076b38b304b8246e5fa" + version = "v2.2.5" [solve-meta] analyzer-name = "dep" analyzer-version = 1 input-imports = [ + "github.com/fibercrypto/skywallet-protob/go", "github.com/gogo/protobuf/proto", - "github.com/skycoin/hardware-wallet-protob/go", "github.com/skycoin/skycoin/src/cipher", "github.com/skycoin/skycoin/src/util/logging", "github.com/stretchr/testify/mock", diff --git a/Gopkg.toml b/Gopkg.toml index 316b720..0eb6396 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -33,10 +33,10 @@ name = "github.com/skycoin/skycoin" branch = "develop" -[[constraint]] - name = "github.com/skycoin/hardware-wallet-protob" - revision = "bd9f95c53447f97ac56f24a415c25d04680552de" - [[constraint]] name = "github.com/gogo/protobuf" version = "1.2.1" + +[[constraint]] + branch = "develop" + name = "github.com/fibercrypto/skywallet-protob" diff --git a/Makefile b/Makefile index 7e4e9c6..751443b 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ mocks: ## Create all mock files for unit tests mockery -name DeviceDriver -dir ./src/skywallet -case underscore -inpkg -testonly test-unit: ## Run unit tests - go test -v github.com/skycoin/hardware-wallet-go/src/skywallet + go test -v github.com/fibercrypto/skywallet-go/src/skywallet test-integration-emulator: ## Run emulator integration tests ./ci-scripts/integration-test.sh -a -m EMULATOR -n emulator-integration @@ -52,8 +52,8 @@ lint: ## Run linters. Use make install-linters first. golangci-lint run -c .golangci.yml ./... format: ## Formats the code. Must have goimports installed (use make install-linters). - goimports -w -local github.com/skycoin/hardware-wallet-go ./cmd - goimports -w -local github.com/skycoin/hardware-wallet-go ./src + goimports -w -local github.com/fibercrypto/skywallet-go ./cmd + goimports -w -local github.com/fibercrypto/skywallet-go ./src help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/README.md b/README.md index 7690ef4..a62079d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ https://github.com/golang/go/wiki/Ubuntu ### Download source code ```bash -$ go get github.com/skycoin/hardware-wallet-go +$ go get github.com/fibercrypto/skywallet-go ``` ### Dependancies management @@ -54,7 +54,7 @@ $ make dep $ go run cmd/cli/cli.go ``` -See also [CLI README](https://github.com/skycoin/hardware-wallet-go/blob/master/cmd/cli/README.md) for information about the Command Line Interface. +See also [CLI README](https://github.com/fibercrypto/skywallet-go/blob/master/cmd/cli/README.md) for information about the Command Line Interface. # Development guidelines @@ -313,4 +313,4 @@ skycoin-cli walletBalance $WALLET2.wlt ## Wiki -More information in [the wiki](https://github.com/skycoin/hardware-wallet-go/wiki) +More information in [the wiki](https://github.com/fibercrypto/skywallet-go/wiki) diff --git a/ci-scripts/integration-test.sh b/ci-scripts/integration-test.sh index 0acdb8f..241549d 100755 --- a/ci-scripts/integration-test.sh +++ b/ci-scripts/integration-test.sh @@ -4,6 +4,7 @@ SCRIPT=`basename ${BASH_SOURCE[0]}` MODE="emulator" +WALLET_TYPE="deterministic" TIMEOUT="60m" # run go test with -v flag VERBOSE="" @@ -25,7 +26,7 @@ usage () { exit 1 } -while getopts "h?m:r:n:vfa" args; do +while getopts "h?m:r:n:vfaw" args; do case $args in h|\?) usage; @@ -36,13 +37,14 @@ case $args in v ) VERBOSE="-v";; f ) FAILFAST="-failfast";; a ) AUTO_PRESS_BUTTONS="1";; + w ) WALLET_TYPE=${OPTARG};; esac done set +e -HW_GO_INTEGRATION_TESTS=1 HW_GO_INTEGRATION_TEST_MODE=$MODE AUTO_PRESS_BUTTONS=$AUTO_PRESS_BUTTONS \ +HW_GO_INTEGRATION_TESTS=1 HW_GO_INTEGRATION_TEST_MODE=$MODE HW_GO_INTEGRATION_TEST_WALLET_TYPE=$WALLET_TYPE AUTO_PRESS_BUTTONS=$AUTO_PRESS_BUTTONS \ go test -count=1 ./src/cli/integration/... $FAILFAST -timeout=$TIMEOUT $VERBOSE $RUN_TESTS TEST_FAIL=$? diff --git a/cmd/cli/README.md b/cmd/cli/README.md index c151f65..787a844 100644 --- a/cmd/cli/README.md +++ b/cmd/cli/README.md @@ -55,7 +55,7 @@ Skycoin Hardware wallet command line interface ## Install ```bash -$ cd $GOPATH/src/github.com/skycoin/hardware-wallet-go/ +$ cd $GOPATH/src/github.com/fibercrypto/skywallet-go/ $ ./install.sh ``` @@ -180,9 +180,11 @@ $ skycoin-hw-cli addressGen [number of addresses] [start index] ``` OPTIONS: - --addressN value Number of addresses to generate (default: 1) - --startIndex value Start to genereate deterministic addresses from startIndex (default: 0) - --confirmAddress If requesting one address it will be sent only if user confirms operation by pressing device's button. + --addressN value Number of addresses to generate. Assume 1 if not set. (default: 1) + --startIndex value Index where deterministic key generation will start from. Assume 0 if not set. (default: 0) + --confirmAddress If requesting one address it will be sent only if user confirms operation by pressing device's button. + --deviceType value Device type to send instructions to, hardware wallet (USB) or emulator. [$DEVICE_TYPE] + --walletType value Wallet type. Types are "deterministic" or "bip44" ``` #### Examples @@ -302,8 +304,10 @@ $ skycoin-hw-cli signMessage [address index] [message to sign] ``` OPTIONS: - --addressN value Index of the address that will issue the signature. (default: 0) - --message value The message that the signature claims to be signing. + --addressIndex value Index of the address that will issue the signature. Assume 0 if not set. (default: 0) + --message value The message that the signature claims to be signing. + --deviceType value Device type to send instructions to, hardware wallet (USB) or emulator. [$DEVICE_TYPE] + --walletType value Wallet type. Types are "deterministic" or "bip44" ``` #### Examples @@ -534,12 +538,14 @@ Ask the device to sign a message using the secret key at given index. ``` OPTIONS: - --inputHash value Hash of the Input of the transaction we expect the device to sign - --inputIndex value Index of the input in the wallet - --outputAddress string Addresses of the output for the transaction - --coin value Amount of coins - --hour value Number of hours - --addressIndex value If the address is a return address tell its index in the wallet + --inputHash value Hash of the Input of the transaction we expect the device to sign + --inputIndex value Index of the input in the wallet + --outputAddress value Addresses of the output for the transaction + --coin value Amount of coins + --hour value Number of hours + --addressIndex value If the address is a return address tell its index in the wallet + --deviceType value Device type to send instructions to, hardware wallet (USB) or emulator. [$DEVICE_TYPE] + --walletType value Wallet type. Types are "deterministic" or "bip44" ``` ```bash diff --git a/cmd/cli/cli.go b/cmd/cli/cli.go index 45a282e..05a9fe8 100644 --- a/cmd/cli/cli.go +++ b/cmd/cli/cli.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/skycoin/hardware-wallet-go/src/cli" + "github.com/fibercrypto/skywallet-go/src/cli" ) func main() { diff --git a/src/cli/address_gen.go b/src/cli/address_gen.go index c25d99d..ab7accf 100644 --- a/src/cli/address_gen.go +++ b/src/cli/address_gen.go @@ -5,11 +5,11 @@ import ( "os" "runtime" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func addressGenCmd() gcli.Command { @@ -38,9 +38,15 @@ func addressGenCmd() gcli.Command { Usage: "Device type to send instructions to, hardware wallet (USB) or emulator.", EnvVar: "DEVICE_TYPE", }, + gcli.StringFlag{ + Name: "walletType", + Usage: "Wallet type. Types are \"deterministic\" or \"bip44\"", + Required: true, + }, }, OnUsageError: onCommandUsageError(name), Action: func(c *gcli.Context) { + walletType := c.String("walletType") addressN := c.Int("addressN") startIndex := c.Int("startIndex") confirmAddress := c.Bool("confirmAddress") @@ -60,7 +66,7 @@ func addressGenCmd() gcli.Command { } var pinEnc string - msg, err := device.AddressGen(uint32(addressN), uint32(startIndex), confirmAddress) + msg, err := device.AddressGen(uint32(addressN), uint32(startIndex), confirmAddress, walletType) if err != nil { log.Error(err) return diff --git a/src/cli/apply_settings.go b/src/cli/apply_settings.go index 8cc979a..a6c3b98 100644 --- a/src/cli/apply_settings.go +++ b/src/cli/apply_settings.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func applySettingsCmd() gcli.Command { diff --git a/src/cli/backup.go b/src/cli/backup.go index 00e309b..6c03e25 100644 --- a/src/cli/backup.go +++ b/src/cli/backup.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func backupCmd() gcli.Command { diff --git a/src/cli/cancel.go b/src/cli/cancel.go index 627bb41..b3c53b6 100644 --- a/src/cli/cancel.go +++ b/src/cli/cancel.go @@ -7,7 +7,7 @@ import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func cancelCmd() gcli.Command { diff --git a/src/cli/check_message_signature.go b/src/cli/check_message_signature.go index 39ed037..73bed7e 100644 --- a/src/cli/check_message_signature.go +++ b/src/cli/check_message_signature.go @@ -7,7 +7,7 @@ import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func checkMessageSignatureCmd() gcli.Command { diff --git a/src/cli/features.go b/src/cli/features.go index b748867..0d9b0b4 100644 --- a/src/cli/features.go +++ b/src/cli/features.go @@ -9,9 +9,9 @@ import ( "github.com/gogo/protobuf/proto" gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func featuresCmd() gcli.Command { diff --git a/src/cli/firmware_update.go b/src/cli/firmware_update.go index bbacaa1..62afd50 100644 --- a/src/cli/firmware_update.go +++ b/src/cli/firmware_update.go @@ -7,7 +7,7 @@ import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func firmwareUpdate() gcli.Command { diff --git a/src/cli/generate_mnemonic.go b/src/cli/generate_mnemonic.go index 965a233..95cded7 100644 --- a/src/cli/generate_mnemonic.go +++ b/src/cli/generate_mnemonic.go @@ -5,11 +5,11 @@ import ( "os" "runtime" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func generateMnemonicCmd() gcli.Command { diff --git a/src/cli/get_mixed_entropy.go b/src/cli/get_mixed_entropy.go index 18a7726..9c76676 100644 --- a/src/cli/get_mixed_entropy.go +++ b/src/cli/get_mixed_entropy.go @@ -3,7 +3,7 @@ package cli import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func getMixedEntropyCmd() gcli.Command { diff --git a/src/cli/get_raw_entropy.go b/src/cli/get_raw_entropy.go index 354b591..373e22e 100644 --- a/src/cli/get_raw_entropy.go +++ b/src/cli/get_raw_entropy.go @@ -3,7 +3,7 @@ package cli import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func getRawEntropyCmd() gcli.Command { diff --git a/src/cli/integration/integration_test.go b/src/cli/integration/integration_test.go index 28bf460..408c752 100644 --- a/src/cli/integration/integration_test.go +++ b/src/cli/integration/integration_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - "github.com/skycoin/hardware-wallet-go/src/skywallet" + "github.com/fibercrypto/skywallet-go/src/skywallet" + messages "github.com/fibercrypto/skywallet-protob/go" "github.com/gogo/protobuf/proto" - messages "github.com/skycoin/hardware-wallet-protob/go" "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/require" ) @@ -36,7 +36,6 @@ const ( ) func execCommand(args ...string) *exec.Cmd { - args = append(args) cmd := exec.Command(binaryPath, args...) cmd.Env = os.Environ() cmd.Env = append(cmd.Env, "AUTO_PRESS_BUTTONS="+autopressButtons()) @@ -64,6 +63,18 @@ func mode(t *testing.T) string { return mode } +func walletType(t *testing.T) string { + walletType := os.Getenv("HW_GO_INTEGRATION_TEST_WALLET_TYPE") + switch walletType { + case "": + walletType = skywallet.WalletTypeDeterministic + case skywallet.WalletTypeDeterministic, skywallet.WalletTypeBip44: + default: + t.Fatalf("Invalid wallet type %s, must be %s or %s", walletType, skywallet.WalletTypeDeterministic, skywallet.WalletTypeBip44) + } + return walletType +} + func enabled() bool { return os.Getenv("HW_GO_INTEGRATION_TESTS") == "1" } @@ -94,7 +105,7 @@ func TestMain(m *testing.M) { // Build cli binary file. args := []string{"build", "-ldflags", "-X main.AUTO_PRESS_BUTTONS=true", "-o", binaryPath, "../../../cmd/cli/cli.go"} if err := exec.Command("go", args...).Run(); err != nil { - fmt.Fprintf(os.Stderr, fmt.Sprintf("Make %v binary failed: %v\n", binaryName, err)) + fmt.Fprint(os.Stderr, fmt.Sprintf("Make %v binary failed: %v\n", binaryName, err)) os.Exit(1) } @@ -215,14 +226,14 @@ func TestAddressGen(t *testing.T) { expectOutput string }{ { - name: "addressGen -n 2", - args: []string{"addressGen", "-addressN", "2"}, + name: "addressGen -n 2 -wt " + walletType(t), + args: []string{"addressGen", "-addressN", "2", "--walletType", walletType(t)}, expectOutput: "[2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw zC8GAQGQBfwk7vtTxVoRG7iMperHNuyYPs]", }, { - name: "addressGen -n 2 -s 2", - args: []string{"addressGen", "-addressN", "2", "--startIndex", "2"}, + name: "addressGen -n 2 -s 2 -wt " + walletType(t), + args: []string{"addressGen", "-addressN", "2", "--startIndex", "2", "--walletType", walletType(t)}, expectOutput: "[28L2fexvThTVz6e2dWUV4pSuCP8SAnCUVku 2NckPkQRQFa5E7HtqDkZmV1TH4HCzR2N5J6]", }, } @@ -699,7 +710,7 @@ func TestSignMessage(t *testing.T) { return } - output, err := execCommandCombinedOutput([]string{"signMessage", "--message", "Hello World"}...) + output, err := execCommandCombinedOutput([]string{"signMessage", "--message", "Hello World", "--walletType", walletType(t)}...) if err != nil { require.Equal(t, err, "exit status 1") } @@ -729,7 +740,7 @@ func TestTransactionSign(t *testing.T) { { name: "transactionSign sample 1", args: []string{"transactionSign", "--inputHash", "181bd5656115172fe81451fae4fb56498a97744d89702e73da75ba91ed5200f9", - "--inputIndex", "0", "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "100000", "--hour", "2"}, + "--inputIndex", "0", "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "100000", "--hour", "2", "--walletType", walletType(t)}, message: []string{"d11c62b1e0e9abf629b1f5f4699cef9fbc504b45ceedf0047ead686979498218"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, @@ -738,7 +749,7 @@ func TestTransactionSign(t *testing.T) { name: "transactionSign sample 2", args: []string{"transactionSign", "--inputHash", "01a9ef6c25271229ef9760e1536c3dc5ccf0ead7de93a64c12a01340670d87e9", "--inputHash", "8c2c97bfd34e0f0f9833b789ce03c2e80ac0b94b9d0b99cee6ea76fb662e8e1c", "--inputIndex", "0", "--inputIndex", "0", - "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "20800000", "--hour", "255"}, + "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "20800000", "--hour", "255", "--walletType", walletType(t)}, message: []string{"9bbde062d665a8b11ae15aee6d4f32f0f3d61af55160c142060795a219378a54", "f947b0352b19672f7b7d04dc2f1fdc47bc5355878f3c47a43d4d4cfbae07d026"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw", "2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, @@ -749,7 +760,7 @@ func TestTransactionSign(t *testing.T) { "--inputHash", "33e826d62489932905dd936d3edbb74f37211d68d4657689ed4b8027edcad0fb", "--inputIndex", "0", "--inputHash", "668f4c144ad2a4458eaef89a38f10e5307b4f0e8fce2ade96fb2cc2409fa6592", "--inputIndex", "0", "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "111000000", "--hour", "6464556", - "--outputAddress=2iNNt6fm9LszSWe51693BeyNUKX34pPaLx8", "--coin", "1900000", "--hour", "1"}, + "--outputAddress=2iNNt6fm9LszSWe51693BeyNUKX34pPaLx8", "--coin", "1900000", "--hour", "1", "--walletType", walletType(t)}, message: []string{"ff383c647551a3ba0387f8334b3f397e45f9fc7b3b5c3b18ab9f2b9737bce039", "c918d83d8d3b1ee85c1d2af6885a0067bacc636d2ebb77655150f86e80bf4417", "0e827c5d16bab0c3451850cc6deeaa332cbcb88322deea4ea939424b072e9b97"}, @@ -760,7 +771,7 @@ func TestTransactionSign(t *testing.T) { name: "transactionSign sample 4", args: []string{"transactionSign", "--inputHash", "b99f62c5b42aec6be97f2ca74bb1a846be9248e8e19771943c501e0b48a43d82", "--inputIndex", "0", "--inputHash", "cd13f705d9c1ce4ac602e4c4347e986deab8e742eae8996b34c429874799ebb2", "--inputIndex", "0", - "--outputAddress=22S8njPeKUNJBijQjNCzaasXVyf22rWv7gF", "--coin", "23100000", "--hour", "0"}, + "--outputAddress=22S8njPeKUNJBijQjNCzaasXVyf22rWv7gF", "--coin", "23100000", "--hour", "0", "--walletType", walletType(t)}, message: []string{"42a26380399172f2024067a17704fceda607283a0f17cb0024ab7a96fc6e4ac6", "5e0a5a8c7ea4a2a500c24e3a4bfd83ef9f74f3c2ff4bdc01240b66a41e34ebbf"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw", "2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, @@ -769,7 +780,7 @@ func TestTransactionSign(t *testing.T) { { name: "transactionSign sample 5", args: []string{"transactionSign", "--inputHash", "4c12fdd28bd580989892b0518f51de3add96b5efb0f54f0cd6115054c682e1f1", "--inputIndex", "0", - "--outputAddress=2iNNt6fm9LszSWe51693BeyNUKX34pPaLx8", "--coin", "1000000", "--hour", "0"}, + "--outputAddress=2iNNt6fm9LszSWe51693BeyNUKX34pPaLx8", "--coin", "1000000", "--hour", "0", "--walletType", walletType(t)}, message: []string{"c40e110f5e460532bfb03a5a0e50262d92d8913a89c87869adb5a443463dea69"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, @@ -779,7 +790,7 @@ func TestTransactionSign(t *testing.T) { args: []string{"transactionSign", "--inputHash", "c5467f398fc3b9d7255d417d9ca208c0a1dfa0ee573974a5fdeb654e1735fc59", "--inputIndex", "0", "--outputAddress=K9TzLrgqz7uXn3QJHGxmzdRByAzH33J2ot", "--coin", "10000000", "--hour", "1", "--outputAddress=VNz8LR9JTSoz5o7qPHm3QHj4EiJB6LV18L", "--coin", "5500000", "--hour", "0", - "--outputAddress=22S8njPeKUNJBijQjNCzaasXVyf22rWv7gF", "--coin", "4500000", "--hour", "1"}, + "--outputAddress=22S8njPeKUNJBijQjNCzaasXVyf22rWv7gF", "--coin", "4500000", "--hour", "1", "--walletType", walletType(t)}, message: []string{"7edea77354eca0999b1b023014eb04638b05313d40711707dd03a9935696ccd1"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, @@ -787,7 +798,7 @@ func TestTransactionSign(t *testing.T) { { name: "transactionSign sample 7", args: []string{"transactionSign", "--inputHash", "ae6fcae589898d6003362aaf39c56852f65369d55bf0f2f672bcc268c15a32da", "--inputIndex", "0", - "--outputAddress=3pXt9MSQJkwgPXLNePLQkjKq8tsRnFZGQA", "--coin", "1000000", "--hour", "1000"}, + "--outputAddress=3pXt9MSQJkwgPXLNePLQkjKq8tsRnFZGQA", "--coin", "1000000", "--hour", "1000", "--walletType", walletType(t)}, message: []string{"47bfa37c79f7960df8e8a421250922c5165167f4c91ecca5682c1106f9010a7f"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, @@ -796,7 +807,7 @@ func TestTransactionSign(t *testing.T) { name: "transactionSign sample 8", args: []string{"transactionSign", "--inputHash", "ae6fcae589898d6003362aaf39c56852f65369d55bf0f2f672bcc268c15a32da", "--inputIndex", "0", "--outputAddress=3pXt9MSQJkwgPXLNePLQkjKq8tsRnFZGQA", "--coin", "300000", "--hour", "500", - "--outputAddress=S6Dnv6gRTgsHCmZQxjN7cX5aRjJvDvqwp9", "--coin", "700000", "--hour", "500"}, + "--outputAddress=S6Dnv6gRTgsHCmZQxjN7cX5aRjJvDvqwp9", "--coin", "700000", "--hour", "500", "--walletType", walletType(t)}, message: []string{"e0c6e4982b1b8c33c5be55ac115b69be68f209c5d9054954653e14874664b57d"}, address: []string{"2EU3JbveHdkxW6z5tdhbbB2kRAWvXC2pLzw"}, }, diff --git a/src/cli/recovery.go b/src/cli/recovery.go index a4a4182..f00aacd 100644 --- a/src/cli/recovery.go +++ b/src/cli/recovery.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func recoveryCmd() gcli.Command { diff --git a/src/cli/remove_pin_code.go b/src/cli/remove_pin_code.go index d72d680..393cbe1 100644 --- a/src/cli/remove_pin_code.go +++ b/src/cli/remove_pin_code.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func removePinCode() gcli.Command { diff --git a/src/cli/set_mnemonic.go b/src/cli/set_mnemonic.go index 468806f..f1159b4 100644 --- a/src/cli/set_mnemonic.go +++ b/src/cli/set_mnemonic.go @@ -5,11 +5,11 @@ import ( "os" "runtime" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func setMnemonicCmd() gcli.Command { diff --git a/src/cli/set_pin_code.go b/src/cli/set_pin_code.go index e5e46e5..aefb07e 100644 --- a/src/cli/set_pin_code.go +++ b/src/cli/set_pin_code.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func setPinCode() gcli.Command { diff --git a/src/cli/sign_message.go b/src/cli/sign_message.go index 313d36a..aefdba5 100644 --- a/src/cli/sign_message.go +++ b/src/cli/sign_message.go @@ -7,9 +7,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func signMessageCmd() gcli.Command { @@ -20,7 +20,7 @@ func signMessageCmd() gcli.Command { Description: "", Flags: []gcli.Flag{ gcli.IntFlag{ - Name: "addressN", + Name: "addressIndex", Value: 0, Usage: "Index of the address that will issue the signature. Assume 0 if not set.", }, @@ -33,6 +33,10 @@ func signMessageCmd() gcli.Command { Usage: "Device type to send instructions to, hardware wallet (USB) or emulator.", EnvVar: "DEVICE_TYPE", }, + gcli.StringFlag{ + Name: "walletType", + Usage: "Wallet type. Types are \"deterministic\" or \"bip44\"", + }, }, OnUsageError: onCommandUsageError(name), Action: func(c *gcli.Context) { @@ -50,11 +54,12 @@ func signMessageCmd() gcli.Command { } } - addressN := c.Int("addressN") + addressIndex := c.Int("addressIndex") message := c.String("message") + walletType := c.String("walletType") var signature string - msg, err := device.SignMessage(addressN, message) + msg, err := device.SignMessage(1, addressIndex, message, walletType) if err != nil { log.Error(err) return diff --git a/src/cli/transaction_sign.go b/src/cli/transaction_sign.go index 77ac02e..ccf226f 100644 --- a/src/cli/transaction_sign.go +++ b/src/cli/transaction_sign.go @@ -9,9 +9,9 @@ import ( gcli "github.com/urfave/cli" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func transactionSignCmd() gcli.Command { @@ -50,6 +50,11 @@ func transactionSignCmd() gcli.Command { Usage: "Device type to send instructions to, hardware wallet (USB) or emulator.", EnvVar: "DEVICE_TYPE", }, + gcli.StringFlag{ + Name: "walletType", + Usage: "Wallet type. Types are \"deterministic\" or \"bip44\"", + Required: true, + }, }, OnUsageError: onCommandUsageError(name), Action: func(c *gcli.Context) { @@ -59,6 +64,7 @@ func transactionSignCmd() gcli.Command { coins := c.Int64Slice("coin") hours := c.Int64Slice("hour") addressIndex := c.IntSlice("addressIndex") + walletType := c.String("walletType") device := skyWallet.NewDevice(skyWallet.DeviceTypeFromString(c.String("deviceType"))) if device == nil { @@ -102,7 +108,7 @@ func transactionSignCmd() gcli.Command { transactionOutputs = append(transactionOutputs, &transactionOutput) } - msg, err := device.TransactionSign(transactionInputs, transactionOutputs) + msg, err := device.TransactionSign(transactionInputs, transactionOutputs, walletType) if err != nil { log.Error(err) return diff --git a/src/cli/usbhid.go b/src/cli/usbhid.go index e1ec883..32ac64d 100644 --- a/src/cli/usbhid.go +++ b/src/cli/usbhid.go @@ -3,7 +3,7 @@ package cli import ( gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func getUsbDetails() gcli.Command { diff --git a/src/cli/wipe.go b/src/cli/wipe.go index 80cd9be..5591e2e 100644 --- a/src/cli/wipe.go +++ b/src/cli/wipe.go @@ -5,11 +5,11 @@ import ( "os" "runtime" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" gcli "github.com/urfave/cli" - skyWallet "github.com/skycoin/hardware-wallet-go/src/skywallet" + skyWallet "github.com/fibercrypto/skywallet-go/src/skywallet" ) func wipeCmd() gcli.Command { diff --git a/src/skywallet/bit_encoded_flags_test.go b/src/skywallet/bit_encoded_flags_test.go index 65a2826..d820b16 100644 --- a/src/skywallet/bit_encoded_flags_test.go +++ b/src/skywallet/bit_encoded_flags_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" "github.com/stretchr/testify/suite" ) diff --git a/src/skywallet/helper.go b/src/skywallet/helper.go index a05844a..0cb629a 100644 --- a/src/skywallet/helper.go +++ b/src/skywallet/helper.go @@ -12,10 +12,10 @@ import ( "github.com/gogo/protobuf/proto" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - "github.com/skycoin/hardware-wallet-go/src/skywallet/usb" - "github.com/skycoin/hardware-wallet-go/src/skywallet/wire" + "github.com/fibercrypto/skywallet-go/src/skywallet/usb" + "github.com/fibercrypto/skywallet-go/src/skywallet/wire" ) // DeviceType type of device: emulator or usb diff --git a/src/skywallet/messages.go b/src/skywallet/messages.go index a2f0209..e5dfbdb 100644 --- a/src/skywallet/messages.go +++ b/src/skywallet/messages.go @@ -7,7 +7,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/skycoin/skycoin/src/cipher" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" ) // MessageCancel prepare Cancel request @@ -91,6 +91,30 @@ func MessageAddressGen(addressN, startIndex uint32, confirmAddress bool) ([][64] return chunks, nil } +// MessageAddressGenBip44 prepare MessageAddressGen request +func MessageAddressGenBip44(addressN, startIndex, coinType, account uint32, confirmAddress bool) ([][64]byte, error) { + skycoinAddress := &messages.SkycoinAddress{ + ConfirmAddress: proto.Bool(confirmAddress), + StartIndex: proto.Uint32(0), // TODO remove this field from here + AddressN: proto.Uint32(0), // TODO remove this field from here + Bip44Addr: &messages.Bip44AddrIndex{ + CoinType: proto.Uint32(firstHardenedChild + coinType), // coinType' + Account: proto.Uint32(firstHardenedChild + account), // account' + Change: proto.Uint32(0), + AddressStartIndex: proto.Uint32(startIndex), + AddressN: proto.Uint32(addressN), + }, + } + + data, err := proto.Marshal(skycoinAddress) + if err != nil { + return [][64]byte{}, err + } + + chunks := makeSkyWalletMessage(data, messages.MessageType_MessageType_SkycoinAddress) + return chunks, nil +} + // MessageDeviceGetRawEntropy prepare GetEntropy request func MessageDeviceGetRawEntropy(entropyBytes uint32) ([][64]byte, error) { getEntropy := &messages.GetRawEntropy{ @@ -285,6 +309,29 @@ func MessageSignMessage(addressIndex int, message string) ([][64]byte, error) { return chunks, nil } +// MessageSignMessageBip44 prepare MessageSignMessage request +func MessageSignMessageBip44(startIndex, addressN, coinType, account uint32, message string) ([][64]byte, error) { + skycoinSignMessage := &messages.SkycoinSignMessage{ + AddressN: proto.Uint32(uint32(0)), // TODO remove this field + Message: proto.String(message), + Bip44Addr: &messages.Bip44AddrIndex{ + CoinType: proto.Uint32(firstHardenedChild + coinType), // coinType' + Account: proto.Uint32(firstHardenedChild + account), // account' + Change: proto.Uint32(0), + AddressStartIndex: proto.Uint32(startIndex), + AddressN: proto.Uint32(addressN), + }, + } + + data, err := proto.Marshal(skycoinSignMessage) + if err != nil { + return [][64]byte{}, err + } + + chunks := makeSkyWalletMessage(data, messages.MessageType_MessageType_SkycoinSignMessage) + return chunks, nil +} + // MessageTransactionSign prepare MessageTransactionSign request func MessageTransactionSign(inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput) ([][64]byte, error) { skycoinTransactionSignMessage := &messages.TransactionSign{ @@ -304,6 +351,42 @@ func MessageTransactionSign(inputs []*messages.SkycoinTransactionInput, outputs return chunks, nil } +// MessageTransactionSignBip44 prepare MessageTransactionSign request +func MessageTransactionSignBip44(coinType, account uint32, inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput) ([][64]byte, error) { + for idxInput := range inputs { + inputs[idxInput].Bip44Addr = &messages.Bip44AddrIndex{ + CoinType: proto.Uint32(firstHardenedChild + coinType), // coinType' + Account: proto.Uint32(firstHardenedChild + account), // account' + Change: proto.Uint32(0), + AddressStartIndex: proto.Uint32(*inputs[idxInput].Index), + AddressN: proto.Uint32(1), + } + } + for idxOutput := range outputs { + outputs[idxOutput].Bip44Addr = &messages.Bip44AddrIndex{ + CoinType: proto.Uint32(firstHardenedChild + coinType), // coinType' + Account: proto.Uint32(firstHardenedChild + account), // account' + Change: proto.Uint32(0), + AddressStartIndex: proto.Uint32(*outputs[idxOutput].AddressIndex), + AddressN: proto.Uint32(1), + } + } + skycoinTransactionSignMessage := &messages.TransactionSign{ + NbIn: proto.Uint32(uint32(len(inputs))), + NbOut: proto.Uint32(uint32(len(outputs))), + TransactionIn: inputs, + TransactionOut: outputs, + } + + data, err := proto.Marshal(skycoinTransactionSignMessage) + if err != nil { + return [][64]byte{}, err + } + + chunks := makeSkyWalletMessage(data, messages.MessageType_MessageType_TransactionSign) + return chunks, nil +} + // MessageWipe prepare MessageWipe request func MessageWipe() ([][64]byte, error) { wipeDevice := &messages.WipeDevice{} diff --git a/src/skywallet/mock_device_driver_test.go b/src/skywallet/mock_device_driver_test.go index af80892..74b87fc 100644 --- a/src/skywallet/mock_device_driver_test.go +++ b/src/skywallet/mock_device_driver_test.go @@ -3,8 +3,8 @@ package skywallet import mock "github.com/stretchr/testify/mock" -import usb "github.com/skycoin/hardware-wallet-go/src/skywallet/usb" -import wire "github.com/skycoin/hardware-wallet-go/src/skywallet/wire" +import usb "github.com/fibercrypto/skywallet-go/src/skywallet/usb" +import wire "github.com/fibercrypto/skywallet-go/src/skywallet/wire" // MockDeviceDriver is an autogenerated mock type for the DeviceDriver type type MockDeviceDriver struct { diff --git a/src/skywallet/mock_devicer_test.go b/src/skywallet/mock_devicer_test.go index f999cb9..a63c19b 100644 --- a/src/skywallet/mock_devicer_test.go +++ b/src/skywallet/mock_devicer_test.go @@ -2,9 +2,9 @@ package skywallet -import messages "github.com/skycoin/hardware-wallet-protob/go" +import messages "github.com/fibercrypto/skywallet-protob/go" import mock "github.com/stretchr/testify/mock" -import wire "github.com/skycoin/hardware-wallet-go/src/skywallet/wire" +import wire "github.com/fibercrypto/skywallet-go/src/skywallet/wire" // MockDevicer is an autogenerated mock type for the Devicer type type MockDevicer struct { diff --git a/src/skywallet/skywallet.go b/src/skywallet/skywallet.go index 6329c17..4e79527 100644 --- a/src/skywallet/skywallet.go +++ b/src/skywallet/skywallet.go @@ -7,13 +7,13 @@ import ( "sync" "time" - "github.com/skycoin/hardware-wallet-go/src/skywallet/usb" + "github.com/fibercrypto/skywallet-go/src/skywallet/usb" "github.com/skycoin/skycoin/src/util/logging" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - "github.com/skycoin/hardware-wallet-go/src/skywallet/wire" + "github.com/fibercrypto/skywallet-go/src/skywallet/wire" ) var ( @@ -48,13 +48,27 @@ var ( ErrInvalidWordCount = errors.New("word count must be 12 or 24") // ErrNoDeviceConnected is returned if no device is connected to the system ErrNoDeviceConnected = errors.New("no device connected") + // ErrInvalidWalletType a valid wallet type should be specified + ErrInvalidWalletType = errors.New("invalid wallet type, options are: " + WalletTypeDeterministic + " or " + WalletTypeBip44) +) + +const ( + // WalletTypeDeterministic specify use deterministic derivation to get + // for example an address + WalletTypeDeterministic = "deterministic" + + // WalletTypeBip44 specify use BIP 44 derivation to get + // for example an address + WalletTypeBip44 = "bip44" + coinTypeSkycoin = 8000 + firstHardenedChild = uint32(0x80000000) ) //go:generate mockery -name Devicer -case underscore -inpkg -testonly // Devicer provides api for the hw wallet functions type Devicer interface { - AddressGen(addressN, startIndex uint32, confirmAddress bool) (wire.Message, error) + AddressGen(addressN, startIndex uint32, confirmAddress bool, walletType string) (wire.Message, error) ApplySettings(usePassphrase *bool, label string, language string) (wire.Message, error) Backup() (wire.Message, error) Cancel() (wire.Message, error) @@ -67,8 +81,8 @@ type Devicer interface { GenerateMnemonic(wordCount uint32, usePassphrase bool) (wire.Message, error) Recovery(wordCount uint32, usePassphrase *bool, dryRun bool) (wire.Message, error) SetMnemonic(mnemonic string) (wire.Message, error) - TransactionSign(inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput) (wire.Message, error) - SignMessage(addressIndex int, message string) (wire.Message, error) + TransactionSign(inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput, walletType string) (wire.Message, error) + SignMessage(addressN, addressIndex int, message string, walletType string) (wire.Message, error) Wipe() (wire.Message, error) PinMatrixAck(p string) (wire.Message, error) WordAck(word string) (wire.Message, error) @@ -192,7 +206,7 @@ func (d *Device) GetUsbInfo() ([]usb.Info, error) { } // AddressGen Ask the device to generate an address -func (d *Device) AddressGen(addressN, startIndex uint32, confirmAddress bool) (wire.Message, error) { +func (d *Device) AddressGen(addressN, startIndex uint32, confirmAddress bool, walletType string) (wire.Message, error) { if err := d.Connect(); err != nil { return wire.Message{}, err } @@ -202,7 +216,16 @@ func (d *Device) AddressGen(addressN, startIndex uint32, confirmAddress bool) (w return wire.Message{}, ErrAddressNZero } - addressGenChunks, err := MessageAddressGen(addressN, startIndex, confirmAddress) + var err error + var addressGenChunks [][64]byte + switch walletType { + case WalletTypeDeterministic: + addressGenChunks, err = MessageAddressGen(addressN, startIndex, confirmAddress) + case WalletTypeBip44: + addressGenChunks, err = MessageAddressGenBip44(addressN, startIndex, coinTypeSkycoin, 0, confirmAddress) + default: + return wire.Message{}, ErrInvalidWalletType + } if err != nil { return wire.Message{}, err } @@ -729,13 +752,22 @@ func (d *Device) SetMnemonic(mnemonic string) (wire.Message, error) { } // SignMessage Ask the device to sign a message using the secret key at given index. -func (d *Device) SignMessage(addressIndex int, message string) (wire.Message, error) { +func (d *Device) SignMessage(addressN, addressIndex int, message, walletType string) (wire.Message, error) { if err := d.Connect(); err != nil { return wire.Message{}, err } defer d.Disconnect() - signMessageChunks, err := MessageSignMessage(addressIndex, message) + var err error + var signMessageChunks [][64]byte + switch walletType { + case WalletTypeDeterministic: + signMessageChunks, err = MessageSignMessage(addressIndex, message) + case WalletTypeBip44: + signMessageChunks, err = MessageSignMessageBip44(uint32(addressIndex), uint32(addressN), coinTypeSkycoin, 0, message) + default: + return wire.Message{}, ErrInvalidWalletType + } if err != nil { return wire.Message{}, err } @@ -749,13 +781,22 @@ func (d *Device) SignMessage(addressIndex int, message string) (wire.Message, er } // TransactionSign Ask the device to sign a transaction using the given information. -func (d *Device) TransactionSign(inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput) (wire.Message, error) { +func (d *Device) TransactionSign(inputs []*messages.SkycoinTransactionInput, outputs []*messages.SkycoinTransactionOutput, walletType string) (wire.Message, error) { if err := d.Connect(); err != nil { return wire.Message{}, err } defer d.Disconnect() - transactionSignChunks, err := MessageTransactionSign(inputs, outputs) + var err error + var transactionSignChunks [][64]byte + switch walletType { + case WalletTypeDeterministic: + transactionSignChunks, err = MessageTransactionSign(inputs, outputs) + case WalletTypeBip44: + transactionSignChunks, err = MessageTransactionSignBip44(coinTypeSkycoin, 0, inputs, outputs) + default: + return wire.Message{}, ErrInvalidWalletType + } if err != nil { return wire.Message{}, err } diff --git a/src/skywallet/skywallet_test.go b/src/skywallet/skywallet_test.go index 0eb8019..d923d95 100644 --- a/src/skywallet/skywallet_test.go +++ b/src/skywallet/skywallet_test.go @@ -5,9 +5,9 @@ import ( "sync" "testing" - messages "github.com/skycoin/hardware-wallet-protob/go" + messages "github.com/fibercrypto/skywallet-protob/go" - "github.com/skycoin/hardware-wallet-go/src/skywallet/wire" + "github.com/fibercrypto/skywallet-go/src/skywallet/wire" "github.com/stretchr/testify/require" @@ -71,7 +71,7 @@ func (suite *devicerSuit) TestAddressGen() { } for _, tc := range tt { - msg, err := device.AddressGen(tc.addressN, tc.startIndex, false) + msg, err := device.AddressGen(tc.addressN, tc.startIndex, false, WalletTypeDeterministic) suite.Equal(err, tc.err) suite.Equal(msg.Kind, tc.msgKind) } @@ -340,7 +340,7 @@ func (suite *devicerSuit) TestTransactionSign() { device := getMockDevice(driverMock) // NOTE(denisacostaq@gmail.com): When - msg, err := device.TransactionSign(nil, nil) + msg, err := device.TransactionSign(nil, nil, WalletTypeDeterministic) // NOTE(denisacostaq@gmail.com): Assert suite.Nil(err) diff --git a/src/skywallet/usb/hidapi.go b/src/skywallet/usb/hidapi.go index ff1c0f1..841148c 100644 --- a/src/skywallet/usb/hidapi.go +++ b/src/skywallet/usb/hidapi.go @@ -10,7 +10,7 @@ import ( "sync" "sync/atomic" - lowlevel "github.com/skycoin/hardware-wallet-go/src/usb/lowlevel/hidapi" + lowlevel "github.com/fibercrypto/skywallet-go/src/usb/lowlevel/hidapi" ) const ( diff --git a/src/skywallet/usb/libusb.go b/src/skywallet/usb/libusb.go index 131168f..07e29a1 100644 --- a/src/skywallet/usb/libusb.go +++ b/src/skywallet/usb/libusb.go @@ -7,7 +7,7 @@ import ( "sync" "sync/atomic" - lowlevel "github.com/skycoin/hardware-wallet-go/src/usb/lowlevel/libusb" + lowlevel "github.com/fibercrypto/skywallet-go/src/usb/lowlevel/libusb" ) const ( diff --git a/vendor/github.com/cpuguy83/go-md2man/LICENSE.md b/vendor/github.com/cpuguy83/go-md2man/LICENSE.md new file mode 100644 index 0000000..1cade6c --- /dev/null +++ b/vendor/github.com/cpuguy83/go-md2man/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Brian Goff + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go b/vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go new file mode 100644 index 0000000..af62279 --- /dev/null +++ b/vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go @@ -0,0 +1,20 @@ +package md2man + +import ( + "github.com/russross/blackfriday" +) + +// Render converts a markdown document into a roff formatted document. +func Render(doc []byte) []byte { + renderer := RoffRenderer(0) + extensions := 0 + extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS + extensions |= blackfriday.EXTENSION_TABLES + extensions |= blackfriday.EXTENSION_FENCED_CODE + extensions |= blackfriday.EXTENSION_AUTOLINK + extensions |= blackfriday.EXTENSION_SPACE_HEADERS + extensions |= blackfriday.EXTENSION_FOOTNOTES + extensions |= blackfriday.EXTENSION_TITLEBLOCK + + return blackfriday.Markdown(doc, renderer, extensions) +} diff --git a/vendor/github.com/cpuguy83/go-md2man/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/md2man/roff.go new file mode 100644 index 0000000..8c29ec6 --- /dev/null +++ b/vendor/github.com/cpuguy83/go-md2man/md2man/roff.go @@ -0,0 +1,285 @@ +package md2man + +import ( + "bytes" + "fmt" + "html" + "strings" + + "github.com/russross/blackfriday" +) + +type roffRenderer struct { + ListCounters []int +} + +// RoffRenderer creates a new blackfriday Renderer for generating roff documents +// from markdown +func RoffRenderer(flags int) blackfriday.Renderer { + return &roffRenderer{} +} + +func (r *roffRenderer) GetFlags() int { + return 0 +} + +func (r *roffRenderer) TitleBlock(out *bytes.Buffer, text []byte) { + out.WriteString(".TH ") + + splitText := bytes.Split(text, []byte("\n")) + for i, line := range splitText { + line = bytes.TrimPrefix(line, []byte("% ")) + if i == 0 { + line = bytes.Replace(line, []byte("("), []byte("\" \""), 1) + line = bytes.Replace(line, []byte(")"), []byte("\" \""), 1) + } + line = append([]byte("\""), line...) + line = append(line, []byte("\" ")...) + out.Write(line) + } + out.WriteString("\n") + + // disable hyphenation + out.WriteString(".nh\n") + // disable justification (adjust text to left margin only) + out.WriteString(".ad l\n") +} + +func (r *roffRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) { + out.WriteString("\n.PP\n.RS\n\n.nf\n") + escapeSpecialChars(out, text) + out.WriteString("\n.fi\n.RE\n") +} + +func (r *roffRenderer) BlockQuote(out *bytes.Buffer, text []byte) { + out.WriteString("\n.PP\n.RS\n") + out.Write(text) + out.WriteString("\n.RE\n") +} + +func (r *roffRenderer) BlockHtml(out *bytes.Buffer, text []byte) { // nolint: golint + out.Write(text) +} + +func (r *roffRenderer) Header(out *bytes.Buffer, text func() bool, level int, id string) { + marker := out.Len() + + switch { + case marker == 0: + // This is the doc header + out.WriteString(".TH ") + case level == 1: + out.WriteString("\n\n.SH ") + case level == 2: + out.WriteString("\n.SH ") + default: + out.WriteString("\n.SS ") + } + + if !text() { + out.Truncate(marker) + return + } +} + +func (r *roffRenderer) HRule(out *bytes.Buffer) { + out.WriteString("\n.ti 0\n\\l'\\n(.lu'\n") +} + +func (r *roffRenderer) List(out *bytes.Buffer, text func() bool, flags int) { + marker := out.Len() + r.ListCounters = append(r.ListCounters, 1) + out.WriteString("\n.RS\n") + if !text() { + out.Truncate(marker) + return + } + r.ListCounters = r.ListCounters[:len(r.ListCounters)-1] + out.WriteString("\n.RE\n") +} + +func (r *roffRenderer) ListItem(out *bytes.Buffer, text []byte, flags int) { + if flags&blackfriday.LIST_TYPE_ORDERED != 0 { + out.WriteString(fmt.Sprintf(".IP \"%3d.\" 5\n", r.ListCounters[len(r.ListCounters)-1])) + r.ListCounters[len(r.ListCounters)-1]++ + } else { + out.WriteString(".IP \\(bu 2\n") + } + out.Write(text) + out.WriteString("\n") +} + +func (r *roffRenderer) Paragraph(out *bytes.Buffer, text func() bool) { + marker := out.Len() + out.WriteString("\n.PP\n") + if !text() { + out.Truncate(marker) + return + } + if marker != 0 { + out.WriteString("\n") + } +} + +func (r *roffRenderer) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) { + out.WriteString("\n.TS\nallbox;\n") + + maxDelims := 0 + lines := strings.Split(strings.TrimRight(string(header), "\n")+"\n"+strings.TrimRight(string(body), "\n"), "\n") + for _, w := range lines { + curDelims := strings.Count(w, "\t") + if curDelims > maxDelims { + maxDelims = curDelims + } + } + out.Write([]byte(strings.Repeat("l ", maxDelims+1) + "\n")) + out.Write([]byte(strings.Repeat("l ", maxDelims+1) + ".\n")) + out.Write(header) + if len(header) > 0 { + out.Write([]byte("\n")) + } + + out.Write(body) + out.WriteString("\n.TE\n") +} + +func (r *roffRenderer) TableRow(out *bytes.Buffer, text []byte) { + if out.Len() > 0 { + out.WriteString("\n") + } + out.Write(text) +} + +func (r *roffRenderer) TableHeaderCell(out *bytes.Buffer, text []byte, align int) { + if out.Len() > 0 { + out.WriteString("\t") + } + if len(text) == 0 { + text = []byte{' '} + } + out.Write([]byte("\\fB\\fC" + string(text) + "\\fR")) +} + +func (r *roffRenderer) TableCell(out *bytes.Buffer, text []byte, align int) { + if out.Len() > 0 { + out.WriteString("\t") + } + if len(text) > 30 { + text = append([]byte("T{\n"), text...) + text = append(text, []byte("\nT}")...) + } + if len(text) == 0 { + text = []byte{' '} + } + out.Write(text) +} + +func (r *roffRenderer) Footnotes(out *bytes.Buffer, text func() bool) { + +} + +func (r *roffRenderer) FootnoteItem(out *bytes.Buffer, name, text []byte, flags int) { + +} + +func (r *roffRenderer) AutoLink(out *bytes.Buffer, link []byte, kind int) { + out.WriteString("\n\\[la]") + out.Write(link) + out.WriteString("\\[ra]") +} + +func (r *roffRenderer) CodeSpan(out *bytes.Buffer, text []byte) { + out.WriteString("\\fB\\fC") + escapeSpecialChars(out, text) + out.WriteString("\\fR") +} + +func (r *roffRenderer) DoubleEmphasis(out *bytes.Buffer, text []byte) { + out.WriteString("\\fB") + out.Write(text) + out.WriteString("\\fP") +} + +func (r *roffRenderer) Emphasis(out *bytes.Buffer, text []byte) { + out.WriteString("\\fI") + out.Write(text) + out.WriteString("\\fP") +} + +func (r *roffRenderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) { +} + +func (r *roffRenderer) LineBreak(out *bytes.Buffer) { + out.WriteString("\n.br\n") +} + +func (r *roffRenderer) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) { + out.Write(content) + r.AutoLink(out, link, 0) +} + +func (r *roffRenderer) RawHtmlTag(out *bytes.Buffer, tag []byte) { // nolint: golint + out.Write(tag) +} + +func (r *roffRenderer) TripleEmphasis(out *bytes.Buffer, text []byte) { + out.WriteString("\\s+2") + out.Write(text) + out.WriteString("\\s-2") +} + +func (r *roffRenderer) StrikeThrough(out *bytes.Buffer, text []byte) { +} + +func (r *roffRenderer) FootnoteRef(out *bytes.Buffer, ref []byte, id int) { + +} + +func (r *roffRenderer) Entity(out *bytes.Buffer, entity []byte) { + out.WriteString(html.UnescapeString(string(entity))) +} + +func (r *roffRenderer) NormalText(out *bytes.Buffer, text []byte) { + escapeSpecialChars(out, text) +} + +func (r *roffRenderer) DocumentHeader(out *bytes.Buffer) { +} + +func (r *roffRenderer) DocumentFooter(out *bytes.Buffer) { +} + +func needsBackslash(c byte) bool { + for _, r := range []byte("-_&\\~") { + if c == r { + return true + } + } + return false +} + +func escapeSpecialChars(out *bytes.Buffer, text []byte) { + for i := 0; i < len(text); i++ { + // escape initial apostrophe or period + if len(text) >= 1 && (text[0] == '\'' || text[0] == '.') { + out.WriteString("\\&") + } + + // directly copy normal characters + org := i + + for i < len(text) && !needsBackslash(text[i]) { + i++ + } + if i > org { + out.Write(text[org:i]) + } + + // escape a character + if i >= len(text) { + break + } + out.WriteByte('\\') + out.WriteByte(text[i]) + } +} diff --git a/vendor/github.com/skycoin/hardware-wallet-protob/go/google/protobuf/descriptor.pb.go b/vendor/github.com/fibercrypto/skywallet-protob/go/google/protobuf/descriptor.pb.go similarity index 98% rename from vendor/github.com/skycoin/hardware-wallet-protob/go/google/protobuf/descriptor.pb.go rename to vendor/github.com/fibercrypto/skywallet-protob/go/google/protobuf/descriptor.pb.go index c58018a..52d6b70 100644 --- a/vendor/github.com/skycoin/hardware-wallet-protob/go/google/protobuf/descriptor.pb.go +++ b/vendor/github.com/fibercrypto/skywallet-protob/go/google/protobuf/descriptor.pb.go @@ -106,7 +106,7 @@ func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { return nil } func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{3, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{3, 0} } type FieldDescriptorProto_Label int32 @@ -146,7 +146,7 @@ func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { return nil } func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{3, 1} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{3, 1} } // Generated classes can be optimized for speed or code size. @@ -187,7 +187,7 @@ func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { return nil } func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{9, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{9, 0} } type FieldOptions_CType int32 @@ -227,7 +227,7 @@ func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { return nil } func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{11, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{11, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto @@ -243,7 +243,7 @@ func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } func (*FileDescriptorSet) ProtoMessage() {} func (*FileDescriptorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{0} } func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b) @@ -304,7 +304,7 @@ func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FileDescriptorProto) ProtoMessage() {} func (*FileDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{1} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{1} } func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b) @@ -427,7 +427,7 @@ func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } func (*DescriptorProto) ProtoMessage() {} func (*DescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{2} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{2} } func (m *DescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto.Unmarshal(m, b) @@ -515,7 +515,7 @@ func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{2, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{2, 0} } func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b) @@ -587,7 +587,7 @@ func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FieldDescriptorProto) ProtoMessage() {} func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{3} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{3} } func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b) @@ -682,7 +682,7 @@ func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } func (*OneofDescriptorProto) ProtoMessage() {} func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{4} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{4} } func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b) @@ -723,7 +723,7 @@ func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumDescriptorProto) ProtoMessage() {} func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{5} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{5} } func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b) @@ -778,7 +778,7 @@ func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorPro func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumValueDescriptorProto) ProtoMessage() {} func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{6} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{6} } func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b) @@ -833,7 +833,7 @@ func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } func (*ServiceDescriptorProto) ProtoMessage() {} func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{7} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{7} } func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b) @@ -895,7 +895,7 @@ func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } func (*MethodDescriptorProto) ProtoMessage() {} func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{8} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{8} } func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b) @@ -1037,7 +1037,7 @@ func (m *FileOptions) Reset() { *m = FileOptions{} } func (m *FileOptions) String() string { return proto.CompactTextString(m) } func (*FileOptions) ProtoMessage() {} func (*FileOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{9} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{9} } var extRange_FileOptions = []proto.ExtensionRange{ @@ -1229,7 +1229,7 @@ func (m *MessageOptions) Reset() { *m = MessageOptions{} } func (m *MessageOptions) String() string { return proto.CompactTextString(m) } func (*MessageOptions) ProtoMessage() {} func (*MessageOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{10} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{10} } var extRange_MessageOptions = []proto.ExtensionRange{ @@ -1355,7 +1355,7 @@ func (m *FieldOptions) Reset() { *m = FieldOptions{} } func (m *FieldOptions) String() string { return proto.CompactTextString(m) } func (*FieldOptions) ProtoMessage() {} func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{11} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{11} } var extRange_FieldOptions = []proto.ExtensionRange{ @@ -1451,7 +1451,7 @@ func (m *EnumOptions) Reset() { *m = EnumOptions{} } func (m *EnumOptions) String() string { return proto.CompactTextString(m) } func (*EnumOptions) ProtoMessage() {} func (*EnumOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{12} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{12} } var extRange_EnumOptions = []proto.ExtensionRange{ @@ -1520,7 +1520,7 @@ func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } func (*EnumValueOptions) ProtoMessage() {} func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{13} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{13} } var extRange_EnumValueOptions = []proto.ExtensionRange{ @@ -1582,7 +1582,7 @@ func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } func (*ServiceOptions) ProtoMessage() {} func (*ServiceOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{14} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{14} } var extRange_ServiceOptions = []proto.ExtensionRange{ @@ -1644,7 +1644,7 @@ func (m *MethodOptions) Reset() { *m = MethodOptions{} } func (m *MethodOptions) String() string { return proto.CompactTextString(m) } func (*MethodOptions) ProtoMessage() {} func (*MethodOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{15} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{15} } var extRange_MethodOptions = []proto.ExtensionRange{ @@ -1713,7 +1713,7 @@ func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption) ProtoMessage() {} func (*UninterpretedOption) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{16} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{16} } func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b) @@ -1799,7 +1799,7 @@ func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOptio func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption_NamePart) ProtoMessage() {} func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{16, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{16, 0} } func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b) @@ -1889,7 +1889,7 @@ func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo) ProtoMessage() {} func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{17} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{17} } func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b) @@ -1992,7 +1992,7 @@ func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo_Location) ProtoMessage() {} func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return fileDescriptor_descriptor_41f73bbb1bd821d5, []int{17, 0} + return fileDescriptor_descriptor_1315903dacfcb8f9, []int{17, 0} } func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b) @@ -2069,10 +2069,10 @@ func init() { } func init() { - proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_descriptor_41f73bbb1bd821d5) + proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_descriptor_1315903dacfcb8f9) } -var fileDescriptor_descriptor_41f73bbb1bd821d5 = []byte{ +var fileDescriptor_descriptor_1315903dacfcb8f9 = []byte{ // 1981 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x73, 0x1b, 0x49, 0x15, 0x67, 0xf4, 0xcf, 0xd2, 0x93, 0x2c, 0xb7, 0xdb, 0x5e, 0xef, 0x24, 0xd9, 0x6c, 0x6c, 0x2d, diff --git a/vendor/github.com/skycoin/hardware-wallet-protob/go/messages.pb.go b/vendor/github.com/fibercrypto/skywallet-protob/go/messages.pb.go similarity index 74% rename from vendor/github.com/skycoin/hardware-wallet-protob/go/messages.pb.go rename to vendor/github.com/fibercrypto/skywallet-protob/go/messages.pb.go index 32e5421..e16ddb8 100644 --- a/vendor/github.com/skycoin/hardware-wallet-protob/go/messages.pb.go +++ b/vendor/github.com/fibercrypto/skywallet-protob/go/messages.pb.go @@ -68,6 +68,9 @@ const ( MessageType_MessageType_TransactionSign MessageType = 122 MessageType_MessageType_ResponseTransactionSign MessageType = 123 MessageType_MessageType_GetMixedEntropy MessageType = 124 + MessageType_MessageType_SignTx MessageType = 125 + MessageType_MessageType_TxRequest MessageType = 126 + MessageType_MessageType_TxAck MessageType = 127 ) var MessageType_name = map[int32]string{ @@ -111,6 +114,9 @@ var MessageType_name = map[int32]string{ 122: "MessageType_TransactionSign", 123: "MessageType_ResponseTransactionSign", 124: "MessageType_GetMixedEntropy", + 125: "MessageType_SignTx", + 126: "MessageType_TxRequest", + 127: "MessageType_TxAck", } var MessageType_value = map[string]int32{ "MessageType_Initialize": 0, @@ -153,6 +159,9 @@ var MessageType_value = map[string]int32{ "MessageType_TransactionSign": 122, "MessageType_ResponseTransactionSign": 123, "MessageType_GetMixedEntropy": 124, + "MessageType_SignTx": 125, + "MessageType_TxRequest": 126, + "MessageType_TxAck": 127, } func (x MessageType) Enum() *MessageType { @@ -172,7 +181,54 @@ func (x *MessageType) UnmarshalJSON(data []byte) error { return nil } func (MessageType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{0} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{0} +} + +// * +// Type of information required by transaction signing process +type TxRequest_RequestType int32 + +const ( + TxRequest_TXINPUT TxRequest_RequestType = 0 + TxRequest_TXOUTPUT TxRequest_RequestType = 1 + TxRequest_TXMETA TxRequest_RequestType = 2 + TxRequest_TXFINISHED TxRequest_RequestType = 3 + TxRequest_TXEXTRADATA TxRequest_RequestType = 4 +) + +var TxRequest_RequestType_name = map[int32]string{ + 0: "TXINPUT", + 1: "TXOUTPUT", + 2: "TXMETA", + 3: "TXFINISHED", + 4: "TXEXTRADATA", +} +var TxRequest_RequestType_value = map[string]int32{ + "TXINPUT": 0, + "TXOUTPUT": 1, + "TXMETA": 2, + "TXFINISHED": 3, + "TXEXTRADATA": 4, +} + +func (x TxRequest_RequestType) Enum() *TxRequest_RequestType { + p := new(TxRequest_RequestType) + *p = x + return p +} +func (x TxRequest_RequestType) String() string { + return proto.EnumName(TxRequest_RequestType_name, int32(x)) +} +func (x *TxRequest_RequestType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(TxRequest_RequestType_value, data, "TxRequest_RequestType") + if err != nil { + return err + } + *x = TxRequest_RequestType(value) + return nil +} +func (TxRequest_RequestType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{42, 0} } // * @@ -189,7 +245,7 @@ func (m *Initialize) Reset() { *m = Initialize{} } func (m *Initialize) String() string { return proto.CompactTextString(m) } func (*Initialize) ProtoMessage() {} func (*Initialize) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{0} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{0} } func (m *Initialize) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,7 +294,7 @@ func (m *GetFeatures) Reset() { *m = GetFeatures{} } func (m *GetFeatures) String() string { return proto.CompactTextString(m) } func (*GetFeatures) ProtoMessage() {} func (*GetFeatures) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{1} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{1} } func (m *GetFeatures) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -306,7 +362,7 @@ func (m *Features) Reset() { *m = Features{} } func (m *Features) String() string { return proto.CompactTextString(m) } func (*Features) ProtoMessage() {} func (*Features) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{2} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{2} } func (m *Features) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -529,7 +585,7 @@ func (m *ApplySettings) Reset() { *m = ApplySettings{} } func (m *ApplySettings) String() string { return proto.CompactTextString(m) } func (*ApplySettings) ProtoMessage() {} func (*ApplySettings) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{3} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{3} } func (m *ApplySettings) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -601,7 +657,7 @@ func (m *GenerateMnemonic) Reset() { *m = GenerateMnemonic{} } func (m *GenerateMnemonic) String() string { return proto.CompactTextString(m) } func (*GenerateMnemonic) ProtoMessage() {} func (*GenerateMnemonic) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{4} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{4} } func (m *GenerateMnemonic) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -658,7 +714,7 @@ func (m *SetMnemonic) Reset() { *m = SetMnemonic{} } func (m *SetMnemonic) String() string { return proto.CompactTextString(m) } func (*SetMnemonic) ProtoMessage() {} func (*SetMnemonic) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{5} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{5} } func (m *SetMnemonic) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -709,7 +765,7 @@ func (m *ChangePin) Reset() { *m = ChangePin{} } func (m *ChangePin) String() string { return proto.CompactTextString(m) } func (*ChangePin) ProtoMessage() {} func (*ChangePin) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{6} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{6} } func (m *ChangePin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -750,19 +806,20 @@ func (m *ChangePin) GetRemove() bool { // @next Failure // @next ResponseSkycoinAddress type SkycoinAddress struct { - AddressN *uint32 `protobuf:"varint,1,req,name=address_n,json=addressN" json:"address_n,omitempty"` - StartIndex *uint32 `protobuf:"varint,2,opt,name=start_index,json=startIndex" json:"start_index,omitempty"` - ConfirmAddress *bool `protobuf:"varint,3,opt,name=confirm_address,json=confirmAddress" json:"confirm_address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AddressN *uint32 `protobuf:"varint,1,req,name=address_n,json=addressN" json:"address_n,omitempty"` + StartIndex *uint32 `protobuf:"varint,2,opt,name=start_index,json=startIndex" json:"start_index,omitempty"` + ConfirmAddress *bool `protobuf:"varint,3,opt,name=confirm_address,json=confirmAddress" json:"confirm_address,omitempty"` + Bip44Addr *Bip44AddrIndex `protobuf:"bytes,4,opt,name=bip44_addr,json=bip44Addr" json:"bip44_addr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SkycoinAddress) Reset() { *m = SkycoinAddress{} } func (m *SkycoinAddress) String() string { return proto.CompactTextString(m) } func (*SkycoinAddress) ProtoMessage() {} func (*SkycoinAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{7} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{7} } func (m *SkycoinAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -812,6 +869,13 @@ func (m *SkycoinAddress) GetConfirmAddress() bool { return false } +func (m *SkycoinAddress) GetBip44Addr() *Bip44AddrIndex { + if m != nil { + return m.Bip44Addr + } + return nil +} + // * // Response: Return the generated skycoin address // @prev SkycoinAddress @@ -826,7 +890,7 @@ func (m *ResponseSkycoinAddress) Reset() { *m = ResponseSkycoinAddress{} func (m *ResponseSkycoinAddress) String() string { return proto.CompactTextString(m) } func (*ResponseSkycoinAddress) ProtoMessage() {} func (*ResponseSkycoinAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{8} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{8} } func (m *ResponseSkycoinAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -877,7 +941,7 @@ func (m *ResponseTransactionSign) Reset() { *m = ResponseTransactionSign func (m *ResponseTransactionSign) String() string { return proto.CompactTextString(m) } func (*ResponseTransactionSign) ProtoMessage() {} func (*ResponseTransactionSign) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{9} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{9} } func (m *ResponseTransactionSign) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -936,7 +1000,7 @@ func (m *SkycoinCheckMessageSignature) Reset() { *m = SkycoinCheckMessag func (m *SkycoinCheckMessageSignature) String() string { return proto.CompactTextString(m) } func (*SkycoinCheckMessageSignature) ProtoMessage() {} func (*SkycoinCheckMessageSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{10} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{10} } func (m *SkycoinCheckMessageSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -991,18 +1055,19 @@ func (m *SkycoinCheckMessageSignature) GetSignature() string { // @next Failure // @next ResponseSkycoinSignMessage type SkycoinSignMessage struct { - AddressN *uint32 `protobuf:"varint,1,req,name=address_n,json=addressN" json:"address_n,omitempty"` - Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AddressN *uint32 `protobuf:"varint,1,req,name=address_n,json=addressN" json:"address_n,omitempty"` + Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"` + Bip44Addr *Bip44AddrIndex `protobuf:"bytes,3,opt,name=bip44_addr,json=bip44Addr" json:"bip44_addr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SkycoinSignMessage) Reset() { *m = SkycoinSignMessage{} } func (m *SkycoinSignMessage) String() string { return proto.CompactTextString(m) } func (*SkycoinSignMessage) ProtoMessage() {} func (*SkycoinSignMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{11} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{11} } func (m *SkycoinSignMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1045,6 +1110,13 @@ func (m *SkycoinSignMessage) GetMessage() string { return "" } +func (m *SkycoinSignMessage) GetBip44Addr() *Bip44AddrIndex { + if m != nil { + return m.Bip44Addr + } + return nil +} + // * // Response: Return the generated skycoin address // @prev SkycoinAddress @@ -1059,7 +1131,7 @@ func (m *ResponseSkycoinSignMessage) Reset() { *m = ResponseSkycoinSignM func (m *ResponseSkycoinSignMessage) String() string { return proto.CompactTextString(m) } func (*ResponseSkycoinSignMessage) ProtoMessage() {} func (*ResponseSkycoinSignMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{12} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{12} } func (m *ResponseSkycoinSignMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1112,7 +1184,7 @@ func (m *Ping) Reset() { *m = Ping{} } func (m *Ping) String() string { return proto.CompactTextString(m) } func (*Ping) ProtoMessage() {} func (*Ping) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{13} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{13} } func (m *Ping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1183,7 +1255,7 @@ func (m *Success) Reset() { *m = Success{} } func (m *Success) String() string { return proto.CompactTextString(m) } func (*Success) ProtoMessage() {} func (*Success) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{14} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{14} } func (m *Success) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1241,7 +1313,7 @@ func (m *Failure) Reset() { *m = Failure{} } func (m *Failure) String() string { return proto.CompactTextString(m) } func (*Failure) ProtoMessage() {} func (*Failure) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{15} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{15} } func (m *Failure) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1307,7 +1379,7 @@ func (m *ButtonRequest) Reset() { *m = ButtonRequest{} } func (m *ButtonRequest) String() string { return proto.CompactTextString(m) } func (*ButtonRequest) ProtoMessage() {} func (*ButtonRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{16} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{16} } func (m *ButtonRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1363,7 +1435,7 @@ func (m *ButtonAck) Reset() { *m = ButtonAck{} } func (m *ButtonAck) String() string { return proto.CompactTextString(m) } func (*ButtonAck) ProtoMessage() {} func (*ButtonAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{17} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{17} } func (m *ButtonAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1407,7 +1479,7 @@ func (m *PinMatrixRequest) Reset() { *m = PinMatrixRequest{} } func (m *PinMatrixRequest) String() string { return proto.CompactTextString(m) } func (*PinMatrixRequest) ProtoMessage() {} func (*PinMatrixRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{18} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{18} } func (m *PinMatrixRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1457,7 +1529,7 @@ func (m *PinMatrixAck) Reset() { *m = PinMatrixAck{} } func (m *PinMatrixAck) String() string { return proto.CompactTextString(m) } func (*PinMatrixAck) ProtoMessage() {} func (*PinMatrixAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{19} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{19} } func (m *PinMatrixAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1508,7 +1580,7 @@ func (m *Cancel) Reset() { *m = Cancel{} } func (m *Cancel) String() string { return proto.CompactTextString(m) } func (*Cancel) ProtoMessage() {} func (*Cancel) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{20} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{20} } func (m *Cancel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1552,7 +1624,7 @@ func (m *PassphraseRequest) Reset() { *m = PassphraseRequest{} } func (m *PassphraseRequest) String() string { return proto.CompactTextString(m) } func (*PassphraseRequest) ProtoMessage() {} func (*PassphraseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{21} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{21} } func (m *PassphraseRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1604,7 +1676,7 @@ func (m *PassphraseAck) Reset() { *m = PassphraseAck{} } func (m *PassphraseAck) String() string { return proto.CompactTextString(m) } func (*PassphraseAck) ProtoMessage() {} func (*PassphraseAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{22} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{22} } func (m *PassphraseAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1661,7 +1733,7 @@ func (m *PassphraseStateRequest) Reset() { *m = PassphraseStateRequest{} func (m *PassphraseStateRequest) String() string { return proto.CompactTextString(m) } func (*PassphraseStateRequest) ProtoMessage() {} func (*PassphraseStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{23} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{23} } func (m *PassphraseStateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1709,7 +1781,7 @@ func (m *PassphraseStateAck) Reset() { *m = PassphraseStateAck{} } func (m *PassphraseStateAck) String() string { return proto.CompactTextString(m) } func (*PassphraseStateAck) ProtoMessage() {} func (*PassphraseStateAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{24} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{24} } func (m *PassphraseStateAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1754,7 +1826,7 @@ func (m *GetRawEntropy) Reset() { *m = GetRawEntropy{} } func (m *GetRawEntropy) String() string { return proto.CompactTextString(m) } func (*GetRawEntropy) ProtoMessage() {} func (*GetRawEntropy) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{25} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{25} } func (m *GetRawEntropy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1806,7 +1878,7 @@ func (m *GetMixedEntropy) Reset() { *m = GetMixedEntropy{} } func (m *GetMixedEntropy) String() string { return proto.CompactTextString(m) } func (*GetMixedEntropy) ProtoMessage() {} func (*GetMixedEntropy) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{26} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{26} } func (m *GetMixedEntropy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1857,7 +1929,7 @@ func (m *Entropy) Reset() { *m = Entropy{} } func (m *Entropy) String() string { return proto.CompactTextString(m) } func (*Entropy) ProtoMessage() {} func (*Entropy) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{27} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{27} } func (m *Entropy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1906,7 +1978,7 @@ func (m *WipeDevice) Reset() { *m = WipeDevice{} } func (m *WipeDevice) String() string { return proto.CompactTextString(m) } func (*WipeDevice) ProtoMessage() {} func (*WipeDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{28} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{28} } func (m *WipeDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1958,7 +2030,7 @@ func (m *LoadDevice) Reset() { *m = LoadDevice{} } func (m *LoadDevice) String() string { return proto.CompactTextString(m) } func (*LoadDevice) ProtoMessage() {} func (*LoadDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{29} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{29} } func (m *LoadDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2067,7 +2139,7 @@ func (m *ResetDevice) Reset() { *m = ResetDevice{} } func (m *ResetDevice) String() string { return proto.CompactTextString(m) } func (*ResetDevice) ProtoMessage() {} func (*ResetDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{30} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{30} } func (m *ResetDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2168,7 +2240,7 @@ func (m *BackupDevice) Reset() { *m = BackupDevice{} } func (m *BackupDevice) String() string { return proto.CompactTextString(m) } func (*BackupDevice) ProtoMessage() {} func (*BackupDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{31} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{31} } func (m *BackupDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2211,7 +2283,7 @@ func (m *EntropyRequest) Reset() { *m = EntropyRequest{} } func (m *EntropyRequest) String() string { return proto.CompactTextString(m) } func (*EntropyRequest) ProtoMessage() {} func (*EntropyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{32} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{32} } func (m *EntropyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2255,7 +2327,7 @@ func (m *EntropyAck) Reset() { *m = EntropyAck{} } func (m *EntropyAck) String() string { return proto.CompactTextString(m) } func (*EntropyAck) ProtoMessage() {} func (*EntropyAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{33} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{33} } func (m *EntropyAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2311,7 +2383,7 @@ func (m *RecoveryDevice) Reset() { *m = RecoveryDevice{} } func (m *RecoveryDevice) String() string { return proto.CompactTextString(m) } func (*RecoveryDevice) ProtoMessage() {} func (*RecoveryDevice) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{34} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{34} } func (m *RecoveryDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2400,7 +2472,7 @@ func (m *WordRequest) Reset() { *m = WordRequest{} } func (m *WordRequest) String() string { return proto.CompactTextString(m) } func (*WordRequest) ProtoMessage() {} func (*WordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{35} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{35} } func (m *WordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2453,7 +2525,7 @@ func (m *WordAck) Reset() { *m = WordAck{} } func (m *WordAck) String() string { return proto.CompactTextString(m) } func (*WordAck) ProtoMessage() {} func (*WordAck) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{36} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{36} } func (m *WordAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2504,7 +2576,7 @@ func (m *FirmwareErase) Reset() { *m = FirmwareErase{} } func (m *FirmwareErase) String() string { return proto.CompactTextString(m) } func (*FirmwareErase) ProtoMessage() {} func (*FirmwareErase) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{37} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{37} } func (m *FirmwareErase) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2555,7 +2627,7 @@ func (m *FirmwareRequest) Reset() { *m = FirmwareRequest{} } func (m *FirmwareRequest) String() string { return proto.CompactTextString(m) } func (*FirmwareRequest) ProtoMessage() {} func (*FirmwareRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{38} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{38} } func (m *FirmwareRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2614,7 +2686,7 @@ func (m *FirmwareUpload) Reset() { *m = FirmwareUpload{} } func (m *FirmwareUpload) String() string { return proto.CompactTextString(m) } func (*FirmwareUpload) ProtoMessage() {} func (*FirmwareUpload) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{39} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{39} } func (m *FirmwareUpload) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2676,7 +2748,7 @@ func (m *TransactionSign) Reset() { *m = TransactionSign{} } func (m *TransactionSign) String() string { return proto.CompactTextString(m) } func (*TransactionSign) ProtoMessage() {} func (*TransactionSign) Descriptor() ([]byte, []int) { - return fileDescriptor_messages_dc38627d46042ff4, []int{40} + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{40} } func (m *TransactionSign) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2733,410 +2805,594 @@ func (m *TransactionSign) GetTransactionOut() []*SkycoinTransactionOutput { return nil } -func init() { - proto.RegisterType((*Initialize)(nil), "Initialize") - proto.RegisterType((*GetFeatures)(nil), "GetFeatures") - proto.RegisterType((*Features)(nil), "Features") - proto.RegisterType((*ApplySettings)(nil), "ApplySettings") - proto.RegisterType((*GenerateMnemonic)(nil), "GenerateMnemonic") - proto.RegisterType((*SetMnemonic)(nil), "SetMnemonic") - proto.RegisterType((*ChangePin)(nil), "ChangePin") - proto.RegisterType((*SkycoinAddress)(nil), "SkycoinAddress") - proto.RegisterType((*ResponseSkycoinAddress)(nil), "ResponseSkycoinAddress") - proto.RegisterType((*ResponseTransactionSign)(nil), "ResponseTransactionSign") - proto.RegisterType((*SkycoinCheckMessageSignature)(nil), "SkycoinCheckMessageSignature") - proto.RegisterType((*SkycoinSignMessage)(nil), "SkycoinSignMessage") - proto.RegisterType((*ResponseSkycoinSignMessage)(nil), "ResponseSkycoinSignMessage") - proto.RegisterType((*Ping)(nil), "Ping") - proto.RegisterType((*Success)(nil), "Success") - proto.RegisterType((*Failure)(nil), "Failure") - proto.RegisterType((*ButtonRequest)(nil), "ButtonRequest") - proto.RegisterType((*ButtonAck)(nil), "ButtonAck") - proto.RegisterType((*PinMatrixRequest)(nil), "PinMatrixRequest") - proto.RegisterType((*PinMatrixAck)(nil), "PinMatrixAck") - proto.RegisterType((*Cancel)(nil), "Cancel") - proto.RegisterType((*PassphraseRequest)(nil), "PassphraseRequest") - proto.RegisterType((*PassphraseAck)(nil), "PassphraseAck") - proto.RegisterType((*PassphraseStateRequest)(nil), "PassphraseStateRequest") - proto.RegisterType((*PassphraseStateAck)(nil), "PassphraseStateAck") - proto.RegisterType((*GetRawEntropy)(nil), "GetRawEntropy") - proto.RegisterType((*GetMixedEntropy)(nil), "GetMixedEntropy") - proto.RegisterType((*Entropy)(nil), "Entropy") - proto.RegisterType((*WipeDevice)(nil), "WipeDevice") - proto.RegisterType((*LoadDevice)(nil), "LoadDevice") - proto.RegisterType((*ResetDevice)(nil), "ResetDevice") - proto.RegisterType((*BackupDevice)(nil), "BackupDevice") - proto.RegisterType((*EntropyRequest)(nil), "EntropyRequest") - proto.RegisterType((*EntropyAck)(nil), "EntropyAck") - proto.RegisterType((*RecoveryDevice)(nil), "RecoveryDevice") - proto.RegisterType((*WordRequest)(nil), "WordRequest") - proto.RegisterType((*WordAck)(nil), "WordAck") - proto.RegisterType((*FirmwareErase)(nil), "FirmwareErase") - proto.RegisterType((*FirmwareRequest)(nil), "FirmwareRequest") - proto.RegisterType((*FirmwareUpload)(nil), "FirmwareUpload") - proto.RegisterType((*TransactionSign)(nil), "TransactionSign") - proto.RegisterEnum("MessageType", MessageType_name, MessageType_value) +type SignTx struct { + OutputsCount *uint32 `protobuf:"varint,1,req,name=outputs_count,json=outputsCount" json:"outputs_count,omitempty"` + InputsCount *uint32 `protobuf:"varint,2,req,name=inputs_count,json=inputsCount" json:"inputs_count,omitempty"` + CoinName *string `protobuf:"bytes,3,opt,name=coin_name,json=coinName,def=SKY" json:"coin_name,omitempty"` + Version *uint32 `protobuf:"varint,4,opt,name=version,def=1" json:"version,omitempty"` + LockTime *uint32 `protobuf:"varint,5,opt,name=lock_time,json=lockTime,def=0" json:"lock_time,omitempty"` + TxHash *string `protobuf:"bytes,6,opt,name=tx_hash,json=txHash" json:"tx_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Initialize) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err + +func (m *SignTx) Reset() { *m = SignTx{} } +func (m *SignTx) String() string { return proto.CompactTextString(m) } +func (*SignTx) ProtoMessage() {} +func (*SignTx) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{41} +} +func (m *SignTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignTx.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil +} +func (dst *SignTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignTx.Merge(dst, src) +} +func (m *SignTx) XXX_Size() int { + return m.Size() +} +func (m *SignTx) XXX_DiscardUnknown() { + xxx_messageInfo_SignTx.DiscardUnknown(m) } -func (m *Initialize) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.State != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.State))) - i += copy(dAtA[i:], m.State) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) +var xxx_messageInfo_SignTx proto.InternalMessageInfo + +const Default_SignTx_CoinName string = "SKY" +const Default_SignTx_Version uint32 = 1 +const Default_SignTx_LockTime uint32 = 0 + +func (m *SignTx) GetOutputsCount() uint32 { + if m != nil && m.OutputsCount != nil { + return *m.OutputsCount } - return i, nil + return 0 } -func (m *GetFeatures) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err +func (m *SignTx) GetInputsCount() uint32 { + if m != nil && m.InputsCount != nil { + return *m.InputsCount } - return dAtA[:n], nil + return 0 } -func (m *GetFeatures) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) +func (m *SignTx) GetCoinName() string { + if m != nil && m.CoinName != nil { + return *m.CoinName } - return i, nil + return Default_SignTx_CoinName } -func (m *Features) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err +func (m *SignTx) GetVersion() uint32 { + if m != nil && m.Version != nil { + return *m.Version } - return dAtA[:n], nil + return Default_SignTx_Version } -func (m *Features) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Vendor != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Vendor))) - i += copy(dAtA[i:], *m.Vendor) +func (m *SignTx) GetLockTime() uint32 { + if m != nil && m.LockTime != nil { + return *m.LockTime } - if m.MajorVersion != nil { - dAtA[i] = 0x10 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.MajorVersion)) + return Default_SignTx_LockTime +} + +func (m *SignTx) GetTxHash() string { + if m != nil && m.TxHash != nil { + return *m.TxHash } - if m.MinorVersion != nil { - dAtA[i] = 0x18 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.MinorVersion)) + return "" +} + +type TxRequest struct { + RequestType *TxRequest_RequestType `protobuf:"varint,1,req,name=request_type,json=requestType,enum=TxRequest_RequestType" json:"request_type,omitempty"` + Details *TxRequest_TxRequestDetailsType `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` + SignResult []*TxRequest_TxRequestSignResponseType `protobuf:"bytes,3,rep,name=sign_result,json=signResult" json:"sign_result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxRequest) Reset() { *m = TxRequest{} } +func (m *TxRequest) String() string { return proto.CompactTextString(m) } +func (*TxRequest) ProtoMessage() {} +func (*TxRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{42} +} +func (m *TxRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if m.PatchVersion != nil { - dAtA[i] = 0x20 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.PatchVersion)) +} +func (dst *TxRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxRequest.Merge(dst, src) +} +func (m *TxRequest) XXX_Size() int { + return m.Size() +} +func (m *TxRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TxRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TxRequest proto.InternalMessageInfo + +func (m *TxRequest) GetRequestType() TxRequest_RequestType { + if m != nil && m.RequestType != nil { + return *m.RequestType } - if m.BootloaderMode != nil { - dAtA[i] = 0x28 - i++ - if *m.BootloaderMode { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + return TxRequest_TXINPUT +} + +func (m *TxRequest) GetDetails() *TxRequest_TxRequestDetailsType { + if m != nil { + return m.Details } - if m.DeviceId != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.DeviceId))) - i += copy(dAtA[i:], *m.DeviceId) + return nil +} + +func (m *TxRequest) GetSignResult() []*TxRequest_TxRequestSignResponseType { + if m != nil { + return m.SignResult } - if m.PinProtection != nil { - dAtA[i] = 0x38 - i++ - if *m.PinProtection { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return nil +} + +// * +// Structure representing request details +type TxRequest_TxRequestDetailsType struct { + RequestIndex *uint32 `protobuf:"varint,1,opt,name=request_index,json=requestIndex" json:"request_index,omitempty"` + TxHash *string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash" json:"tx_hash,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxRequest_TxRequestDetailsType) Reset() { *m = TxRequest_TxRequestDetailsType{} } +func (m *TxRequest_TxRequestDetailsType) String() string { return proto.CompactTextString(m) } +func (*TxRequest_TxRequestDetailsType) ProtoMessage() {} +func (*TxRequest_TxRequestDetailsType) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{42, 0} +} +func (m *TxRequest_TxRequestDetailsType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxRequest_TxRequestDetailsType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxRequest_TxRequestDetailsType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ + return b[:n], nil } - if m.PassphraseProtection != nil { - dAtA[i] = 0x40 - i++ - if *m.PassphraseProtection { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ +} +func (dst *TxRequest_TxRequestDetailsType) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxRequest_TxRequestDetailsType.Merge(dst, src) +} +func (m *TxRequest_TxRequestDetailsType) XXX_Size() int { + return m.Size() +} +func (m *TxRequest_TxRequestDetailsType) XXX_DiscardUnknown() { + xxx_messageInfo_TxRequest_TxRequestDetailsType.DiscardUnknown(m) +} + +var xxx_messageInfo_TxRequest_TxRequestDetailsType proto.InternalMessageInfo + +func (m *TxRequest_TxRequestDetailsType) GetRequestIndex() uint32 { + if m != nil && m.RequestIndex != nil { + return *m.RequestIndex } - if m.Language != nil { - dAtA[i] = 0x4a - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Language))) - i += copy(dAtA[i:], *m.Language) - } - if m.Label != nil { - dAtA[i] = 0x52 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Label))) - i += copy(dAtA[i:], *m.Label) + return 0 +} + +func (m *TxRequest_TxRequestDetailsType) GetTxHash() string { + if m != nil && m.TxHash != nil { + return *m.TxHash } - if m.Initialized != nil { - dAtA[i] = 0x60 - i++ - if *m.Initialized { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return "" +} + +// * +// Structure representing serialized data +type TxRequest_TxRequestSignResponseType struct { + SignatureIndex *uint32 `protobuf:"varint,1,opt,name=signature_index,json=signatureIndex" json:"signature_index,omitempty"` + Signature *string `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxRequest_TxRequestSignResponseType) Reset() { *m = TxRequest_TxRequestSignResponseType{} } +func (m *TxRequest_TxRequestSignResponseType) String() string { return proto.CompactTextString(m) } +func (*TxRequest_TxRequestSignResponseType) ProtoMessage() {} +func (*TxRequest_TxRequestSignResponseType) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{42, 1} +} +func (m *TxRequest_TxRequestSignResponseType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxRequest_TxRequestSignResponseType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxRequest_TxRequestSignResponseType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ + return b[:n], nil } - if m.BootloaderHash != nil { - dAtA[i] = 0x72 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.BootloaderHash))) - i += copy(dAtA[i:], m.BootloaderHash) +} +func (dst *TxRequest_TxRequestSignResponseType) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxRequest_TxRequestSignResponseType.Merge(dst, src) +} +func (m *TxRequest_TxRequestSignResponseType) XXX_Size() int { + return m.Size() +} +func (m *TxRequest_TxRequestSignResponseType) XXX_DiscardUnknown() { + xxx_messageInfo_TxRequest_TxRequestSignResponseType.DiscardUnknown(m) +} + +var xxx_messageInfo_TxRequest_TxRequestSignResponseType proto.InternalMessageInfo + +func (m *TxRequest_TxRequestSignResponseType) GetSignatureIndex() uint32 { + if m != nil && m.SignatureIndex != nil { + return *m.SignatureIndex } - if m.PinCached != nil { - dAtA[i] = 0x80 - i++ - dAtA[i] = 0x1 - i++ - if *m.PinCached { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + return 0 +} + +func (m *TxRequest_TxRequestSignResponseType) GetSignature() string { + if m != nil && m.Signature != nil { + return *m.Signature } - if m.PassphraseCached != nil { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - if *m.PassphraseCached { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return "" +} + +type TxAck struct { + Tx *TxAck_TransactionType `protobuf:"bytes,1,opt,name=tx" json:"tx,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxAck) Reset() { *m = TxAck{} } +func (m *TxAck) String() string { return proto.CompactTextString(m) } +func (*TxAck) ProtoMessage() {} +func (*TxAck) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{43} +} +func (m *TxAck) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxAck.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ + return b[:n], nil } - if m.FirmwarePresent != nil { - dAtA[i] = 0x90 - i++ - dAtA[i] = 0x1 - i++ - if *m.FirmwarePresent { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ +} +func (dst *TxAck) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxAck.Merge(dst, src) +} +func (m *TxAck) XXX_Size() int { + return m.Size() +} +func (m *TxAck) XXX_DiscardUnknown() { + xxx_messageInfo_TxAck.DiscardUnknown(m) +} + +var xxx_messageInfo_TxAck proto.InternalMessageInfo + +func (m *TxAck) GetTx() *TxAck_TransactionType { + if m != nil { + return m.Tx } - if m.NeedsBackup != nil { - dAtA[i] = 0x98 - i++ - dAtA[i] = 0x1 - i++ - if *m.NeedsBackup { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return nil +} + +// * +// Structure representing transaction +type TxAck_TransactionType struct { + Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + Inputs []*TxAck_TransactionType_TxInputType `protobuf:"bytes,2,rep,name=inputs" json:"inputs,omitempty"` + LockTime *uint32 `protobuf:"varint,4,opt,name=lock_time,json=lockTime" json:"lock_time,omitempty"` + Outputs []*TxAck_TransactionType_TxOutputType `protobuf:"bytes,5,rep,name=outputs" json:"outputs,omitempty"` + InputsCnt *uint32 `protobuf:"varint,6,opt,name=inputs_cnt,json=inputsCnt" json:"inputs_cnt,omitempty"` + OutputsCnt *uint32 `protobuf:"varint,7,opt,name=outputs_cnt,json=outputsCnt" json:"outputs_cnt,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxAck_TransactionType) Reset() { *m = TxAck_TransactionType{} } +func (m *TxAck_TransactionType) String() string { return proto.CompactTextString(m) } +func (*TxAck_TransactionType) ProtoMessage() {} +func (*TxAck_TransactionType) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{43, 0} +} +func (m *TxAck_TransactionType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxAck_TransactionType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxAck_TransactionType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ - } - if m.Model != nil { - dAtA[i] = 0xaa - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Model))) - i += copy(dAtA[i:], *m.Model) + return b[:n], nil } - if m.FwMajor != nil { - dAtA[i] = 0xb0 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.FwMajor)) +} +func (dst *TxAck_TransactionType) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxAck_TransactionType.Merge(dst, src) +} +func (m *TxAck_TransactionType) XXX_Size() int { + return m.Size() +} +func (m *TxAck_TransactionType) XXX_DiscardUnknown() { + xxx_messageInfo_TxAck_TransactionType.DiscardUnknown(m) +} + +var xxx_messageInfo_TxAck_TransactionType proto.InternalMessageInfo + +func (m *TxAck_TransactionType) GetVersion() uint32 { + if m != nil && m.Version != nil { + return *m.Version } - if m.FwMinor != nil { - dAtA[i] = 0xb8 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.FwMinor)) + return 0 +} + +func (m *TxAck_TransactionType) GetInputs() []*TxAck_TransactionType_TxInputType { + if m != nil { + return m.Inputs } - if m.FwPatch != nil { - dAtA[i] = 0xc0 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.FwPatch)) + return nil +} + +func (m *TxAck_TransactionType) GetLockTime() uint32 { + if m != nil && m.LockTime != nil { + return *m.LockTime } - if m.FwVersionHead != nil { - dAtA[i] = 0xca - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.FwVersionHead))) - i += copy(dAtA[i:], *m.FwVersionHead) + return 0 +} + +func (m *TxAck_TransactionType) GetOutputs() []*TxAck_TransactionType_TxOutputType { + if m != nil { + return m.Outputs } - if m.FwVendor != nil { - dAtA[i] = 0xd2 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.FwVendor))) - i += copy(dAtA[i:], *m.FwVendor) + return nil +} + +func (m *TxAck_TransactionType) GetInputsCnt() uint32 { + if m != nil && m.InputsCnt != nil { + return *m.InputsCnt } - if m.FwVendorKeys != nil { - dAtA[i] = 0xda - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.FwVendorKeys))) - i += copy(dAtA[i:], m.FwVendorKeys) + return 0 +} + +func (m *TxAck_TransactionType) GetOutputsCnt() uint32 { + if m != nil && m.OutputsCnt != nil { + return *m.OutputsCnt } - if m.UnfinishedBackup != nil { - dAtA[i] = 0xe0 - i++ - dAtA[i] = 0x1 - i++ - if *m.UnfinishedBackup { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return 0 +} + +// * +// Structure representing transaction input +type TxAck_TransactionType_TxInputType struct { + AddressN []uint32 `protobuf:"varint,1,rep,name=address_n,json=addressN" json:"address_n,omitempty"` + HashIn *string `protobuf:"bytes,2,req,name=hashIn" json:"hashIn,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxAck_TransactionType_TxInputType) Reset() { *m = TxAck_TransactionType_TxInputType{} } +func (m *TxAck_TransactionType_TxInputType) String() string { return proto.CompactTextString(m) } +func (*TxAck_TransactionType_TxInputType) ProtoMessage() {} +func (*TxAck_TransactionType_TxInputType) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{43, 0, 0} +} +func (m *TxAck_TransactionType_TxInputType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxAck_TransactionType_TxInputType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxAck_TransactionType_TxInputType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ - } - if m.FirmwareFeatures != nil { - dAtA[i] = 0xe8 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.FirmwareFeatures)) + return b[:n], nil } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) +} +func (dst *TxAck_TransactionType_TxInputType) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxAck_TransactionType_TxInputType.Merge(dst, src) +} +func (m *TxAck_TransactionType_TxInputType) XXX_Size() int { + return m.Size() +} +func (m *TxAck_TransactionType_TxInputType) XXX_DiscardUnknown() { + xxx_messageInfo_TxAck_TransactionType_TxInputType.DiscardUnknown(m) +} + +var xxx_messageInfo_TxAck_TransactionType_TxInputType proto.InternalMessageInfo + +func (m *TxAck_TransactionType_TxInputType) GetAddressN() []uint32 { + if m != nil { + return m.AddressN } - return i, nil + return nil } -func (m *ApplySettings) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err +func (m *TxAck_TransactionType_TxInputType) GetHashIn() string { + if m != nil && m.HashIn != nil { + return *m.HashIn } - return dAtA[:n], nil + return "" } -func (m *ApplySettings) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Language != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Language))) - i += copy(dAtA[i:], *m.Language) - } - if m.Label != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Label))) - i += copy(dAtA[i:], *m.Label) - } - if m.UsePassphrase != nil { - dAtA[i] = 0x18 - i++ - if *m.UsePassphrase { - dAtA[i] = 1 - } else { - dAtA[i] = 0 +// * +// Structure representing transaction output +type TxAck_TransactionType_TxOutputType struct { + Address *string `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` + AddressN []uint32 `protobuf:"varint,2,rep,name=address_n,json=addressN" json:"address_n,omitempty"` + Coins *uint64 `protobuf:"varint,3,req,name=coins" json:"coins,omitempty"` + Hours *uint64 `protobuf:"varint,4,req,name=hours" json:"hours,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TxAck_TransactionType_TxOutputType) Reset() { *m = TxAck_TransactionType_TxOutputType{} } +func (m *TxAck_TransactionType_TxOutputType) String() string { return proto.CompactTextString(m) } +func (*TxAck_TransactionType_TxOutputType) ProtoMessage() {} +func (*TxAck_TransactionType_TxOutputType) Descriptor() ([]byte, []int) { + return fileDescriptor_messages_9ca50c8b3bdd214d, []int{43, 0, 1} +} +func (m *TxAck_TransactionType_TxOutputType) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxAck_TransactionType_TxOutputType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxAck_TransactionType_TxOutputType.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err } - i++ - } - if m.Homescreen != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(m.Homescreen))) - i += copy(dAtA[i:], m.Homescreen) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + return b[:n], nil } - return i, nil +} +func (dst *TxAck_TransactionType_TxOutputType) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxAck_TransactionType_TxOutputType.Merge(dst, src) +} +func (m *TxAck_TransactionType_TxOutputType) XXX_Size() int { + return m.Size() +} +func (m *TxAck_TransactionType_TxOutputType) XXX_DiscardUnknown() { + xxx_messageInfo_TxAck_TransactionType_TxOutputType.DiscardUnknown(m) } -func (m *GenerateMnemonic) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err +var xxx_messageInfo_TxAck_TransactionType_TxOutputType proto.InternalMessageInfo + +func (m *TxAck_TransactionType_TxOutputType) GetAddress() string { + if m != nil && m.Address != nil { + return *m.Address } - return dAtA[:n], nil + return "" } -func (m *GenerateMnemonic) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.PassphraseProtection != nil { - dAtA[i] = 0x8 - i++ - if *m.PassphraseProtection { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ +func (m *TxAck_TransactionType_TxOutputType) GetAddressN() []uint32 { + if m != nil { + return m.AddressN } - if m.WordCount != nil { - dAtA[i] = 0x10 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.WordCount)) + return nil +} + +func (m *TxAck_TransactionType_TxOutputType) GetCoins() uint64 { + if m != nil && m.Coins != nil { + return *m.Coins } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + return 0 +} + +func (m *TxAck_TransactionType_TxOutputType) GetHours() uint64 { + if m != nil && m.Hours != nil { + return *m.Hours } - return i, nil + return 0 } -func (m *SetMnemonic) Marshal() (dAtA []byte, err error) { +func init() { + proto.RegisterType((*Initialize)(nil), "Initialize") + proto.RegisterType((*GetFeatures)(nil), "GetFeatures") + proto.RegisterType((*Features)(nil), "Features") + proto.RegisterType((*ApplySettings)(nil), "ApplySettings") + proto.RegisterType((*GenerateMnemonic)(nil), "GenerateMnemonic") + proto.RegisterType((*SetMnemonic)(nil), "SetMnemonic") + proto.RegisterType((*ChangePin)(nil), "ChangePin") + proto.RegisterType((*SkycoinAddress)(nil), "SkycoinAddress") + proto.RegisterType((*ResponseSkycoinAddress)(nil), "ResponseSkycoinAddress") + proto.RegisterType((*ResponseTransactionSign)(nil), "ResponseTransactionSign") + proto.RegisterType((*SkycoinCheckMessageSignature)(nil), "SkycoinCheckMessageSignature") + proto.RegisterType((*SkycoinSignMessage)(nil), "SkycoinSignMessage") + proto.RegisterType((*ResponseSkycoinSignMessage)(nil), "ResponseSkycoinSignMessage") + proto.RegisterType((*Ping)(nil), "Ping") + proto.RegisterType((*Success)(nil), "Success") + proto.RegisterType((*Failure)(nil), "Failure") + proto.RegisterType((*ButtonRequest)(nil), "ButtonRequest") + proto.RegisterType((*ButtonAck)(nil), "ButtonAck") + proto.RegisterType((*PinMatrixRequest)(nil), "PinMatrixRequest") + proto.RegisterType((*PinMatrixAck)(nil), "PinMatrixAck") + proto.RegisterType((*Cancel)(nil), "Cancel") + proto.RegisterType((*PassphraseRequest)(nil), "PassphraseRequest") + proto.RegisterType((*PassphraseAck)(nil), "PassphraseAck") + proto.RegisterType((*PassphraseStateRequest)(nil), "PassphraseStateRequest") + proto.RegisterType((*PassphraseStateAck)(nil), "PassphraseStateAck") + proto.RegisterType((*GetRawEntropy)(nil), "GetRawEntropy") + proto.RegisterType((*GetMixedEntropy)(nil), "GetMixedEntropy") + proto.RegisterType((*Entropy)(nil), "Entropy") + proto.RegisterType((*WipeDevice)(nil), "WipeDevice") + proto.RegisterType((*LoadDevice)(nil), "LoadDevice") + proto.RegisterType((*ResetDevice)(nil), "ResetDevice") + proto.RegisterType((*BackupDevice)(nil), "BackupDevice") + proto.RegisterType((*EntropyRequest)(nil), "EntropyRequest") + proto.RegisterType((*EntropyAck)(nil), "EntropyAck") + proto.RegisterType((*RecoveryDevice)(nil), "RecoveryDevice") + proto.RegisterType((*WordRequest)(nil), "WordRequest") + proto.RegisterType((*WordAck)(nil), "WordAck") + proto.RegisterType((*FirmwareErase)(nil), "FirmwareErase") + proto.RegisterType((*FirmwareRequest)(nil), "FirmwareRequest") + proto.RegisterType((*FirmwareUpload)(nil), "FirmwareUpload") + proto.RegisterType((*TransactionSign)(nil), "TransactionSign") + proto.RegisterType((*SignTx)(nil), "SignTx") + proto.RegisterType((*TxRequest)(nil), "TxRequest") + proto.RegisterType((*TxRequest_TxRequestDetailsType)(nil), "TxRequest.TxRequestDetailsType") + proto.RegisterType((*TxRequest_TxRequestSignResponseType)(nil), "TxRequest.TxRequestSignResponseType") + proto.RegisterType((*TxAck)(nil), "TxAck") + proto.RegisterType((*TxAck_TransactionType)(nil), "TxAck.TransactionType") + proto.RegisterType((*TxAck_TransactionType_TxInputType)(nil), "TxAck.TransactionType.TxInputType") + proto.RegisterType((*TxAck_TransactionType_TxOutputType)(nil), "TxAck.TransactionType.TxOutputType") + proto.RegisterEnum("MessageType", MessageType_name, MessageType_value) + proto.RegisterEnum("TxRequest_RequestType", TxRequest_RequestType_name, TxRequest_RequestType_value) +} +func (m *Initialize) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3146,18 +3402,16 @@ func (m *SetMnemonic) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SetMnemonic) MarshalTo(dAtA []byte) (int, error) { +func (m *Initialize) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Mnemonic == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mnemonic") - } else { + if m.State != nil { dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Mnemonic))) - i += copy(dAtA[i:], *m.Mnemonic) + i = encodeVarintMessages(dAtA, i, uint64(len(m.State))) + i += copy(dAtA[i:], m.State) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3165,7 +3419,7 @@ func (m *SetMnemonic) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *ChangePin) Marshal() (dAtA []byte, err error) { +func (m *GetFeatures) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3175,28 +3429,18 @@ func (m *ChangePin) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ChangePin) MarshalTo(dAtA []byte) (int, error) { +func (m *GetFeatures) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Remove != nil { - dAtA[i] = 0x8 - i++ - if *m.Remove { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } -func (m *SkycoinAddress) Marshal() (dAtA []byte, err error) { +func (m *Features) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3206,124 +3450,223 @@ func (m *SkycoinAddress) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SkycoinAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *Features) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.AddressN == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") - } else { - dAtA[i] = 0x8 + if m.Vendor != nil { + dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.AddressN)) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Vendor))) + i += copy(dAtA[i:], *m.Vendor) } - if m.StartIndex != nil { + if m.MajorVersion != nil { dAtA[i] = 0x10 i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.StartIndex)) + i = encodeVarintMessages(dAtA, i, uint64(*m.MajorVersion)) } - if m.ConfirmAddress != nil { + if m.MinorVersion != nil { dAtA[i] = 0x18 i++ - if *m.ConfirmAddress { + i = encodeVarintMessages(dAtA, i, uint64(*m.MinorVersion)) + } + if m.PatchVersion != nil { + dAtA[i] = 0x20 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.PatchVersion)) + } + if m.BootloaderMode != nil { + dAtA[i] = 0x28 + i++ + if *m.BootloaderMode { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResponseSkycoinAddress) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err + if m.DeviceId != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.DeviceId))) + i += copy(dAtA[i:], *m.DeviceId) } - return dAtA[:n], nil -} - -func (m *ResponseSkycoinAddress) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.PinProtection != nil { + dAtA[i] = 0x38 + i++ + if *m.PinProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i++ } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *ResponseTransactionSign) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err + if m.PassphraseProtection != nil { + dAtA[i] = 0x40 + i++ + if *m.PassphraseProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - return dAtA[:n], nil -} - -func (m *ResponseTransactionSign) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Signatures) > 0 { - for _, s := range m.Signatures { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.Language != nil { + dAtA[i] = 0x4a + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Language))) + i += copy(dAtA[i:], *m.Language) + } + if m.Label != nil { + dAtA[i] = 0x52 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Label))) + i += copy(dAtA[i:], *m.Label) + } + if m.Initialized != nil { + dAtA[i] = 0x60 + i++ + if *m.Initialized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i++ } - if m.Padding == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("padding") - } else { - dAtA[i] = 0x10 + if m.BootloaderHash != nil { + dAtA[i] = 0x72 i++ - if *m.Padding { + i = encodeVarintMessages(dAtA, i, uint64(len(m.BootloaderHash))) + i += copy(dAtA[i:], m.BootloaderHash) + } + if m.PinCached != nil { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x1 + i++ + if *m.PinCached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.PassphraseCached != nil { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + if *m.PassphraseCached { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.FirmwarePresent != nil { + dAtA[i] = 0x90 + i++ + dAtA[i] = 0x1 + i++ + if *m.FirmwarePresent { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.NeedsBackup != nil { + dAtA[i] = 0x98 + i++ + dAtA[i] = 0x1 + i++ + if *m.NeedsBackup { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.Model != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Model))) + i += copy(dAtA[i:], *m.Model) + } + if m.FwMajor != nil { + dAtA[i] = 0xb0 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.FwMajor)) + } + if m.FwMinor != nil { + dAtA[i] = 0xb8 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.FwMinor)) + } + if m.FwPatch != nil { + dAtA[i] = 0xc0 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.FwPatch)) + } + if m.FwVersionHead != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.FwVersionHead))) + i += copy(dAtA[i:], *m.FwVersionHead) + } + if m.FwVendor != nil { + dAtA[i] = 0xd2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.FwVendor))) + i += copy(dAtA[i:], *m.FwVendor) + } + if m.FwVendorKeys != nil { + dAtA[i] = 0xda + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(m.FwVendorKeys))) + i += copy(dAtA[i:], m.FwVendorKeys) + } + if m.UnfinishedBackup != nil { + dAtA[i] = 0xe0 + i++ + dAtA[i] = 0x1 + i++ + if *m.UnfinishedBackup { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } + if m.FirmwareFeatures != nil { + dAtA[i] = 0xe8 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.FirmwareFeatures)) + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } -func (m *SkycoinCheckMessageSignature) Marshal() (dAtA []byte, err error) { +func (m *ApplySettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3333,34 +3676,38 @@ func (m *SkycoinCheckMessageSignature) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SkycoinCheckMessageSignature) MarshalTo(dAtA []byte) (int, error) { +func (m *ApplySettings) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Address == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") - } else { + if m.Language != nil { dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Address))) - i += copy(dAtA[i:], *m.Address) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Language))) + i += copy(dAtA[i:], *m.Language) } - if m.Message == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } else { + if m.Label != nil { dAtA[i] = 0x12 i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) - i += copy(dAtA[i:], *m.Message) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Label))) + i += copy(dAtA[i:], *m.Label) } - if m.Signature == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature") - } else { - dAtA[i] = 0x1a + if m.UsePassphrase != nil { + dAtA[i] = 0x18 i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Signature))) - i += copy(dAtA[i:], *m.Signature) + if *m.UsePassphrase { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.Homescreen != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(m.Homescreen))) + i += copy(dAtA[i:], m.Homescreen) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3368,7 +3715,7 @@ func (m *SkycoinCheckMessageSignature) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *SkycoinSignMessage) Marshal() (dAtA []byte, err error) { +func (m *GenerateMnemonic) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3378,25 +3725,25 @@ func (m *SkycoinSignMessage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { +func (m *GenerateMnemonic) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.AddressN == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") - } else { + if m.PassphraseProtection != nil { dAtA[i] = 0x8 i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.AddressN)) + if *m.PassphraseProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - if m.Message == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") - } else { - dAtA[i] = 0x12 + if m.WordCount != nil { + dAtA[i] = 0x10 i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) - i += copy(dAtA[i:], *m.Message) + i = encodeVarintMessages(dAtA, i, uint64(*m.WordCount)) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3404,7 +3751,7 @@ func (m *SkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *ResponseSkycoinSignMessage) Marshal() (dAtA []byte, err error) { +func (m *SetMnemonic) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3414,18 +3761,18 @@ func (m *ResponseSkycoinSignMessage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ResponseSkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { +func (m *SetMnemonic) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.SignedMessage == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signed_message") + if m.Mnemonic == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("mnemonic") } else { dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.SignedMessage))) - i += copy(dAtA[i:], *m.SignedMessage) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Mnemonic))) + i += copy(dAtA[i:], *m.Mnemonic) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3433,7 +3780,7 @@ func (m *ResponseSkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Ping) Marshal() (dAtA []byte, err error) { +func (m *ChangePin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3443,46 +3790,73 @@ func (m *Ping) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Ping) MarshalTo(dAtA []byte) (int, error) { +func (m *ChangePin) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Message != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) - i += copy(dAtA[i:], *m.Message) - } - if m.ButtonProtection != nil { - dAtA[i] = 0x10 + if m.Remove != nil { + dAtA[i] = 0x8 i++ - if *m.ButtonProtection { + if *m.Remove { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } - if m.PinProtection != nil { + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *SkycoinAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SkycoinAddress) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.AddressN == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } else { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.AddressN)) + } + if m.StartIndex != nil { + dAtA[i] = 0x10 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.StartIndex)) + } + if m.ConfirmAddress != nil { dAtA[i] = 0x18 i++ - if *m.PinProtection { + if *m.ConfirmAddress { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } - if m.PassphraseProtection != nil { - dAtA[i] = 0x20 + if m.Bip44Addr != nil { + dAtA[i] = 0x22 i++ - if *m.PassphraseProtection { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + i = encodeVarintMessages(dAtA, i, uint64(m.Bip44Addr.Size())) + n1, err := m.Bip44Addr.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i++ + i += n1 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3490,7 +3864,7 @@ func (m *Ping) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Success) Marshal() (dAtA []byte, err error) { +func (m *ResponseSkycoinAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3500,21 +3874,25 @@ func (m *Success) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Success) MarshalTo(dAtA []byte) (int, error) { +func (m *ResponseSkycoinAddress) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.MsgType != nil { - dAtA[i] = 0x8 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.MsgType)) - } - if m.Message != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) - i += copy(dAtA[i:], *m.Message) + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3522,7 +3900,7 @@ func (m *Success) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Failure) Marshal() (dAtA []byte, err error) { +func (m *ResponseTransactionSign) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3532,26 +3910,37 @@ func (m *Failure) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Failure) MarshalTo(dAtA []byte) (int, error) { +func (m *ResponseTransactionSign) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.MsgType != nil { - dAtA[i] = 0x8 - i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.MsgType)) + if len(m.Signatures) > 0 { + for _, s := range m.Signatures { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } } - if m.Code != nil { + if m.Padding == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("padding") + } else { dAtA[i] = 0x10 i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.Code)) - } - if m.Message != nil { - dAtA[i] = 0x1a + if *m.Padding { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) - i += copy(dAtA[i:], *m.Message) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3559,7 +3948,7 @@ func (m *Failure) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *ButtonRequest) Marshal() (dAtA []byte, err error) { +func (m *SkycoinCheckMessageSignature) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3569,21 +3958,34 @@ func (m *ButtonRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ButtonRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *SkycoinCheckMessageSignature) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Code != nil { - dAtA[i] = 0x8 + if m.Address == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") + } else { + dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.Code)) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Address))) + i += copy(dAtA[i:], *m.Address) } - if m.Data != nil { + if m.Message == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + } else { dAtA[i] = 0x12 i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Data))) - i += copy(dAtA[i:], *m.Data) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) + i += copy(dAtA[i:], *m.Message) + } + if m.Signature == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature") + } else { + dAtA[i] = 0x1a + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Signature))) + i += copy(dAtA[i:], *m.Signature) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3591,7 +3993,7 @@ func (m *ButtonRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *ButtonAck) Marshal() (dAtA []byte, err error) { +func (m *SkycoinSignMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3601,18 +4003,43 @@ func (m *ButtonAck) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ButtonAck) MarshalTo(dAtA []byte) (int, error) { +func (m *SkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l + if m.AddressN == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } else { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.AddressN)) + } + if m.Message == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + } else { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) + i += copy(dAtA[i:], *m.Message) + } + if m.Bip44Addr != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintMessages(dAtA, i, uint64(m.Bip44Addr.Size())) + n2, err := m.Bip44Addr.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } -func (m *PinMatrixRequest) Marshal() (dAtA []byte, err error) { +func (m *ResponseSkycoinSignMessage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3622,15 +4049,18 @@ func (m *PinMatrixRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PinMatrixRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ResponseSkycoinSignMessage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Type != nil { - dAtA[i] = 0x8 + if m.SignedMessage == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signed_message") + } else { + dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(*m.Type)) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.SignedMessage))) + i += copy(dAtA[i:], *m.SignedMessage) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3638,7 +4068,7 @@ func (m *PinMatrixRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *PinMatrixAck) Marshal() (dAtA []byte, err error) { +func (m *Ping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3648,18 +4078,46 @@ func (m *PinMatrixAck) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PinMatrixAck) MarshalTo(dAtA []byte) (int, error) { +func (m *Ping) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.Pin == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pin") - } else { + if m.Message != nil { dAtA[i] = 0xa i++ - i = encodeVarintMessages(dAtA, i, uint64(len(*m.Pin))) - i += copy(dAtA[i:], *m.Pin) + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) + i += copy(dAtA[i:], *m.Message) + } + if m.ButtonProtection != nil { + dAtA[i] = 0x10 + i++ + if *m.ButtonProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.PinProtection != nil { + dAtA[i] = 0x18 + i++ + if *m.PinProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.PassphraseProtection != nil { + dAtA[i] = 0x20 + i++ + if *m.PassphraseProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -3667,7 +4125,7 @@ func (m *PinMatrixAck) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Cancel) Marshal() (dAtA []byte, err error) { +func (m *Success) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3677,18 +4135,29 @@ func (m *Cancel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Cancel) MarshalTo(dAtA []byte) (int, error) { +func (m *Success) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l + if m.MsgType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.MsgType)) + } + if m.Message != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) + i += copy(dAtA[i:], *m.Message) + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } -func (m *PassphraseRequest) Marshal() (dAtA []byte, err error) { +func (m *Failure) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -3698,7 +4167,173 @@ func (m *PassphraseRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PassphraseRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *Failure) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.MsgType != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.MsgType)) + } + if m.Code != nil { + dAtA[i] = 0x10 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Code)) + } + if m.Message != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Message))) + i += copy(dAtA[i:], *m.Message) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ButtonRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ButtonRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Code != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Code)) + } + if m.Data != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Data))) + i += copy(dAtA[i:], *m.Data) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *ButtonAck) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ButtonAck) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PinMatrixRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PinMatrixRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Type != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Type)) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PinMatrixAck) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PinMatrixAck) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Pin == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("pin") + } else { + dAtA[i] = 0xa + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Pin))) + i += copy(dAtA[i:], *m.Pin) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Cancel) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Cancel) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PassphraseRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PassphraseRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int @@ -3931,11 +4566,11 @@ func (m *LoadDevice) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintMessages(dAtA, i, uint64(m.Node.Size())) - n1, err := m.Node.MarshalTo(dAtA[i:]) + n3, err := m.Node.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n1 + i += n3 } if m.Pin != nil { dAtA[i] = 0x1a @@ -4410,291 +5045,376 @@ func (m *TransactionSign) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func encodeVarintMessages(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *SignTx) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return offset + 1 + return dAtA[:n], nil } -func (m *Initialize) Size() (n int) { - if m == nil { - return 0 - } + +func (m *SignTx) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.State != nil { - l = len(m.State) - n += 1 + l + sovMessages(uint64(l)) + if m.OutputsCount == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("outputs_count") + } else { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.OutputsCount)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.InputsCount == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("inputs_count") + } else { + dAtA[i] = 0x10 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.InputsCount)) } - return n -} - -func (m *GetFeatures) Size() (n int) { - if m == nil { - return 0 + if m.CoinName != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.CoinName))) + i += copy(dAtA[i:], *m.CoinName) + } + if m.Version != nil { + dAtA[i] = 0x20 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Version)) + } + if m.LockTime != nil { + dAtA[i] = 0x28 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.LockTime)) + } + if m.TxHash != nil { + dAtA[i] = 0x32 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.TxHash))) + i += copy(dAtA[i:], *m.TxHash) } - var l int - _ = l if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *Features) Size() (n int) { - if m == nil { - return 0 +func (m *TxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Vendor != nil { - l = len(*m.Vendor) - n += 1 + l + sovMessages(uint64(l)) - } - if m.MajorVersion != nil { - n += 1 + sovMessages(uint64(*m.MajorVersion)) - } - if m.MinorVersion != nil { - n += 1 + sovMessages(uint64(*m.MinorVersion)) + if m.RequestType == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("request_type") + } else { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.RequestType)) } - if m.PatchVersion != nil { - n += 1 + sovMessages(uint64(*m.PatchVersion)) + if m.Details != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(m.Details.Size())) + n4, err := m.Details.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 } - if m.BootloaderMode != nil { - n += 2 - } - if m.DeviceId != nil { - l = len(*m.DeviceId) - n += 1 + l + sovMessages(uint64(l)) - } - if m.PinProtection != nil { - n += 2 - } - if m.PassphraseProtection != nil { - n += 2 - } - if m.Language != nil { - l = len(*m.Language) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Label != nil { - l = len(*m.Label) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Initialized != nil { - n += 2 - } - if m.BootloaderHash != nil { - l = len(m.BootloaderHash) - n += 1 + l + sovMessages(uint64(l)) - } - if m.PinCached != nil { - n += 3 - } - if m.PassphraseCached != nil { - n += 3 - } - if m.FirmwarePresent != nil { - n += 3 - } - if m.NeedsBackup != nil { - n += 3 - } - if m.Model != nil { - l = len(*m.Model) - n += 2 + l + sovMessages(uint64(l)) - } - if m.FwMajor != nil { - n += 2 + sovMessages(uint64(*m.FwMajor)) - } - if m.FwMinor != nil { - n += 2 + sovMessages(uint64(*m.FwMinor)) - } - if m.FwPatch != nil { - n += 2 + sovMessages(uint64(*m.FwPatch)) - } - if m.FwVersionHead != nil { - l = len(*m.FwVersionHead) - n += 2 + l + sovMessages(uint64(l)) - } - if m.FwVendor != nil { - l = len(*m.FwVendor) - n += 2 + l + sovMessages(uint64(l)) - } - if m.FwVendorKeys != nil { - l = len(m.FwVendorKeys) - n += 2 + l + sovMessages(uint64(l)) - } - if m.UnfinishedBackup != nil { - n += 3 - } - if m.FirmwareFeatures != nil { - n += 2 + sovMessages(uint64(*m.FirmwareFeatures)) + if len(m.SignResult) > 0 { + for _, msg := range m.SignResult { + dAtA[i] = 0x1a + i++ + i = encodeVarintMessages(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ApplySettings) Size() (n int) { - if m == nil { - return 0 +func (m *TxRequest_TxRequestDetailsType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxRequest_TxRequestDetailsType) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Language != nil { - l = len(*m.Language) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Label != nil { - l = len(*m.Label) - n += 1 + l + sovMessages(uint64(l)) - } - if m.UsePassphrase != nil { - n += 2 + if m.RequestIndex != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.RequestIndex)) } - if m.Homescreen != nil { - l = len(m.Homescreen) - n += 1 + l + sovMessages(uint64(l)) + if m.TxHash != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.TxHash))) + i += copy(dAtA[i:], *m.TxHash) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *GenerateMnemonic) Size() (n int) { - if m == nil { - return 0 +func (m *TxRequest_TxRequestSignResponseType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxRequest_TxRequestSignResponseType) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.PassphraseProtection != nil { - n += 2 + if m.SignatureIndex != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.SignatureIndex)) } - if m.WordCount != nil { - n += 1 + sovMessages(uint64(*m.WordCount)) + if m.Signature != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Signature))) + i += copy(dAtA[i:], *m.Signature) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *SetMnemonic) Size() (n int) { - if m == nil { - return 0 +func (m *TxAck) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxAck) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Mnemonic != nil { - l = len(*m.Mnemonic) - n += 1 + l + sovMessages(uint64(l)) + if m.Tx != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintMessages(dAtA, i, uint64(m.Tx.Size())) + n5, err := m.Tx.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ChangePin) Size() (n int) { - if m == nil { - return 0 +func (m *TxAck_TransactionType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxAck_TransactionType) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if m.Remove != nil { - n += 2 + if m.Version != nil { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Version)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if len(m.Inputs) > 0 { + for _, msg := range m.Inputs { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - return n -} - -func (m *SkycoinAddress) Size() (n int) { - if m == nil { - return 0 + if m.LockTime != nil { + dAtA[i] = 0x20 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.LockTime)) } - var l int - _ = l - if m.AddressN != nil { - n += 1 + sovMessages(uint64(*m.AddressN)) + if len(m.Outputs) > 0 { + for _, msg := range m.Outputs { + dAtA[i] = 0x2a + i++ + i = encodeVarintMessages(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } } - if m.StartIndex != nil { - n += 1 + sovMessages(uint64(*m.StartIndex)) + if m.InputsCnt != nil { + dAtA[i] = 0x30 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.InputsCnt)) } - if m.ConfirmAddress != nil { - n += 2 + if m.OutputsCnt != nil { + dAtA[i] = 0x38 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.OutputsCnt)) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ResponseSkycoinAddress) Size() (n int) { - if m == nil { - return 0 +func (m *TxAck_TransactionType_TxInputType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxAck_TransactionType_TxInputType) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Addresses) > 0 { - for _, s := range m.Addresses { - l = len(s) - n += 1 + l + sovMessages(uint64(l)) + if len(m.AddressN) > 0 { + for _, num := range m.AddressN { + dAtA[i] = 0x8 + i++ + i = encodeVarintMessages(dAtA, i, uint64(num)) } } + if m.HashIn == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hashIn") + } else { + dAtA[i] = 0x12 + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.HashIn))) + i += copy(dAtA[i:], *m.HashIn) + } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *ResponseTransactionSign) Size() (n int) { - if m == nil { - return 0 +func (m *TxAck_TransactionType_TxOutputType) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *TxAck_TransactionType_TxOutputType) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i var l int _ = l - if len(m.Signatures) > 0 { - for _, s := range m.Signatures { - l = len(s) - n += 1 + l + sovMessages(uint64(l)) + if m.Address == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") + } else { + dAtA[i] = 0xa + i++ + i = encodeVarintMessages(dAtA, i, uint64(len(*m.Address))) + i += copy(dAtA[i:], *m.Address) + } + if len(m.AddressN) > 0 { + for _, num := range m.AddressN { + dAtA[i] = 0x10 + i++ + i = encodeVarintMessages(dAtA, i, uint64(num)) } } - if m.Padding != nil { - n += 2 + if m.Coins == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("coins") + } else { + dAtA[i] = 0x18 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Coins)) + } + if m.Hours == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("hours") + } else { + dAtA[i] = 0x20 + i++ + i = encodeVarintMessages(dAtA, i, uint64(*m.Hours)) } if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + i += copy(dAtA[i:], m.XXX_unrecognized) } - return n + return i, nil } -func (m *SkycoinCheckMessageSignature) Size() (n int) { +func encodeVarintMessages(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *Initialize) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Address != nil { - l = len(*m.Address) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMessages(uint64(l)) - } - if m.Signature != nil { - l = len(*m.Signature) + if m.State != nil { + l = len(m.State) n += 1 + l + sovMessages(uint64(l)) } if m.XXX_unrecognized != nil { @@ -4703,99 +5423,133 @@ func (m *SkycoinCheckMessageSignature) Size() (n int) { return n } -func (m *SkycoinSignMessage) Size() (n int) { +func (m *GetFeatures) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.AddressN != nil { - n += 1 + sovMessages(uint64(*m.AddressN)) - } - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMessages(uint64(l)) - } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *ResponseSkycoinSignMessage) Size() (n int) { +func (m *Features) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.SignedMessage != nil { - l = len(*m.SignedMessage) + if m.Vendor != nil { + l = len(*m.Vendor) n += 1 + l + sovMessages(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.MajorVersion != nil { + n += 1 + sovMessages(uint64(*m.MajorVersion)) } - return n -} - -func (m *Ping) Size() (n int) { - if m == nil { - return 0 + if m.MinorVersion != nil { + n += 1 + sovMessages(uint64(*m.MinorVersion)) } - var l int - _ = l - if m.Message != nil { - l = len(*m.Message) - n += 1 + l + sovMessages(uint64(l)) + if m.PatchVersion != nil { + n += 1 + sovMessages(uint64(*m.PatchVersion)) } - if m.ButtonProtection != nil { + if m.BootloaderMode != nil { n += 2 } + if m.DeviceId != nil { + l = len(*m.DeviceId) + n += 1 + l + sovMessages(uint64(l)) + } if m.PinProtection != nil { n += 2 } if m.PassphraseProtection != nil { n += 2 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Language != nil { + l = len(*m.Language) + n += 1 + l + sovMessages(uint64(l)) } - return n -} - -func (m *Success) Size() (n int) { - if m == nil { - return 0 + if m.Label != nil { + l = len(*m.Label) + n += 1 + l + sovMessages(uint64(l)) } - var l int - _ = l - if m.MsgType != nil { - n += 1 + sovMessages(uint64(*m.MsgType)) + if m.Initialized != nil { + n += 2 } - if m.Message != nil { - l = len(*m.Message) + if m.BootloaderHash != nil { + l = len(m.BootloaderHash) n += 1 + l + sovMessages(uint64(l)) } + if m.PinCached != nil { + n += 3 + } + if m.PassphraseCached != nil { + n += 3 + } + if m.FirmwarePresent != nil { + n += 3 + } + if m.NeedsBackup != nil { + n += 3 + } + if m.Model != nil { + l = len(*m.Model) + n += 2 + l + sovMessages(uint64(l)) + } + if m.FwMajor != nil { + n += 2 + sovMessages(uint64(*m.FwMajor)) + } + if m.FwMinor != nil { + n += 2 + sovMessages(uint64(*m.FwMinor)) + } + if m.FwPatch != nil { + n += 2 + sovMessages(uint64(*m.FwPatch)) + } + if m.FwVersionHead != nil { + l = len(*m.FwVersionHead) + n += 2 + l + sovMessages(uint64(l)) + } + if m.FwVendor != nil { + l = len(*m.FwVendor) + n += 2 + l + sovMessages(uint64(l)) + } + if m.FwVendorKeys != nil { + l = len(m.FwVendorKeys) + n += 2 + l + sovMessages(uint64(l)) + } + if m.UnfinishedBackup != nil { + n += 3 + } + if m.FirmwareFeatures != nil { + n += 2 + sovMessages(uint64(*m.FirmwareFeatures)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *Failure) Size() (n int) { +func (m *ApplySettings) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.MsgType != nil { - n += 1 + sovMessages(uint64(*m.MsgType)) + if m.Language != nil { + l = len(*m.Language) + n += 1 + l + sovMessages(uint64(l)) } - if m.Code != nil { - n += 1 + sovMessages(uint64(*m.Code)) + if m.Label != nil { + l = len(*m.Label) + n += 1 + l + sovMessages(uint64(l)) } - if m.Message != nil { - l = len(*m.Message) + if m.UsePassphrase != nil { + n += 2 + } + if m.Homescreen != nil { + l = len(m.Homescreen) n += 1 + l + sovMessages(uint64(l)) } if m.XXX_unrecognized != nil { @@ -4804,18 +5558,17 @@ func (m *Failure) Size() (n int) { return n } -func (m *ButtonRequest) Size() (n int) { +func (m *GenerateMnemonic) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Code != nil { - n += 1 + sovMessages(uint64(*m.Code)) + if m.PassphraseProtection != nil { + n += 2 } - if m.Data != nil { - l = len(*m.Data) - n += 1 + l + sovMessages(uint64(l)) + if m.WordCount != nil { + n += 1 + sovMessages(uint64(*m.WordCount)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -4823,26 +5576,30 @@ func (m *ButtonRequest) Size() (n int) { return n } -func (m *ButtonAck) Size() (n int) { +func (m *SetMnemonic) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Mnemonic != nil { + l = len(*m.Mnemonic) + n += 1 + l + sovMessages(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *PinMatrixRequest) Size() (n int) { +func (m *ChangePin) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Type != nil { - n += 1 + sovMessages(uint64(*m.Type)) + if m.Remove != nil { + n += 2 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -4850,14 +5607,23 @@ func (m *PinMatrixRequest) Size() (n int) { return n } -func (m *PinMatrixAck) Size() (n int) { +func (m *SkycoinAddress) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Pin != nil { - l = len(*m.Pin) + if m.AddressN != nil { + n += 1 + sovMessages(uint64(*m.AddressN)) + } + if m.StartIndex != nil { + n += 1 + sovMessages(uint64(*m.StartIndex)) + } + if m.ConfirmAddress != nil { + n += 2 + } + if m.Bip44Addr != nil { + l = m.Bip44Addr.Size() n += 1 + l + sovMessages(uint64(l)) } if m.XXX_unrecognized != nil { @@ -4866,25 +5632,37 @@ func (m *PinMatrixAck) Size() (n int) { return n } -func (m *Cancel) Size() (n int) { +func (m *ResponseSkycoinAddress) Size() (n int) { if m == nil { return 0 } var l int _ = l + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovMessages(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *PassphraseRequest) Size() (n int) { +func (m *ResponseTransactionSign) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.OnDevice != nil { + if len(m.Signatures) > 0 { + for _, s := range m.Signatures { + l = len(s) + n += 1 + l + sovMessages(uint64(l)) + } + } + if m.Padding != nil { n += 2 } if m.XXX_unrecognized != nil { @@ -4893,18 +5671,22 @@ func (m *PassphraseRequest) Size() (n int) { return n } -func (m *PassphraseAck) Size() (n int) { +func (m *SkycoinCheckMessageSignature) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Passphrase != nil { - l = len(*m.Passphrase) + if m.Address != nil { + l = len(*m.Address) n += 1 + l + sovMessages(uint64(l)) } - if m.State != nil { - l = len(m.State) + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMessages(uint64(l)) + } + if m.Signature != nil { + l = len(*m.Signature) n += 1 + l + sovMessages(uint64(l)) } if m.XXX_unrecognized != nil { @@ -4913,13 +5695,227 @@ func (m *PassphraseAck) Size() (n int) { return n } -func (m *PassphraseStateRequest) Size() (n int) { +func (m *SkycoinSignMessage) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.State != nil { + if m.AddressN != nil { + n += 1 + sovMessages(uint64(*m.AddressN)) + } + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMessages(uint64(l)) + } + if m.Bip44Addr != nil { + l = m.Bip44Addr.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ResponseSkycoinSignMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SignedMessage != nil { + l = len(*m.SignedMessage) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Ping) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMessages(uint64(l)) + } + if m.ButtonProtection != nil { + n += 2 + } + if m.PinProtection != nil { + n += 2 + } + if m.PassphraseProtection != nil { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Success) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgType != nil { + n += 1 + sovMessages(uint64(*m.MsgType)) + } + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Failure) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgType != nil { + n += 1 + sovMessages(uint64(*m.MsgType)) + } + if m.Code != nil { + n += 1 + sovMessages(uint64(*m.Code)) + } + if m.Message != nil { + l = len(*m.Message) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ButtonRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != nil { + n += 1 + sovMessages(uint64(*m.Code)) + } + if m.Data != nil { + l = len(*m.Data) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ButtonAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PinMatrixRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != nil { + n += 1 + sovMessages(uint64(*m.Type)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PinMatrixAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pin != nil { + l = len(*m.Pin) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Cancel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PassphraseRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OnDevice != nil { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PassphraseAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Passphrase != nil { + l = len(*m.Passphrase) + n += 1 + l + sovMessages(uint64(l)) + } + if m.State != nil { + l = len(m.State) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PassphraseStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.State != nil { l = len(m.State) n += 1 + l + sovMessages(uint64(l)) } @@ -5258,26 +6254,1006 @@ func (m *TransactionSign) Size() (n int) { n += 1 + l + sovMessages(uint64(l)) } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SignTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OutputsCount != nil { + n += 1 + sovMessages(uint64(*m.OutputsCount)) + } + if m.InputsCount != nil { + n += 1 + sovMessages(uint64(*m.InputsCount)) + } + if m.CoinName != nil { + l = len(*m.CoinName) + n += 1 + l + sovMessages(uint64(l)) + } + if m.Version != nil { + n += 1 + sovMessages(uint64(*m.Version)) + } + if m.LockTime != nil { + n += 1 + sovMessages(uint64(*m.LockTime)) + } + if m.TxHash != nil { + l = len(*m.TxHash) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestType != nil { + n += 1 + sovMessages(uint64(*m.RequestType)) + } + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if len(m.SignResult) > 0 { + for _, e := range m.SignResult { + l = e.Size() + n += 1 + l + sovMessages(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxRequest_TxRequestDetailsType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestIndex != nil { + n += 1 + sovMessages(uint64(*m.RequestIndex)) + } + if m.TxHash != nil { + l = len(*m.TxHash) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxRequest_TxRequestSignResponseType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SignatureIndex != nil { + n += 1 + sovMessages(uint64(*m.SignatureIndex)) + } + if m.Signature != nil { + l = len(*m.Signature) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxAck) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tx != nil { + l = m.Tx.Size() + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxAck_TransactionType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Version != nil { + n += 1 + sovMessages(uint64(*m.Version)) + } + if len(m.Inputs) > 0 { + for _, e := range m.Inputs { + l = e.Size() + n += 1 + l + sovMessages(uint64(l)) + } + } + if m.LockTime != nil { + n += 1 + sovMessages(uint64(*m.LockTime)) + } + if len(m.Outputs) > 0 { + for _, e := range m.Outputs { + l = e.Size() + n += 1 + l + sovMessages(uint64(l)) + } + } + if m.InputsCnt != nil { + n += 1 + sovMessages(uint64(*m.InputsCnt)) + } + if m.OutputsCnt != nil { + n += 1 + sovMessages(uint64(*m.OutputsCnt)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxAck_TransactionType_TxInputType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AddressN) > 0 { + for _, e := range m.AddressN { + n += 1 + sovMessages(uint64(e)) + } + } + if m.HashIn != nil { + l = len(*m.HashIn) + n += 1 + l + sovMessages(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TxAck_TransactionType_TxOutputType) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Address != nil { + l = len(*m.Address) + n += 1 + l + sovMessages(uint64(l)) + } + if len(m.AddressN) > 0 { + for _, e := range m.AddressN { + n += 1 + sovMessages(uint64(e)) + } + } + if m.Coins != nil { + n += 1 + sovMessages(uint64(*m.Coins)) + } + if m.Hours != nil { + n += 1 + sovMessages(uint64(*m.Hours)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMessages(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozMessages(x uint64) (n int) { + return sovMessages(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Initialize) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Initialize: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Initialize: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) + if m.State == nil { + m.State = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetFeatures) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetFeatures: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetFeatures: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Features) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Features: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Features: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vendor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Vendor = &s + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MajorVersion", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MajorVersion = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinorVersion", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.MinorVersion = &v + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PatchVersion", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PatchVersion = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BootloaderMode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.BootloaderMode = &b + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.DeviceId = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PinProtection = &b + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PassphraseProtection = &b + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Language = &s + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Label = &s + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Initialized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Initialized = &b + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BootloaderHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BootloaderHash = append(m.BootloaderHash[:0], dAtA[iNdEx:postIndex]...) + if m.BootloaderHash == nil { + m.BootloaderHash = []byte{} + } + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PinCached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PinCached = &b + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseCached", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PassphraseCached = &b + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FirmwarePresent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.FirmwarePresent = &b + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NeedsBackup", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.NeedsBackup = &b + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Model", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Model = &s + iNdEx = postIndex + case 22: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FwMajor", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.FwMajor = &v + case 23: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FwMinor", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.FwMinor = &v + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FwPatch", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.FwPatch = &v + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FwVersionHead", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.FwVersionHead = &s + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FwVendor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.FwVendor = &s + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FwVendorKeys", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FwVendorKeys = append(m.FwVendorKeys[:0], dAtA[iNdEx:postIndex]...) + if m.FwVendorKeys == nil { + m.FwVendorKeys = []byte{} + } + iNdEx = postIndex + case 28: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnfinishedBackup", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.UnfinishedBackup = &b + case 29: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FirmwareFeatures", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.FirmwareFeatures = &v + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } -func sovMessages(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} -func sozMessages(x uint64) (n int) { - return sovMessages(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *Initialize) Unmarshal(dAtA []byte) error { +func (m *ApplySettings) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5300,15 +7276,96 @@ func (m *Initialize) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Initialize: wiretype end group for non-group") + return fmt.Errorf("proto: ApplySettings: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Initialize: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ApplySettings: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Language = &s + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Label = &s + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsePassphrase", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.UsePassphrase = &b + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Homescreen", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -5332,9 +7389,9 @@ func (m *Initialize) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) - if m.State == nil { - m.State = []byte{} + m.Homescreen = append(m.Homescreen[:0], dAtA[iNdEx:postIndex]...) + if m.Homescreen == nil { + m.Homescreen = []byte{} } iNdEx = postIndex default: @@ -5359,7 +7416,7 @@ func (m *Initialize) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetFeatures) Unmarshal(dAtA []byte) error { +func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5382,12 +7439,53 @@ func (m *GetFeatures) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetFeatures: wiretype end group for non-group") + return fmt.Errorf("proto: GenerateMnemonic: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetFeatures: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GenerateMnemonic: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PassphraseProtection = &b + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WordCount", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.WordCount = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -5410,7 +7508,8 @@ func (m *GetFeatures) Unmarshal(dAtA []byte) error { } return nil } -func (m *Features) Unmarshal(dAtA []byte) error { +func (m *SetMnemonic) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5433,15 +7532,15 @@ func (m *Features) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Features: wiretype end group for non-group") + return fmt.Errorf("proto: SetMnemonic: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Features: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SetMnemonic: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vendor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Mnemonic", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5467,13 +7566,68 @@ func (m *Features) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Vendor = &s + m.Mnemonic = &s iNdEx = postIndex - case 2: + hasFields[0] |= uint64(0x00000001) + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mnemonic") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangePin) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangePin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangePin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MajorVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) } - var v uint32 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5483,15 +7637,68 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.MajorVersion = &v - case 3: + b := bool(v != 0) + m.Remove = &b + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SkycoinAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SkycoinAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinorVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -5508,10 +7715,11 @@ func (m *Features) Unmarshal(dAtA []byte) error { break } } - m.MinorVersion = &v - case 4: + m.AddressN = &v + hasFields[0] |= uint64(0x00000001) + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PatchVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StartIndex", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -5528,10 +7736,10 @@ func (m *Features) Unmarshal(dAtA []byte) error { break } } - m.PatchVersion = &v - case 5: + m.StartIndex = &v + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BootloaderMode", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConfirmAddress", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -5549,12 +7757,12 @@ func (m *Features) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.BootloaderMode = &b - case 6: + m.ConfirmAddress = &b + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeviceId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Bip44Addr", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5564,67 +7772,82 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.DeviceId = &s + if m.Bip44Addr == nil { + m.Bip44Addr = &Bip44AddrIndex{} + } + if err := m.Bip44Addr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseSkycoinAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages } - b := bool(v != 0) - m.PinProtection = &b - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - b := bool(v != 0) - m.PassphraseProtection = &b - case 9: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseSkycoinAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseSkycoinAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5649,12 +7872,63 @@ func (m *Features) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Language = &s + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 10: + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseTransactionSign) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseTransactionSign: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseTransactionSign: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5679,12 +7953,11 @@ func (m *Features) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Label = &s + m.Signatures = append(m.Signatures, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 12: + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Initialized", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Padding", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -5702,64 +7975,68 @@ func (m *Features) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.Initialized = &b - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BootloaderHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + m.Padding = &b + hasFields[0] |= uint64(0x00000001) + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err } - if byteLen < 0 { + if skippy < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + byteLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.BootloaderHash = append(m.BootloaderHash[:0], dAtA[iNdEx:postIndex]...) - if m.BootloaderHash == nil { - m.BootloaderHash = []byte{} + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("padding") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages } - iNdEx = postIndex - case 16: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PinCached", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break } - b := bool(v != 0) - m.PinCached = &b - case 17: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseCached", wireType) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SkycoinCheckMessageSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SkycoinCheckMessageSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var v int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5769,39 +8046,28 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.PassphraseCached = &b - case 18: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FirmwarePresent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages } - b := bool(v != 0) - m.FirmwarePresent = &b - case 19: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NeedsBackup", wireType) + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF } - var v int + s := string(dAtA[iNdEx:postIndex]) + m.Address = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5811,16 +8077,26 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.NeedsBackup = &b - case 21: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Message = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Model", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5846,11 +8122,73 @@ func (m *Features) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Model = &s + m.Signature = &s iNdEx = postIndex - case 22: + hasFields[0] |= uint64(0x00000004) + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") + } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + } + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SkycoinSignMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SkycoinSignMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FwMajor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -5867,12 +8205,13 @@ func (m *Features) Unmarshal(dAtA []byte) error { break } } - m.FwMajor = &v - case 23: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FwMinor", wireType) + m.AddressN = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } - var v uint32 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5882,17 +8221,28 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.FwMinor = &v - case 24: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FwPatch", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages } - var v uint32 + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Message = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bip44Addr", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5902,15 +8252,86 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.FwPatch = &v - case 25: + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bip44Addr == nil { + m.Bip44Addr = &Bip44AddrIndex{} + } + if err := m.Bip44Addr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ResponseSkycoinSignMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResponseSkycoinSignMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FwVersionHead", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignedMessage", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5936,11 +8357,66 @@ func (m *Features) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.FwVersionHead = &s + m.SignedMessage = &s iNdEx = postIndex - case 26: + hasFields[0] |= uint64(0x00000001) + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("signed_message") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Ping) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Ping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FwVendor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -5966,13 +8442,13 @@ func (m *Features) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.FwVendor = &s + m.Message = &s iNdEx = postIndex - case 27: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FwVendorKeys", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ButtonProtection", wireType) } - var byteLen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -5982,26 +8458,16 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FwVendorKeys = append(m.FwVendorKeys[:0], dAtA[iNdEx:postIndex]...) - if m.FwVendorKeys == nil { - m.FwVendorKeys = []byte{} - } - iNdEx = postIndex - case 28: + b := bool(v != 0) + m.ButtonProtection = &b + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnfinishedBackup", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -6019,12 +8485,12 @@ func (m *Features) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.UnfinishedBackup = &b - case 29: + m.PinProtection = &b + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FirmwareFeatures", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) } - var v uint32 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6034,12 +8500,13 @@ func (m *Features) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.FirmwareFeatures = &v + b := bool(v != 0) + m.PassphraseProtection = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6062,7 +8529,7 @@ func (m *Features) Unmarshal(dAtA []byte) error { } return nil } -func (m *ApplySettings) Unmarshal(dAtA []byte) error { +func (m *Success) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6085,17 +8552,17 @@ func (m *ApplySettings) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ApplySettings: wiretype end group for non-group") + return fmt.Errorf("proto: Success: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ApplySettings: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) } - var stringLen uint64 + var v MessageType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6105,25 +8572,15 @@ func (m *ApplySettings) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + v |= (MessageType(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Language = &s - iNdEx = postIndex + m.MsgType = &v case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6149,59 +8606,7 @@ func (m *ApplySettings) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Label = &s - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsePassphrase", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.UsePassphrase = &b - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Homescreen", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Homescreen = append(m.Homescreen[:0], dAtA[iNdEx:postIndex]...) - if m.Homescreen == nil { - m.Homescreen = []byte{} - } + m.Message = &s iNdEx = postIndex default: iNdEx = preIndex @@ -6225,7 +8630,7 @@ func (m *ApplySettings) Unmarshal(dAtA []byte) error { } return nil } -func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { +func (m *Failure) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6248,17 +8653,17 @@ func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GenerateMnemonic: wiretype end group for non-group") + return fmt.Errorf("proto: Failure: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GenerateMnemonic: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Failure: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) } - var v int + var v MessageType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6268,18 +8673,17 @@ func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= (MessageType(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.PassphraseProtection = &b + m.MsgType = &v case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WordCount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var v uint32 + var v FailureType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6289,12 +8693,42 @@ func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (FailureType(b) & 0x7F) << shift if b < 0x80 { break } } - m.WordCount = &v + m.Code = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Message = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6317,8 +8751,7 @@ func (m *GenerateMnemonic) Unmarshal(dAtA []byte) error { } return nil } -func (m *SetMnemonic) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 +func (m *ButtonRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6341,15 +8774,35 @@ func (m *SetMnemonic) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SetMnemonic: wiretype end group for non-group") + return fmt.Errorf("proto: ButtonRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SetMnemonic: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ButtonRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + var v ButtonRequestType + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (ButtonRequestType(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Code = &v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mnemonic", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6370,14 +8823,64 @@ func (m *SetMnemonic) Unmarshal(dAtA []byte) error { if intStringLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen - if postIndex > l { + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Data = &s + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ButtonAck) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Mnemonic = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ButtonAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ButtonAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6394,16 +8897,13 @@ func (m *SetMnemonic) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("mnemonic") - } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *ChangePin) Unmarshal(dAtA []byte) error { +func (m *PinMatrixRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6426,17 +8926,17 @@ func (m *ChangePin) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ChangePin: wiretype end group for non-group") + return fmt.Errorf("proto: PinMatrixRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ChangePin: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PinMatrixRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var v int + var v PinMatrixRequestType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6446,13 +8946,12 @@ func (m *ChangePin) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= (PinMatrixRequestType(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.Remove = &b + m.Type = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6475,7 +8974,7 @@ func (m *ChangePin) Unmarshal(dAtA []byte) error { } return nil } -func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { +func (m *PinMatrixAck) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 @@ -6499,38 +8998,17 @@ func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SkycoinAddress: wiretype end group for non-group") + return fmt.Errorf("proto: PinMatrixAck: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SkycoinAddress: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PinMatrixAck: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AddressN = &v - hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartIndex", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pin", wireType) } - var v uint32 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6540,33 +9018,23 @@ func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.StartIndex = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ConfirmAddress", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF } - b := bool(v != 0) - m.ConfirmAddress = &b + s := string(dAtA[iNdEx:postIndex]) + m.Pin = &s + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6584,7 +9052,7 @@ func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { } } if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("pin") } if iNdEx > l { @@ -6592,7 +9060,7 @@ func (m *SkycoinAddress) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseSkycoinAddress) Unmarshal(dAtA []byte) error { +func (m *Cancel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6615,41 +9083,12 @@ func (m *ResponseSkycoinAddress) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseSkycoinAddress: wiretype end group for non-group") + return fmt.Errorf("proto: Cancel: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseSkycoinAddress: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Cancel: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6672,8 +9111,7 @@ func (m *ResponseSkycoinAddress) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseTransactionSign) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 +func (m *PassphraseRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6696,44 +9134,15 @@ func (m *ResponseTransactionSign) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseTransactionSign: wiretype end group for non-group") + return fmt.Errorf("proto: PassphraseRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseTransactionSign: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PassphraseRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Padding", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OnDevice", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -6751,8 +9160,7 @@ func (m *ResponseTransactionSign) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.Padding = &b - hasFields[0] |= uint64(0x00000001) + m.OnDevice = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6769,17 +9177,13 @@ func (m *ResponseTransactionSign) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("padding") - } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 +func (m *PassphraseAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6802,15 +9206,15 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SkycoinCheckMessageSignature: wiretype end group for non-group") + return fmt.Errorf("proto: PassphraseAck: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SkycoinCheckMessageSignature: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PassphraseAck: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Passphrase", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6836,14 +9240,13 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Address = &s + m.Passphrase = &s iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6853,28 +9256,79 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) - case 3: + m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) + if m.State == nil { + m.State = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PassphraseStateRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PassphraseStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PassphraseStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -6884,23 +9338,23 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Signature = &s + m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) + if m.State == nil { + m.State = []byte{} + } iNdEx = postIndex - hasFields[0] |= uint64(0x00000004) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -6917,14 +9371,56 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + + if iNdEx > l { + return io.ErrUnexpectedEOF } - if hasFields[0]&uint64(0x00000004) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature") + return nil +} +func (m *PassphraseStateAck) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PassphraseStateAck: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PassphraseStateAck: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } } if iNdEx > l { @@ -6932,7 +9428,7 @@ func (m *SkycoinCheckMessageSignature) Unmarshal(dAtA []byte) error { } return nil } -func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { +func (m *GetRawEntropy) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 @@ -6956,15 +9452,15 @@ func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SkycoinSignMessage: wiretype end group for non-group") + return fmt.Errorf("proto: GetRawEntropy: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SkycoinSignMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetRawEntropy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -6981,39 +9477,8 @@ func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { break } } - m.AddressN = &v + m.Size_ = &v hasFields[0] |= uint64(0x00000001) - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - hasFields[0] |= uint64(0x00000002) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7031,10 +9496,7 @@ func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { } } if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") - } - if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("message") + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("size") } if iNdEx > l { @@ -7042,7 +9504,7 @@ func (m *SkycoinSignMessage) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { +func (m *GetMixedEntropy) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 @@ -7066,17 +9528,17 @@ func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResponseSkycoinSignMessage: wiretype end group for non-group") + return fmt.Errorf("proto: GetMixedEntropy: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResponseSkycoinSignMessage: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetMixedEntropy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedMessage", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } - var stringLen uint64 + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7086,22 +9548,12 @@ func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.SignedMessage = &s - iNdEx = postIndex + m.Size_ = &v hasFields[0] |= uint64(0x00000001) default: iNdEx = preIndex @@ -7120,7 +9572,7 @@ func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { } } if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("signed_message") + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("size") } if iNdEx > l { @@ -7128,7 +9580,8 @@ func (m *ResponseSkycoinSignMessage) Unmarshal(dAtA []byte) error { } return nil } -func (m *Ping) Unmarshal(dAtA []byte) error { +func (m *Entropy) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7151,17 +9604,17 @@ func (m *Ping) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Ping: wiretype end group for non-group") + return fmt.Errorf("proto: Entropy: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Ping: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Entropy: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entropy", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7171,85 +9624,24 @@ func (m *Ping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ButtonProtection", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.ButtonProtection = &b - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.PinProtection = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + m.Entropy = append(m.Entropy[:0], dAtA[iNdEx:postIndex]...) + if m.Entropy == nil { + m.Entropy = []byte{} } - b := bool(v != 0) - m.PassphraseProtection = &b + iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7266,13 +9658,16 @@ func (m *Ping) Unmarshal(dAtA []byte) error { iNdEx += skippy } } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entropy") + } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *Success) Unmarshal(dAtA []byte) error { +func (m *WipeDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7295,62 +9690,12 @@ func (m *Success) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Success: wiretype end group for non-group") + return fmt.Errorf("proto: WipeDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Success: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WipeDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) - } - var v MessageType - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (MessageType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.MsgType = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Message = &s - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7373,7 +9718,7 @@ func (m *Success) Unmarshal(dAtA []byte) error { } return nil } -func (m *Failure) Unmarshal(dAtA []byte) error { +func (m *LoadDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7396,17 +9741,17 @@ func (m *Failure) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Failure: wiretype end group for non-group") + return fmt.Errorf("proto: LoadDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Failure: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LoadDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mnemonic", wireType) } - var v MessageType + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7416,17 +9761,27 @@ func (m *Failure) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (MessageType(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.MsgType = &v + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Mnemonic = &s + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) } - var v FailureType + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7436,15 +9791,28 @@ func (m *Failure) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (FailureType(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Code = &v + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Node == nil { + m.Node = &HDNodeType{} + } + if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pin", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7470,64 +9838,13 @@ func (m *Failure) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Message = &s + m.Pin = &s iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ButtonRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ButtonRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ButtonRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) } - var v ButtonRequestType + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7537,15 +9854,16 @@ func (m *ButtonRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (ButtonRequestType(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Code = &v - case 2: + b := bool(v != 0) + m.PassphraseProtection = &b + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7571,59 +9889,79 @@ func (m *ButtonRequest) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Data = &s + m.Language = &s iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } - if skippy < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ButtonAck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + s := string(dAtA[iNdEx:postIndex]) + m.Label = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipChecksum", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + b := bool(v != 0) + m.SkipChecksum = &b + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field U2FCounter", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ButtonAck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ButtonAck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.U2FCounter = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7646,7 +9984,7 @@ func (m *ButtonAck) Unmarshal(dAtA []byte) error { } return nil } -func (m *PinMatrixRequest) Unmarshal(dAtA []byte) error { +func (m *ResetDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7669,17 +10007,17 @@ func (m *PinMatrixRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PinMatrixRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ResetDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PinMatrixRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ResetDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DisplayRandom", wireType) } - var v PinMatrixRequestType + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -7689,67 +10027,78 @@ func (m *PinMatrixRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (PinMatrixRequestType(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Type = &v - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err + b := bool(v != 0) + m.DisplayRandom = &b + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Strength", wireType) } - if skippy < 0 { - return ErrInvalidLengthMessages + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + m.Strength = &v + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PinMatrixAck) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { - return io.ErrUnexpectedEOF + b := bool(v != 0) + m.PassphraseProtection = &b + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PinMatrixAck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PinMatrixAck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + b := bool(v != 0) + m.PinProtection = &b + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pin", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7775,63 +10124,79 @@ func (m *PinMatrixAck) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Pin = &s + m.Language = &s iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) } - if skippy < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("pin") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Cancel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + s := string(dAtA[iNdEx:postIndex]) + m.Label = &s + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field U2FCounter", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.U2FCounter = &v + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipBackup", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Cancel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Cancel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.SkipBackup = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7854,7 +10219,7 @@ func (m *Cancel) Unmarshal(dAtA []byte) error { } return nil } -func (m *PassphraseRequest) Unmarshal(dAtA []byte) error { +func (m *BackupDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7877,33 +10242,12 @@ func (m *PassphraseRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PassphraseRequest: wiretype end group for non-group") + return fmt.Errorf("proto: BackupDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PassphraseRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: BackupDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field OnDevice", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.OnDevice = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -7926,7 +10270,7 @@ func (m *PassphraseRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PassphraseAck) Unmarshal(dAtA []byte) error { +func (m *EntropyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7949,73 +10293,12 @@ func (m *PassphraseAck) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PassphraseAck: wiretype end group for non-group") + return fmt.Errorf("proto: EntropyRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PassphraseAck: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EntropyRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Passphrase", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Passphrase = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) - if m.State == nil { - m.State = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -8038,7 +10321,7 @@ func (m *PassphraseAck) Unmarshal(dAtA []byte) error { } return nil } -func (m *PassphraseStateRequest) Unmarshal(dAtA []byte) error { +func (m *EntropyAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8061,15 +10344,15 @@ func (m *PassphraseStateRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PassphraseStateRequest: wiretype end group for non-group") + return fmt.Errorf("proto: EntropyAck: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PassphraseStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EntropyAck: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entropy", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -8093,9 +10376,9 @@ func (m *PassphraseStateRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.State = append(m.State[:0], dAtA[iNdEx:postIndex]...) - if m.State == nil { - m.State = []byte{} + m.Entropy = append(m.Entropy[:0], dAtA[iNdEx:postIndex]...) + if m.Entropy == nil { + m.Entropy = []byte{} } iNdEx = postIndex default: @@ -8120,7 +10403,7 @@ func (m *PassphraseStateRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PassphraseStateAck) Unmarshal(dAtA []byte) error { +func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8143,69 +10426,139 @@ func (m *PassphraseStateAck) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PassphraseStateAck: wiretype end group for non-group") + return fmt.Errorf("proto: RecoveryDevice: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PassphraseStateAck: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RecoveryDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WordCount", wireType) } - if skippy < 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.WordCount = &v + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PassphraseProtection = &b + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.PinProtection = &b + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetRawEntropy) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + s := string(dAtA[iNdEx:postIndex]) + m.Language = &s + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages } - if iNdEx >= l { + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetRawEntropy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetRawEntropy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + s := string(dAtA[iNdEx:postIndex]) + m.Label = &s + iNdEx = postIndex + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType) } - var v uint32 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8215,13 +10568,13 @@ func (m *GetRawEntropy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Size_ = &v - hasFields[0] |= uint64(0x00000001) + b := bool(v != 0) + m.DryRun = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -8238,17 +10591,13 @@ func (m *GetRawEntropy) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("size") - } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *GetMixedEntropy) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 +func (m *WordRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8271,17 +10620,17 @@ func (m *GetMixedEntropy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetMixedEntropy: wiretype end group for non-group") + return fmt.Errorf("proto: WordRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetMixedEntropy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WordRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } - var v uint32 + var v WordRequestType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8291,13 +10640,12 @@ func (m *GetMixedEntropy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (WordRequestType(b) & 0x7F) << shift if b < 0x80 { break } } - m.Size_ = &v - hasFields[0] |= uint64(0x00000001) + m.Type = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -8314,16 +10662,13 @@ func (m *GetMixedEntropy) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("size") - } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *Entropy) Unmarshal(dAtA []byte) error { +func (m *WordAck) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 @@ -8347,17 +10692,17 @@ func (m *Entropy) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Entropy: wiretype end group for non-group") + return fmt.Errorf("proto: WordAck: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Entropy: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WordAck: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entropy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Word", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8367,22 +10712,21 @@ func (m *Entropy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Entropy = append(m.Entropy[:0], dAtA[iNdEx:postIndex]...) - if m.Entropy == nil { - m.Entropy = []byte{} - } + s := string(dAtA[iNdEx:postIndex]) + m.Word = &s iNdEx = postIndex hasFields[0] |= uint64(0x00000001) default: @@ -8402,58 +10746,7 @@ func (m *Entropy) Unmarshal(dAtA []byte) error { } } if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("entropy") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WipeDevice) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WipeDevice: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WipeDevice: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("word") } if iNdEx > l { @@ -8461,7 +10754,7 @@ func (m *WipeDevice) Unmarshal(dAtA []byte) error { } return nil } -func (m *LoadDevice) Unmarshal(dAtA []byte) error { +func (m *FirmwareErase) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8484,131 +10777,17 @@ func (m *LoadDevice) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LoadDevice: wiretype end group for non-group") + return fmt.Errorf("proto: FirmwareErase: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LoadDevice: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FirmwareErase: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mnemonic", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Mnemonic = &s - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Node == nil { - m.Node = &HDNodeType{} - } - if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Pin = &s - iNdEx = postIndex - case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.PassphraseProtection = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } - var stringLen uint64 + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8618,57 +10797,68 @@ func (m *LoadDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + m.Length = &v + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Language = &s - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FirmwareRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages } - postIndex := iNdEx + intStringLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Label = &s - iNdEx = postIndex - case 7: + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FirmwareRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FirmwareRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipChecksum", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - var v int + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8678,16 +10868,15 @@ func (m *LoadDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.SkipChecksum = &b - case 8: + m.Offset = &v + case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field U2FCounter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -8704,7 +10893,7 @@ func (m *LoadDevice) Unmarshal(dAtA []byte) error { break } } - m.U2FCounter = &v + m.Length = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -8727,7 +10916,7 @@ func (m *LoadDevice) Unmarshal(dAtA []byte) error { } return nil } -func (m *ResetDevice) Unmarshal(dAtA []byte) error { +func (m *FirmwareUpload) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8750,17 +10939,17 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ResetDevice: wiretype end group for non-group") + return fmt.Errorf("proto: FirmwareUpload: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ResetDevice: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FirmwareUpload: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DisplayRandom", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) } - var v int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8770,18 +10959,28 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.DisplayRandom = &b + if byteLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Strength", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } - var v uint32 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8791,59 +10990,80 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - m.Strength = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + if byteLen < 0 { + return ErrInvalidLengthMessages } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF } - b := bool(v != 0) - m.PassphraseProtection = &b - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err } - b := bool(v != 0) - m.PinProtection = &b - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + if skippy < 0 { + return ErrInvalidLengthMessages } - var stringLen uint64 + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionSign) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TransactionSign: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionSign: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NbIn", wireType) + } + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8853,27 +11073,18 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Language = &s - iNdEx = postIndex - case 6: + m.NbIn = &v + hasFields[0] |= uint64(0x00000001) + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TransactionIn", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8883,25 +11094,26 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Label = &s + m.TransactionIn = append(m.TransactionIn, &SkycoinTransactionInput{}) + if err := m.TransactionIn[len(m.TransactionIn)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: + case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field U2FCounter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NbOut", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -8918,12 +11130,13 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { break } } - m.U2FCounter = &v - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SkipBackup", wireType) + m.NbOut = &v + hasFields[0] |= uint64(0x00000002) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransactionOut", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -8933,64 +11146,23 @@ func (m *ResetDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.SkipBackup = &b - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if msglen < 0 { return ErrInvalidLengthMessages } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BackupDevice) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.TransactionOut = append(m.TransactionOut, &SkycoinTransactionOutput{}) + if err := m.TransactionOut[len(m.TransactionOut)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BackupDevice: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BackupDevice: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9007,13 +11179,20 @@ func (m *BackupDevice) Unmarshal(dAtA []byte) error { iNdEx += skippy } } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("nbIn") + } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("nbOut") + } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *EntropyRequest) Unmarshal(dAtA []byte) error { +func (m *SignTx) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9036,68 +11215,129 @@ func (m *EntropyRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EntropyRequest: wiretype end group for non-group") + return fmt.Errorf("proto: SignTx: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EntropyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignTx: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutputsCount", wireType) } - if skippy < 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.OutputsCount = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InputsCount", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.InputsCount = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CoinName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EntropyAck) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + s := string(dAtA[iNdEx:postIndex]) + m.CoinName = &s + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.Version = &v + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockTime", wireType) } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EntropyAck: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EntropyAck: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.LockTime = &v + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Entropy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9107,22 +11347,21 @@ func (m *EntropyAck) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Entropy = append(m.Entropy[:0], dAtA[iNdEx:postIndex]...) - if m.Entropy == nil { - m.Entropy = []byte{} + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF } + s := string(dAtA[iNdEx:postIndex]) + m.TxHash = &s iNdEx = postIndex default: iNdEx = preIndex @@ -9140,13 +11379,20 @@ func (m *EntropyAck) Unmarshal(dAtA []byte) error { iNdEx += skippy } } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("outputs_count") + } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("inputs_count") + } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { +func (m *TxRequest) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9169,17 +11415,17 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RecoveryDevice: wiretype end group for non-group") + return fmt.Errorf("proto: TxRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RecoveryDevice: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WordCount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RequestType", wireType) } - var v uint32 + var v TxRequest_RequestType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9189,17 +11435,18 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (TxRequest_RequestType(b) & 0x7F) << shift if b < 0x80 { break } } - m.WordCount = &v + m.RequestType = &v + hasFields[0] |= uint64(0x00000001) case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PassphraseProtection", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9209,18 +11456,30 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.PassphraseProtection = &b + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Details == nil { + m.Details = &TxRequest_TxRequestDetailsType{} + } + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PinProtection", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignResult", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9230,18 +11489,82 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - b := bool(v != 0) - m.PinProtection = &b - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Language", wireType) + if msglen < 0 { + return ErrInvalidLengthMessages } - var stringLen uint64 + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignResult = append(m.SignResult, &TxRequest_TxRequestSignResponseType{}) + if err := m.SignResult[len(m.SignResult)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMessages(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMessages + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("request_type") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxRequest_TxRequestDetailsType) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TxRequestDetailsType: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxRequestDetailsType: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestIndex", wireType) + } + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9251,25 +11574,15 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.Language = &s - iNdEx = postIndex - case 5: + m.RequestIndex = &v + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9295,29 +11608,8 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } s := string(dAtA[iNdEx:postIndex]) - m.Label = &s + m.TxHash = &s iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - b := bool(v != 0) - m.DryRun = &b default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9340,7 +11632,7 @@ func (m *RecoveryDevice) Unmarshal(dAtA []byte) error { } return nil } -func (m *WordRequest) Unmarshal(dAtA []byte) error { +func (m *TxRequest_TxRequestSignResponseType) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9363,17 +11655,17 @@ func (m *WordRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WordRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TxRequestSignResponseType: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WordRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxRequestSignResponseType: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SignatureIndex", wireType) } - var v WordRequestType + var v uint32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9383,12 +11675,42 @@ func (m *WordRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (WordRequestType(b) & 0x7F) << shift + v |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } - m.Type = &v + m.SignatureIndex = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + s := string(dAtA[iNdEx:postIndex]) + m.Signature = &s + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9411,8 +11733,7 @@ func (m *WordRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *WordAck) Unmarshal(dAtA []byte) error { - var hasFields [1]uint64 +func (m *TxAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9435,17 +11756,17 @@ func (m *WordAck) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WordAck: wiretype end group for non-group") + return fmt.Errorf("proto: TxAck: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WordAck: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxAck: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Word", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9455,23 +11776,25 @@ func (m *WordAck) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } - s := string(dAtA[iNdEx:postIndex]) - m.Word = &s + if m.Tx == nil { + m.Tx = &TxAck_TransactionType{} + } + if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - hasFields[0] |= uint64(0x00000001) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9488,16 +11811,13 @@ func (m *WordAck) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("word") - } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *FirmwareErase) Unmarshal(dAtA []byte) error { +func (m *TxAck_TransactionType) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9520,15 +11840,66 @@ func (m *FirmwareErase) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FirmwareErase: wiretype end group for non-group") + return fmt.Errorf("proto: TransactionType: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FirmwareErase: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TransactionType: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Version = &v + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inputs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Inputs = append(m.Inputs, &TxAck_TransactionType_TxInputType{}) + if err := m.Inputs[len(m.Inputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LockTime", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -9545,61 +11916,41 @@ func (m *FirmwareErase) Unmarshal(dAtA []byte) error { break } } - m.Length = &v - default: - iNdEx = preIndex - skippy, err := skipMessages(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMessages + m.LockTime = &v + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outputs", wireType) } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FirmwareRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + if msglen < 0 { + return ErrInvalidLengthMessages } - if iNdEx >= l { + postIndex := iNdEx + msglen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break + m.Outputs = append(m.Outputs, &TxAck_TransactionType_TxOutputType{}) + if err := m.Outputs[len(m.Outputs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FirmwareRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FirmwareRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InputsCnt", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -9616,10 +11967,10 @@ func (m *FirmwareRequest) Unmarshal(dAtA []byte) error { break } } - m.Offset = &v - case 2: + m.InputsCnt = &v + case 7: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OutputsCnt", wireType) } var v uint32 for shift := uint(0); ; shift += 7 { @@ -9636,7 +11987,7 @@ func (m *FirmwareRequest) Unmarshal(dAtA []byte) error { break } } - m.Length = &v + m.OutputsCnt = &v default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9659,7 +12010,8 @@ func (m *FirmwareRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *FirmwareUpload) Unmarshal(dAtA []byte) error { +func (m *TxAck_TransactionType_TxInputType) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9682,48 +12034,90 @@ func (m *FirmwareUpload) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FirmwareUpload: wiretype end group for non-group") + return fmt.Errorf("proto: TxInputType: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FirmwareUpload: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxInputType: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } } - if iNdEx >= l { + m.AddressN = append(m.AddressN, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + packedLen + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } } + elementCount = count + if elementCount != 0 && len(m.AddressN) == 0 { + m.AddressN = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AddressN = append(m.AddressN, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) } - if byteLen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + byteLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HashIn", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9733,23 +12127,23 @@ func (m *FirmwareUpload) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } + s := string(dAtA[iNdEx:postIndex]) + m.HashIn = &s iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9766,13 +12160,16 @@ func (m *FirmwareUpload) Unmarshal(dAtA []byte) error { iNdEx += skippy } } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hashIn") + } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } -func (m *TransactionSign) Unmarshal(dAtA []byte) error { +func (m *TxAck_TransactionType_TxOutputType) Unmarshal(dAtA []byte) error { var hasFields [1]uint64 l := len(dAtA) iNdEx := 0 @@ -9796,38 +12193,17 @@ func (m *TransactionSign) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TransactionSign: wiretype end group for non-group") + return fmt.Errorf("proto: TxOutputType: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TransactionSign: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TxOutputType: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NbIn", wireType) - } - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMessages - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.NbIn = &v - hasFields[0] |= uint64(0x00000001) - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransactionIn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9837,28 +12213,101 @@ func (m *TransactionSign) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthMessages } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } - m.TransactionIn = append(m.TransactionIn, &SkycoinTransactionInput{}) - if err := m.TransactionIn[len(m.TransactionIn)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + s := string(dAtA[iNdEx:postIndex]) + m.Address = &s iNdEx = postIndex + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AddressN = append(m.AddressN, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMessages + } + postIndex := iNdEx + packedLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AddressN) == 0 { + m.AddressN = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMessages + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AddressN = append(m.AddressN, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) + } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NbOut", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) } - var v uint32 + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9868,18 +12317,18 @@ func (m *TransactionSign) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (uint32(b) & 0x7F) << shift + v |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - m.NbOut = &v + m.Coins = &v hasFields[0] |= uint64(0x00000002) case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TransactionOut", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hours", wireType) } - var msglen int + var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMessages @@ -9889,23 +12338,13 @@ func (m *TransactionSign) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + v |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthMessages - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TransactionOut = append(m.TransactionOut, &SkycoinTransactionOutput{}) - if err := m.TransactionOut[len(m.TransactionOut)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.Hours = &v + hasFields[0] |= uint64(0x00000004) default: iNdEx = preIndex skippy, err := skipMessages(dAtA[iNdEx:]) @@ -9923,10 +12362,13 @@ func (m *TransactionSign) Unmarshal(dAtA []byte) error { } } if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("nbIn") + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address") } if hasFields[0]&uint64(0x00000002) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("nbOut") + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("coins") + } + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("hours") } if iNdEx > l { @@ -10039,136 +12481,170 @@ var ( ErrIntOverflowMessages = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("messages.proto", fileDescriptor_messages_dc38627d46042ff4) } - -var fileDescriptor_messages_dc38627d46042ff4 = []byte{ - // 2046 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x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 0x80, 0x1c, 0x71, 0x86, 0xf1, 0x18, 0x36, 0x94, 0x80, 0x24, 0x6a, 0x83, 0xa3, 0xd0, 0x4a, - 0x20, 0xc1, 0x8f, 0x00, 0x8d, 0x83, 0x78, 0xbe, 0x70, 0x63, 0x16, 0x3b, 0xa6, 0x98, 0x24, 0xa6, - 0xc1, 0xb1, 0xeb, 0x19, 0xff, 0x54, 0xb0, 0x8d, 0x8f, 0xa0, 0x4b, 0x30, 0xf6, 0xa9, 0x73, 0xee, - 0x7a, 0x17, 0x69, 0x64, 0xde, 0x14, 0x21, 0x70, 0xde, 0x53, 0xce, 0x62, 0xa1, 0xb3, 0xd3, 0x9a, - 0x99, 0xb7, 0x45, 0xe8, 0x9c, 0x30, 0xee, 0x42, 0x6b, 0xbc, 0x70, 0x78, 0xad, 0x98, 0x9b, 0xfc, - 0xb8, 0x9b, 0xe3, 0xc5, 0x09, 0x23, 0x33, 0x11, 0xab, 0x10, 0xf3, 0x4e, 0x2e, 0x62, 0xa4, 0x14, - 0xf1, 0xba, 0x30, 0xcd, 0x4c, 0x74, 0xca, 0x48, 0x63, 0x0f, 0xd6, 0xc7, 0x8b, 0xac, 0x82, 0x9c, - 0x29, 0x76, 0x7d, 0xf3, 0x2e, 0x37, 0xa8, 0x8f, 0x17, 0xb2, 0x86, 0x5e, 0x62, 0xd7, 0x67, 0xe5, - 0xc1, 0x71, 0xbc, 0xa2, 0xfb, 0xe2, 0x98, 0x18, 0x82, 0xd7, 0xf4, 0x03, 0xe8, 0xe5, 0x42, 0xe7, - 0x02, 0x2f, 0xa9, 0x79, 0x8f, 0x67, 0xbb, 0x9b, 0x21, 0x5e, 0xe1, 0x25, 0x65, 0xc9, 0x4c, 0xc9, - 0x38, 0x20, 0x01, 0x9d, 0x62, 0x3f, 0x8b, 0x7c, 0x4b, 0x24, 0x73, 0x25, 0x90, 0xe1, 0x3f, 0x86, - 0x8d, 0x3c, 0x99, 0x63, 0x79, 0xa7, 0xcc, 0x6d, 0xee, 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85, 0x84, 0x9d, 0x94, 0x23, 0x37, 0xc9, 0x7c, 0xf6, 0x24, 0x5b, 0x9a, 0xb1, 0xbe, 0x80, 0x4d, - 0x1b, 0xd3, 0x28, 0x24, 0x14, 0x97, 0x1c, 0xd8, 0xca, 0x1d, 0xc0, 0xd4, 0xd4, 0x06, 0xf5, 0xfd, - 0xb6, 0xbd, 0x62, 0x58, 0x67, 0x70, 0x27, 0xdb, 0xf7, 0x26, 0x76, 0x09, 0x75, 0x79, 0xda, 0xce, - 0x82, 0x09, 0x61, 0x67, 0x44, 0x83, 0x09, 0x91, 0x45, 0x23, 0x76, 0x2a, 0x1c, 0xc3, 0x84, 0x66, - 0xe4, 0xfa, 0x7e, 0x40, 0x26, 0x66, 0x6d, 0x50, 0xdb, 0x6f, 0xd9, 0x19, 0x69, 0x45, 0xb0, 0x25, - 0x9d, 0x38, 0x9a, 0x62, 0xef, 0xe2, 0x44, 0xbc, 0x0f, 0x67, 0xd9, 0x56, 0xb6, 0x33, 0x8b, 0x46, - 0x64, 0x39, 0x23, 0x99, 0x44, 0xbe, 0x26, 0x5c, 0x67, 0xdb, 0xce, 0x48, 0x16, 0x46, 0x6e, 0xdb, - 0xac, 0x73, 0xd9, 0x8a, 0x61, 0xbd, 0x02, 0x43, 0x5a, 0x64, 0x56, 0xa4, 0xc1, 0xeb, 0x73, 0x7f, - 0xa5, 0x29, 0xeb, 0x08, 0xfa, 0xa5, 0x5c, 0xaa, 0x4a, 0x77, 0xa1, 0xc7, 0xec, 0x62, 0xdf, 0xc9, - 0xb6, 0x8b, 0x18, 0x74, 0xc1, 0x95, 0x30, 0xeb, 0x4f, 0x1a, 0x34, 0x4e, 0x03, 0x32, 0x51, 0xed, - 0x88, 0x2b, 0x94, 0x87, 0xf4, 0x18, 0x36, 0xce, 0xd3, 0x24, 0x09, 0x0b, 0x2f, 0x42, 0x4d, 0xdc, - 0x64, 0x21, 0x50, 0x0a, 0xf9, 0xc3, 0xb7, 0xa3, 0xfe, 0xa3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0xdf, - 0x85, 0x3b, 0x9b, 0xe1, 0x44, 0xfc, 0x77, 0x7b, 0x9e, 0x8e, 0x9f, 0xa2, 0xb3, 0x8c, 0x27, 0x75, - 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, 0x79, 0x95, 0xbc, 0x43, 0xee, 0x15, 0x00, 0x00, +func init() { proto.RegisterFile("messages.proto", fileDescriptor_messages_9ca50c8b3bdd214d) } + +var fileDescriptor_messages_9ca50c8b3bdd214d = []byte{ + // 2587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x59, 0x4b, 0x73, 0xe3, 0xc6, + 0x11, 0x36, 0x48, 0x8a, 0x8f, 0xe6, 0x43, 0x23, 0x58, 0xab, 0xc5, 0x72, 0x57, 0x5a, 0x19, 0x5a, + 0x69, 0xb5, 0x7e, 0x30, 0x8e, 0xec, 0x38, 0x65, 0x55, 0xd9, 0x55, 0x94, 0x56, 0xbb, 0xab, 0xb2, + 0x25, 0xab, 0x20, 0x6e, 0xac, 0x9c, 0x58, 0x10, 0x31, 0x24, 0x11, 0x91, 0x03, 0x1a, 0x00, 0x25, + 0xd1, 0xce, 0xe3, 0x9a, 0x63, 0x72, 0xcb, 0x3f, 0x48, 0xe5, 0x92, 0xca, 0x25, 0x55, 0xa9, 0x1c, + 0x72, 0xf6, 0x31, 0x95, 0x5b, 0x4e, 0x49, 0xf9, 0x9c, 0x73, 0xce, 0xa9, 0x9e, 0x19, 0x80, 0x03, + 0x18, 0xd2, 0xc6, 0xc9, 0x89, 0xd3, 0xdd, 0xdf, 0x74, 0xf7, 0xf4, 0x74, 0xcf, 0xf4, 0x80, 0xd0, + 0x18, 0xd3, 0x20, 0xb0, 0x07, 0x34, 0x68, 0x4d, 0x7c, 0x2f, 0xf4, 0x9a, 0xd5, 0x70, 0x36, 0x89, + 0x08, 0xd3, 0x04, 0x38, 0x64, 0x6e, 0xe8, 0xda, 0x23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xfe, + 0xa9, 0x92, 0xbc, 0xd6, 0x2c, 0xfc, 0xea, 0x8f, 0x86, 0xa6, 0x37, 0x81, 0xa8, 0x08, 0x7c, 0x71, + 0x11, 0x4d, 0xca, 0x56, 0xe1, 0x75, 0x55, 0x26, 0x9f, 0x38, 0x24, 0xd7, 0x2c, 0xfc, 0x26, 0x43, + 0x2c, 0x9f, 0x1c, 0x24, 0x2f, 0xc5, 0x0f, 0xe1, 0x8e, 0x2a, 0x8e, 0x3f, 0x2e, 0x90, 0x82, 0x54, + 0x9f, 0x72, 0x6e, 0xde, 0x8e, 0x92, 0x05, 0x89, 0x78, 0x0c, 0xf7, 0x12, 0x16, 0xd4, 0xdb, 0x8d, + 0x14, 0x9b, 0x65, 0x04, 0xfd, 0x09, 0x81, 0xdb, 0xd0, 0xcc, 0x02, 0x8a, 0xab, 0x89, 0x94, 0x14, + 0xe4, 0x46, 0x52, 0x65, 0xa2, 0xe9, 0x26, 0x95, 0xec, 0x85, 0x47, 0x62, 0x90, 0x2b, 0x4b, 0x39, + 0x3e, 0x6f, 0x9c, 0x49, 0x5d, 0x2a, 0x78, 0x03, 0xee, 0xaa, 0x08, 0xa5, 0x8d, 0x24, 0x0d, 0x09, + 0x59, 0x83, 0xe5, 0x84, 0xcb, 0xf2, 0x2b, 0x15, 0x59, 0x92, 0x46, 0xb6, 0xe0, 0x41, 0x6a, 0x63, + 0x12, 0xcf, 0x24, 0xa2, 0xc7, 0x38, 0x23, 0x13, 0xd7, 0xee, 0x5d, 0x90, 0xd7, 0xc5, 0xc2, 0xff, + 0x80, 0xb8, 0x07, 0xa0, 0x27, 0xb6, 0x83, 0x3f, 0x9b, 0xc8, 0xb2, 0xf4, 0x26, 0x15, 0x96, 0xc4, + 0x67, 0x32, 0x72, 0x2f, 0x1b, 0x94, 0x78, 0x16, 0x92, 0xa6, 0xf4, 0x67, 0x23, 0xb9, 0xed, 0xf1, + 0x63, 0x90, 0xdc, 0x57, 0x9c, 0x31, 0x93, 0x4e,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, + 0x67, 0x52, 0x9a, 0x3a, 0x8a, 0xe3, 0x66, 0x86, 0xfc, 0x5c, 0x5a, 0xb9, 0x0f, 0x4b, 0x49, 0x00, + 0xe6, 0xc2, 0x2f, 0xc4, 0xec, 0xbd, 0x8f, 0xbf, 0xfe, 0x66, 0x4d, 0xfb, 0xeb, 0x37, 0x6b, 0xda, + 0x3f, 0xbf, 0x59, 0xd3, 0x60, 0x8d, 0xd1, 0xb0, 0x15, 0x88, 0x70, 0xe1, 0xef, 0x95, 0x3d, 0x1a, + 0xd1, 0x50, 0xfc, 0x1d, 0x76, 0x3e, 0xed, 0xef, 0x91, 0xd3, 0x88, 0x27, 0x35, 0xfe, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x65, 0xa9, 0x52, 0x89, 0x41, 0x1b, 0x00, 0x00, } diff --git a/vendor/github.com/skycoin/hardware-wallet-protob/go/types.pb.go b/vendor/github.com/fibercrypto/skywallet-protob/go/types.pb.go similarity index 83% rename from vendor/github.com/skycoin/hardware-wallet-protob/go/types.pb.go rename to vendor/github.com/fibercrypto/skywallet-protob/go/types.pb.go index 4f7639a..28adc91 100644 --- a/vendor/github.com/skycoin/hardware-wallet-protob/go/types.pb.go +++ b/vendor/github.com/fibercrypto/skywallet-protob/go/types.pb.go @@ -6,7 +6,7 @@ package messages import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" -import protobuf "github.com/skycoin/hardware-wallet-protob/go/google/protobuf" +import protobuf "github.com/fibercrypto/skywallet-protob/go/google/protobuf" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" @@ -98,7 +98,7 @@ func (x *FailureType) UnmarshalJSON(data []byte) error { return nil } func (FailureType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{0} + return fileDescriptor_types_0bfb6936339e7e82, []int{0} } // * @@ -149,7 +149,7 @@ func (x *OutputScriptType) UnmarshalJSON(data []byte) error { return nil } func (OutputScriptType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{1} + return fileDescriptor_types_0bfb6936339e7e82, []int{1} } // * @@ -197,7 +197,7 @@ func (x *InputScriptType) UnmarshalJSON(data []byte) error { return nil } func (InputScriptType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{2} + return fileDescriptor_types_0bfb6936339e7e82, []int{2} } // * @@ -245,7 +245,7 @@ func (x *RequestType) UnmarshalJSON(data []byte) error { return nil } func (RequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{3} + return fileDescriptor_types_0bfb6936339e7e82, []int{3} } // * @@ -320,7 +320,7 @@ func (x *ButtonRequestType) UnmarshalJSON(data []byte) error { return nil } func (ButtonRequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{4} + return fileDescriptor_types_0bfb6936339e7e82, []int{4} } // * @@ -362,7 +362,7 @@ func (x *PinMatrixRequestType) UnmarshalJSON(data []byte) error { return nil } func (PinMatrixRequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{5} + return fileDescriptor_types_0bfb6936339e7e82, []int{5} } // * @@ -404,7 +404,7 @@ func (x *WordRequestType) UnmarshalJSON(data []byte) error { return nil } func (WordRequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{6} + return fileDescriptor_types_0bfb6936339e7e82, []int{6} } // * @@ -454,12 +454,10 @@ func (x *FirmwareFeatures) UnmarshalJSON(data []byte) error { return nil } func (FirmwareFeatures) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{7} + return fileDescriptor_types_0bfb6936339e7e82, []int{7} } -// * -// Ask Skywallet to generate a skycoin address -// @used_in SkycoinAddress +// TODO remove this type SkycoinAddressType int32 const ( @@ -493,16 +491,10 @@ func (x *SkycoinAddressType) UnmarshalJSON(data []byte) error { return nil } func (SkycoinAddressType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{8} + return fileDescriptor_types_0bfb6936339e7e82, []int{8} } -// * -// Structure representing BIP32 (hierarchical deterministic) node -// Used for imports of private key into the device and exporting public key out of device -// @used_in PublicKey -// @used_in LoadDevice -// @used_in DebugLinkState -// @used_in Storage +// TODO remove this type HDNodeType struct { Depth *uint32 `protobuf:"varint,1,req,name=depth" json:"depth,omitempty"` Fingerprint *uint32 `protobuf:"varint,2,req,name=fingerprint" json:"fingerprint,omitempty"` @@ -519,7 +511,7 @@ func (m *HDNodeType) Reset() { *m = HDNodeType{} } func (m *HDNodeType) String() string { return proto.CompactTextString(m) } func (*HDNodeType) ProtoMessage() {} func (*HDNodeType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{0} + return fileDescriptor_types_0bfb6936339e7e82, []int{0} } func (m *HDNodeType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -590,6 +582,7 @@ func (m *HDNodeType) GetPublicKey() []byte { return nil } +// TODO remove this type HDNodePathType struct { Node *HDNodeType `protobuf:"bytes,1,req,name=node" json:"node,omitempty"` AddressN []uint32 `protobuf:"varint,2,rep,name=address_n,json=addressN" json:"address_n,omitempty"` @@ -602,7 +595,7 @@ func (m *HDNodePathType) Reset() { *m = HDNodePathType{} } func (m *HDNodePathType) String() string { return proto.CompactTextString(m) } func (*HDNodePathType) ProtoMessage() {} func (*HDNodePathType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{1} + return fileDescriptor_types_0bfb6936339e7e82, []int{1} } func (m *HDNodePathType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -669,7 +662,7 @@ func (m *CoinType) Reset() { *m = CoinType{} } func (m *CoinType) String() string { return proto.CompactTextString(m) } func (*CoinType) ProtoMessage() {} func (*CoinType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{2} + return fileDescriptor_types_0bfb6936339e7e82, []int{2} } func (m *CoinType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -780,9 +773,7 @@ func (m *CoinType) GetForceBip143() bool { return false } -// * -// Type of redeem script used in input -// @used_in TxInputType +// TODO remove this type MultisigRedeemScriptType struct { Pubkeys []*HDNodePathType `protobuf:"bytes,1,rep,name=pubkeys" json:"pubkeys,omitempty"` Signatures [][]byte `protobuf:"bytes,2,rep,name=signatures" json:"signatures,omitempty"` @@ -796,7 +787,7 @@ func (m *MultisigRedeemScriptType) Reset() { *m = MultisigRedeemScriptTy func (m *MultisigRedeemScriptType) String() string { return proto.CompactTextString(m) } func (*MultisigRedeemScriptType) ProtoMessage() {} func (*MultisigRedeemScriptType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{3} + return fileDescriptor_types_0bfb6936339e7e82, []int{3} } func (m *MultisigRedeemScriptType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -870,7 +861,7 @@ func (m *TxInputType) Reset() { *m = TxInputType{} } func (m *TxInputType) String() string { return proto.CompactTextString(m) } func (*TxInputType) ProtoMessage() {} func (*TxInputType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{4} + return fileDescriptor_types_0bfb6936339e7e82, []int{4} } func (m *TxInputType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -993,7 +984,7 @@ func (m *TxOutputType) Reset() { *m = TxOutputType{} } func (m *TxOutputType) String() string { return proto.CompactTextString(m) } func (*TxOutputType) ProtoMessage() {} func (*TxOutputType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{5} + return fileDescriptor_types_0bfb6936339e7e82, []int{5} } func (m *TxOutputType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1087,7 +1078,7 @@ func (m *TxOutputBinType) Reset() { *m = TxOutputBinType{} } func (m *TxOutputBinType) String() string { return proto.CompactTextString(m) } func (*TxOutputBinType) ProtoMessage() {} func (*TxOutputBinType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{6} + return fileDescriptor_types_0bfb6936339e7e82, []int{6} } func (m *TxOutputBinType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1160,7 +1151,7 @@ func (m *TransactionType) Reset() { *m = TransactionType{} } func (m *TransactionType) String() string { return proto.CompactTextString(m) } func (*TransactionType) ProtoMessage() {} func (*TransactionType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{7} + return fileDescriptor_types_0bfb6936339e7e82, []int{7} } func (m *TransactionType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1276,7 +1267,7 @@ func (m *TxRequestDetailsType) Reset() { *m = TxRequestDetailsType{} } func (m *TxRequestDetailsType) String() string { return proto.CompactTextString(m) } func (*TxRequestDetailsType) ProtoMessage() {} func (*TxRequestDetailsType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{8} + return fileDescriptor_types_0bfb6936339e7e82, []int{8} } func (m *TxRequestDetailsType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1349,7 +1340,7 @@ func (m *TxRequestSerializedType) Reset() { *m = TxRequestSerializedType func (m *TxRequestSerializedType) String() string { return proto.CompactTextString(m) } func (*TxRequestSerializedType) ProtoMessage() {} func (*TxRequestSerializedType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{9} + return fileDescriptor_types_0bfb6936339e7e82, []int{9} } func (m *TxRequestSerializedType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1418,7 +1409,7 @@ func (m *IdentityType) Reset() { *m = IdentityType{} } func (m *IdentityType) String() string { return proto.CompactTextString(m) } func (*IdentityType) ProtoMessage() {} func (*IdentityType) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{10} + return fileDescriptor_types_0bfb6936339e7e82, []int{10} } func (m *IdentityType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1495,18 +1486,19 @@ func (m *IdentityType) GetIndex() uint32 { // Skycoin transaction input // @used_in TransactionSign type SkycoinTransactionInput struct { - HashIn *string `protobuf:"bytes,1,req,name=hashIn" json:"hashIn,omitempty"` - Index *uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + HashIn *string `protobuf:"bytes,1,req,name=hashIn" json:"hashIn,omitempty"` + Index *uint32 `protobuf:"varint,2,opt,name=index" json:"index,omitempty"` + Bip44Addr *Bip44AddrIndex `protobuf:"bytes,3,opt,name=bip44_addr,json=bip44Addr" json:"bip44_addr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SkycoinTransactionInput) Reset() { *m = SkycoinTransactionInput{} } func (m *SkycoinTransactionInput) String() string { return proto.CompactTextString(m) } func (*SkycoinTransactionInput) ProtoMessage() {} func (*SkycoinTransactionInput) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{11} + return fileDescriptor_types_0bfb6936339e7e82, []int{11} } func (m *SkycoinTransactionInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1549,24 +1541,32 @@ func (m *SkycoinTransactionInput) GetIndex() uint32 { return 0 } +func (m *SkycoinTransactionInput) GetBip44Addr() *Bip44AddrIndex { + if m != nil { + return m.Bip44Addr + } + return nil +} + // * // Skycoin transaction output // @used_in TransactionSign type SkycoinTransactionOutput struct { - Address *string `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` - Coin *uint64 `protobuf:"varint,2,req,name=coin" json:"coin,omitempty"` - Hour *uint64 `protobuf:"varint,3,req,name=hour" json:"hour,omitempty"` - AddressIndex *uint32 `protobuf:"varint,4,opt,name=address_index,json=addressIndex" json:"address_index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Address *string `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` + Coin *uint64 `protobuf:"varint,2,req,name=coin" json:"coin,omitempty"` + Hour *uint64 `protobuf:"varint,3,req,name=hour" json:"hour,omitempty"` + AddressIndex *uint32 `protobuf:"varint,4,opt,name=address_index,json=addressIndex" json:"address_index,omitempty"` + Bip44Addr *Bip44AddrIndex `protobuf:"bytes,5,opt,name=bip44_addr,json=bip44Addr" json:"bip44_addr,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SkycoinTransactionOutput) Reset() { *m = SkycoinTransactionOutput{} } func (m *SkycoinTransactionOutput) String() string { return proto.CompactTextString(m) } func (*SkycoinTransactionOutput) ProtoMessage() {} func (*SkycoinTransactionOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_types_3b468024de05fa62, []int{12} + return fileDescriptor_types_0bfb6936339e7e82, []int{12} } func (m *SkycoinTransactionOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1623,6 +1623,92 @@ func (m *SkycoinTransactionOutput) GetAddressIndex() uint32 { return 0 } +func (m *SkycoinTransactionOutput) GetBip44Addr() *Bip44AddrIndex { + if m != nil { + return m.Bip44Addr + } + return nil +} + +type Bip44AddrIndex struct { + CoinType *uint32 `protobuf:"varint,1,req,name=coin_type,json=coinType" json:"coin_type,omitempty"` + Account *uint32 `protobuf:"varint,2,req,name=account" json:"account,omitempty"` + Change *uint32 `protobuf:"varint,3,req,name=change" json:"change,omitempty"` + AddressStartIndex *uint32 `protobuf:"varint,4,req,name=address_start_index,json=addressStartIndex" json:"address_start_index,omitempty"` + AddressN *uint32 `protobuf:"varint,5,req,name=address_n,json=addressN" json:"address_n,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Bip44AddrIndex) Reset() { *m = Bip44AddrIndex{} } +func (m *Bip44AddrIndex) String() string { return proto.CompactTextString(m) } +func (*Bip44AddrIndex) ProtoMessage() {} +func (*Bip44AddrIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_types_0bfb6936339e7e82, []int{13} +} +func (m *Bip44AddrIndex) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bip44AddrIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bip44AddrIndex.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Bip44AddrIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bip44AddrIndex.Merge(dst, src) +} +func (m *Bip44AddrIndex) XXX_Size() int { + return m.Size() +} +func (m *Bip44AddrIndex) XXX_DiscardUnknown() { + xxx_messageInfo_Bip44AddrIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_Bip44AddrIndex proto.InternalMessageInfo + +func (m *Bip44AddrIndex) GetCoinType() uint32 { + if m != nil && m.CoinType != nil { + return *m.CoinType + } + return 0 +} + +func (m *Bip44AddrIndex) GetAccount() uint32 { + if m != nil && m.Account != nil { + return *m.Account + } + return 0 +} + +func (m *Bip44AddrIndex) GetChange() uint32 { + if m != nil && m.Change != nil { + return *m.Change + } + return 0 +} + +func (m *Bip44AddrIndex) GetAddressStartIndex() uint32 { + if m != nil && m.AddressStartIndex != nil { + return *m.AddressStartIndex + } + return 0 +} + +func (m *Bip44AddrIndex) GetAddressN() uint32 { + if m != nil && m.AddressN != nil { + return *m.AddressN + } + return 0 +} + var E_WireIn = &proto.ExtensionDesc{ ExtendedType: (*protobuf.EnumValueOptions)(nil), ExtensionType: (*bool)(nil), @@ -1691,6 +1777,7 @@ func init() { proto.RegisterType((*IdentityType)(nil), "IdentityType") proto.RegisterType((*SkycoinTransactionInput)(nil), "SkycoinTransactionInput") proto.RegisterType((*SkycoinTransactionOutput)(nil), "SkycoinTransactionOutput") + proto.RegisterType((*Bip44AddrIndex)(nil), "Bip44AddrIndex") proto.RegisterEnum("FailureType", FailureType_name, FailureType_value) proto.RegisterEnum("OutputScriptType", OutputScriptType_name, OutputScriptType_value) proto.RegisterEnum("InputScriptType", InputScriptType_name, InputScriptType_value) @@ -2395,6 +2482,16 @@ func (m *SkycoinTransactionInput) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(*m.Index)) } + if m.Bip44Addr != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Bip44Addr.Size())) + n4, err := m.Bip44Addr.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } @@ -2443,6 +2540,72 @@ func (m *SkycoinTransactionOutput) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTypes(dAtA, i, uint64(*m.AddressIndex)) } + if m.Bip44Addr != nil { + dAtA[i] = 0x2a + i++ + i = encodeVarintTypes(dAtA, i, uint64(m.Bip44Addr.Size())) + n5, err := m.Bip44Addr.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n5 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *Bip44AddrIndex) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Bip44AddrIndex) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.CoinType == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("coin_type") + } else { + dAtA[i] = 0x8 + i++ + i = encodeVarintTypes(dAtA, i, uint64(*m.CoinType)) + } + if m.Account == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("account") + } else { + dAtA[i] = 0x10 + i++ + i = encodeVarintTypes(dAtA, i, uint64(*m.Account)) + } + if m.Change == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("change") + } else { + dAtA[i] = 0x18 + i++ + i = encodeVarintTypes(dAtA, i, uint64(*m.Change)) + } + if m.AddressStartIndex == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_start_index") + } else { + dAtA[i] = 0x20 + i++ + i = encodeVarintTypes(dAtA, i, uint64(*m.AddressStartIndex)) + } + if m.AddressN == nil { + return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } else { + dAtA[i] = 0x28 + i++ + i = encodeVarintTypes(dAtA, i, uint64(*m.AddressN)) + } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } @@ -2842,6 +3005,10 @@ func (m *SkycoinTransactionInput) Size() (n int) { if m.Index != nil { n += 1 + sovTypes(uint64(*m.Index)) } + if m.Bip44Addr != nil { + l = m.Bip44Addr.Size() + n += 1 + l + sovTypes(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2867,6 +3034,37 @@ func (m *SkycoinTransactionOutput) Size() (n int) { if m.AddressIndex != nil { n += 1 + sovTypes(uint64(*m.AddressIndex)) } + if m.Bip44Addr != nil { + l = m.Bip44Addr.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Bip44AddrIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CoinType != nil { + n += 1 + sovTypes(uint64(*m.CoinType)) + } + if m.Account != nil { + n += 1 + sovTypes(uint64(*m.Account)) + } + if m.Change != nil { + n += 1 + sovTypes(uint64(*m.Change)) + } + if m.AddressStartIndex != nil { + n += 1 + sovTypes(uint64(*m.AddressStartIndex)) + } + if m.AddressN != nil { + n += 1 + sovTypes(uint64(*m.AddressN)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -5341,6 +5539,39 @@ func (m *SkycoinTransactionInput) Unmarshal(dAtA []byte) error { } } m.Index = &v + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bip44Addr", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bip44Addr == nil { + m.Bip44Addr = &Bip44AddrIndex{} + } + if err := m.Bip44Addr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -5489,6 +5720,39 @@ func (m *SkycoinTransactionOutput) Unmarshal(dAtA []byte) error { } } m.AddressIndex = &v + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bip44Addr", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Bip44Addr == nil { + m.Bip44Addr = &Bip44AddrIndex{} + } + if err := m.Bip44Addr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -5520,6 +5784,178 @@ func (m *SkycoinTransactionOutput) Unmarshal(dAtA []byte) error { } return nil } +func (m *Bip44AddrIndex) Unmarshal(dAtA []byte) error { + var hasFields [1]uint64 + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Bip44AddrIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bip44AddrIndex: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.CoinType = &v + hasFields[0] |= uint64(0x00000001) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Account = &v + hasFields[0] |= uint64(0x00000002) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Change = &v + hasFields[0] |= uint64(0x00000004) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressStartIndex", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AddressStartIndex = &v + hasFields[0] |= uint64(0x00000008) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressN", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AddressN = &v + hasFields[0] |= uint64(0x00000010) + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + if hasFields[0]&uint64(0x00000001) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("coin_type") + } + if hasFields[0]&uint64(0x00000002) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("account") + } + if hasFields[0]&uint64(0x00000004) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("change") + } + if hasFields[0]&uint64(0x00000008) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_start_index") + } + if hasFields[0]&uint64(0x00000010) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("address_n") + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -5625,147 +6061,153 @@ var ( ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("types.proto", fileDescriptor_types_3b468024de05fa62) } - -var fileDescriptor_types_3b468024de05fa62 = []byte{ - // 2220 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0x4b, 0x6f, 0xdb, 0xca, - 0xf5, 0x0f, 0x25, 0xd9, 0x96, 0x8e, 0x28, 0x7b, 0xcc, 0x3c, 0xcc, 0xdc, 0x38, 0x89, 0xe2, 0xe4, - 0x7f, 0xe3, 0xbf, 0x81, 0xea, 0xde, 0xab, 0x9b, 0x38, 0x8d, 0x51, 0xb4, 0xb5, 0x2d, 0x39, 0x16, - 0x12, 0xcb, 0x02, 0x45, 0xdf, 0xb8, 0xdd, 0x10, 0x14, 0x39, 0x96, 0x06, 0xa6, 0x48, 0x76, 0x38, - 0x74, 0xa4, 0x6e, 0x8a, 0x16, 0x68, 0xbb, 0xea, 0xa6, 0x9b, 0xee, 0x8b, 0xb6, 0x9f, 0xa3, 0xbb, - 0x76, 0x59, 0xf4, 0xb9, 0x2d, 0xf2, 0x19, 0xfa, 0x01, 0x8a, 0x79, 0x50, 0x0f, 0x3b, 0x2e, 0xbc, - 0xd3, 0xfc, 0x7e, 0xe7, 0x9c, 0x39, 0x6f, 0x8d, 0x04, 0x65, 0x36, 0x8e, 0x71, 0x52, 0x8b, 0x69, - 0xc4, 0xa2, 0xcf, 0xaa, 0xfd, 0x28, 0xea, 0x07, 0xf8, 0x0b, 0x71, 0xea, 0xa5, 0x67, 0x5f, 0xf8, - 0x38, 0xf1, 0x28, 0x89, 0x59, 0x44, 0xa5, 0xc4, 0xc6, 0x1f, 0x35, 0x80, 0xc3, 0x46, 0x3b, 0xf2, - 0xb1, 0x3d, 0x8e, 0xb1, 0x71, 0x07, 0x16, 0x7c, 0x1c, 0xb3, 0x81, 0xa9, 0x55, 0x73, 0x9b, 0x15, - 0x4b, 0x1e, 0x8c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0x14, 0x66, - 0xc5, 0xca, 0x34, 0x35, 0xa1, 0x99, 0x1d, 0x8d, 0x67, 0xb0, 0x48, 0x78, 0xa3, 0xca, 0xb1, 0x2c, - 0xd7, 0xf5, 0xda, 0xcc, 0xe8, 0x59, 0x8a, 0x33, 0xbe, 0x82, 0x72, 0x8f, 0x84, 0x4e, 0x24, 0x22, - 0x4b, 0xcc, 0xbc, 0x10, 0x45, 0xb5, 0x4b, 0xb1, 0x5a, 0xd0, 0x23, 0xa1, 0x44, 0x44, 0x17, 0x04, - 0x91, 0x77, 0xee, 0x30, 0x32, 0xc4, 0x62, 0xb6, 0x2a, 0x56, 0x91, 0x03, 0x36, 0x19, 0x62, 0xe3, - 0x39, 0x2c, 0x65, 0xb6, 0x16, 0x84, 0xad, 0x4a, 0x6d, 0xb6, 0xb9, 0xac, 0x8c, 0xe5, 0x23, 0x2a, - 0x5d, 0x70, 0xbc, 0x90, 0x89, 0x3a, 0x55, 0xac, 0x92, 0x44, 0xf6, 0x65, 0xab, 0x2b, 0x49, 0xc1, - 0xcb, 0xd2, 0x80, 0x82, 0xb8, 0xc0, 0x43, 0x00, 0x3c, 0x62, 0xd4, 0x95, 0x75, 0x2e, 0xca, 0x11, - 0x17, 0x88, 0x28, 0xf2, 0x33, 0x58, 0x9e, 0xd2, 0x4e, 0x80, 0x43, 0x35, 0x2d, 0xfa, 0x44, 0xe4, - 0x1d, 0x0e, 0x79, 0xa9, 0x54, 0x15, 0xf0, 0x28, 0x26, 0x74, 0xac, 0xe6, 0x44, 0x97, 0x60, 0x53, - 0x60, 0x1b, 0x7f, 0xd0, 0xe0, 0x8e, 0x3d, 0xb2, 0xf8, 0x52, 0x48, 0x58, 0x03, 0x33, 0x97, 0x04, - 0xf2, 0x8b, 0xe6, 0x29, 0x54, 0xa8, 0x44, 0xd5, 0x1e, 0x92, 0x15, 0xd0, 0x15, 0x28, 0x57, 0xd1, - 0x1a, 0x2c, 0xb1, 0x51, 0xb6, 0xc4, 0xb8, 0x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xcf, 0xbd, 0x68, 0x58, 0x4b, 0x5c, 0x16, 0x25, - 0x03, 0x12, 0xb8, 0xbd, 0xa4, 0xd6, 0x3d, 0x1f, 0x7f, 0x70, 0x83, 0x00, 0xb3, 0x5a, 0x40, 0x7a, - 0x13, 0xf3, 0x7b, 0x95, 0x09, 0xce, 0xeb, 0xfd, 0xc3, 0xa2, 0xfa, 0x1b, 0x24, 0xf9, 0x6f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x0d, 0x3c, 0xab, 0x5b, 0x1d, 0x13, 0x00, 0x00, +func init() { proto.RegisterFile("types.proto", fileDescriptor_types_0bfb6936339e7e82) } + +var fileDescriptor_types_0bfb6936339e7e82 = []byte{ + // 2320 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x58, 0x49, 0x73, 0x23, 0x49, + 0xf5, 0xef, 0x92, 0x64, 0x5b, 0x7a, 0x92, 0xec, 0xec, 0xec, 0xc5, 0xea, 0x99, 0x5e, 0xd4, 0xee, + 0xfe, 0xcf, 0xf8, 0xef, 0x08, 0x34, 0x33, 0x9a, 0x5e, 0x68, 0x07, 0x01, 0xd8, 0x96, 0xdc, 0x56, + 0x4c, 0x5b, 0x56, 0x94, 0xaa, 0x67, 0x0c, 0x97, 0x8a, 0x52, 0x55, 0x5a, 0xca, 0x70, 0x29, 0xab, + 0xc8, 0xca, 0x72, 0x4b, 0x5c, 0x88, 0x20, 0x02, 0x38, 0x71, 0xe1, 0xc2, 0x9d, 0x00, 0x4e, 0x5c, + 0xf8, 0x06, 0xdc, 0xe0, 0x48, 0xb0, 0x5e, 0x89, 0xf9, 0x0c, 0x7c, 0x00, 0x22, 0x97, 0xd2, 0xe2, + 0x6e, 0x43, 0xdf, 0x94, 0xbf, 0xdf, 0xcb, 0x97, 0x6f, 0xcf, 0x54, 0x41, 0x59, 0x4c, 0x63, 0x92, + 0x34, 0x62, 0x1e, 0x89,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, 0x22, 0xaf, 0x08, 0x93, 0xa9, 0x32, 0x59, 0x20, 0x93, 0x98, 0xf2, 0xa9, 0xe9, + 0x93, 0x8a, 0x06, 0xdb, 0x0a, 0xdb, 0xfa, 0xad, 0x05, 0x37, 0x9d, 0x89, 0x2d, 0x87, 0x42, 0x22, + 0x5a, 0x44, 0x78, 0x34, 0xd4, 0x17, 0xcd, 0x23, 0xa8, 0x72, 0x8d, 0x9a, 0x39, 0xa4, 0x33, 0x50, + 0x31, 0xa0, 0x1e, 0x45, 0x9b, 0xb0, 0x26, 0x26, 0xd9, 0x10, 0x93, 0x46, 0xae, 0x8a, 0x89, 0x1a, + 0x61, 0x6f, 0x5b, 0x98, 0x7f, 0x87, 0x85, 0x3b, 0x70, 0x7d, 0x41, 0x2a, 0x3a, 0x3b, 0x4b, 0x88, + 0x30, 0x41, 0xdf, 0x98, 0x09, 0x9e, 0x28, 0x78, 0xeb, 0x27, 0x16, 0x6c, 0xce, 0x0c, 0xed, 0x13, + 0x4e, 0xbd, 0x90, 0xfe, 0x90, 0x04, 0xca, 0xd6, 0x8f, 0x61, 0x63, 0x36, 0x96, 0x97, 0xac, 0x5d, + 0x9f, 0xc1, 0xda, 0xde, 0xbb, 0x50, 0x9a, 0x21, 0xc6, 0xe2, 0x39, 0xa0, 0x6a, 0x7b, 0xa6, 0xd8, + 0x15, 0x13, 0x65, 0xb3, 0xac, 0xed, 0xf9, 0x69, 0x93, 0xad, 0x9f, 0x5b, 0x50, 0xe9, 0x04, 0x84, + 0x09, 0x2a, 0xa6, 0xd9, 0x53, 0x48, 0x3d, 0x91, 0xcc, 0x3c, 0xd1, 0x0b, 0x8c, 0xa1, 0x90, 0x26, + 0x84, 0x9b, 0x9b, 0x5e, 0xfd, 0x96, 0xd8, 0x28, 0x4a, 0x84, 0x52, 0x5b, 0xb2, 0xd5, 0x6f, 0x89, + 0xc5, 0x11, 0xd7, 0x5e, 0x97, 0x6c, 0xf5, 0x5b, 0x61, 0x9e, 0xd0, 0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 0x45, 0xf3, 0x55, + 0x28, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x24, 0x5f, 0xfb, 0x2c, 0x14, 0x00, 0x00, } diff --git a/vendor/github.com/gogo/protobuf/proto/encode.go b/vendor/github.com/gogo/protobuf/proto/encode.go index 3abfed2..9581ccd 100644 --- a/vendor/github.com/gogo/protobuf/proto/encode.go +++ b/vendor/github.com/gogo/protobuf/proto/encode.go @@ -189,6 +189,8 @@ type Marshaler interface { // prefixed by a varint-encoded length. func (p *Buffer) EncodeMessage(pb Message) error { siz := Size(pb) + sizVar := SizeVarint(uint64(siz)) + p.grow(siz + sizVar) p.EncodeVarint(uint64(siz)) return p.Marshal(pb) } diff --git a/vendor/github.com/gogo/protobuf/proto/extensions.go b/vendor/github.com/gogo/protobuf/proto/extensions.go index 686bd2a..341c6f5 100644 --- a/vendor/github.com/gogo/protobuf/proto/extensions.go +++ b/vendor/github.com/gogo/protobuf/proto/extensions.go @@ -527,6 +527,7 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) { // SetExtension sets the specified extension of pb to the specified value. func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error { if epb, ok := pb.(extensionsBytes); ok { + ClearExtension(pb, extension) newb, err := encodeExtension(extension, value) if err != nil { return err diff --git a/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go b/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go index 53ebd8c..6f1ae12 100644 --- a/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go +++ b/vendor/github.com/gogo/protobuf/proto/extensions_gogo.go @@ -154,6 +154,10 @@ func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error) return EncodeExtensionMap(m.extensionsWrite(), data) } +func EncodeInternalExtensionBackwards(m extendableProto, data []byte) (n int, err error) { + return EncodeExtensionMapBackwards(m.extensionsWrite(), data) +} + func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) { o := 0 for _, e := range m { @@ -169,6 +173,23 @@ func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) { return o, nil } +func EncodeExtensionMapBackwards(m map[int32]Extension, data []byte) (n int, err error) { + o := 0 + end := len(data) + for _, e := range m { + if err := e.Encode(); err != nil { + return 0, err + } + n := copy(data[end-len(e.enc):], e.enc) + if n != len(e.enc) { + return 0, io.ErrShortBuffer + } + end -= n + o += n + } + return o, nil +} + func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) { e := m[id] if err := e.Encode(); err != nil { diff --git a/vendor/github.com/gogo/protobuf/proto/lib.go b/vendor/github.com/gogo/protobuf/proto/lib.go index d17f802..80db1c1 100644 --- a/vendor/github.com/gogo/protobuf/proto/lib.go +++ b/vendor/github.com/gogo/protobuf/proto/lib.go @@ -948,13 +948,19 @@ func isProto3Zero(v reflect.Value) bool { return false } -// ProtoPackageIsVersion2 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const GoGoProtoPackageIsVersion2 = true - -// ProtoPackageIsVersion1 is referenced from generated protocol buffer files -// to assert that that code is compatible with this version of the proto package. -const GoGoProtoPackageIsVersion1 = true +const ( + // ProtoPackageIsVersion3 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + GoGoProtoPackageIsVersion3 = true + + // ProtoPackageIsVersion2 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + GoGoProtoPackageIsVersion2 = true + + // ProtoPackageIsVersion1 is referenced from generated protocol buffer files + // to assert that that code is compatible with this version of the proto package. + GoGoProtoPackageIsVersion1 = true +) // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. diff --git a/vendor/github.com/gogo/protobuf/proto/properties.go b/vendor/github.com/gogo/protobuf/proto/properties.go index c9e5fa0..28da147 100644 --- a/vendor/github.com/gogo/protobuf/proto/properties.go +++ b/vendor/github.com/gogo/protobuf/proto/properties.go @@ -43,7 +43,6 @@ package proto import ( "fmt" "log" - "os" "reflect" "sort" "strconv" @@ -205,7 +204,7 @@ func (p *Properties) Parse(s string) { // "bytes,49,opt,name=foo,def=hello!" fields := strings.Split(s, ",") // breaks def=, but handled below. if len(fields) < 2 { - fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) + log.Printf("proto: tag has too few fields: %q", s) return } @@ -225,7 +224,7 @@ func (p *Properties) Parse(s string) { p.WireType = WireBytes // no numeric converter for non-numeric types default: - fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) + log.Printf("proto: tag has unknown wire type: %q", s) return } @@ -400,6 +399,15 @@ func GetProperties(t reflect.Type) *StructProperties { return sprop } +type ( + oneofFuncsIface interface { + XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) + } + oneofWrappersIface interface { + XXX_OneofWrappers() []interface{} + } +) + // getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { @@ -441,37 +449,40 @@ func getPropertiesLocked(t reflect.Type) *StructProperties { // Re-order prop.order. sort.Sort(prop) - type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) - } - if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok { + if isOneofMessage { var oots []interface{} - _, _, _, oots = om.XXX_OneofFuncs() - - // Interpret oneof metadata. - prop.OneofTypes = make(map[string]*OneofProperties) - for _, oot := range oots { - oop := &OneofProperties{ - Type: reflect.ValueOf(oot).Type(), // *T - Prop: new(Properties), - } - sft := oop.Type.Elem().Field(0) - oop.Prop.Name = sft.Name - oop.Prop.Parse(sft.Tag.Get("protobuf")) - // There will be exactly one interface field that - // this new value is assignable to. - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - if f.Type.Kind() != reflect.Interface { - continue + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oots = m.XXX_OneofFuncs() + case oneofWrappersIface: + oots = m.XXX_OneofWrappers() + } + if len(oots) > 0 { + // Interpret oneof metadata. + prop.OneofTypes = make(map[string]*OneofProperties) + for _, oot := range oots { + oop := &OneofProperties{ + Type: reflect.ValueOf(oot).Type(), // *T + Prop: new(Properties), } - if !oop.Type.AssignableTo(f.Type) { - continue + sft := oop.Type.Elem().Field(0) + oop.Prop.Name = sft.Name + oop.Prop.Parse(sft.Tag.Get("protobuf")) + // There will be exactly one interface field that + // this new value is assignable to. + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if f.Type.Kind() != reflect.Interface { + continue + } + if !oop.Type.AssignableTo(f.Type) { + continue + } + oop.Field = i + break } - oop.Field = i - break + prop.OneofTypes[oop.Prop.OrigName] = oop } - prop.OneofTypes[oop.Prop.OrigName] = oop } } diff --git a/vendor/github.com/gogo/protobuf/proto/table_marshal.go b/vendor/github.com/gogo/protobuf/proto/table_marshal.go index 9b1538d..f8babde 100644 --- a/vendor/github.com/gogo/protobuf/proto/table_marshal.go +++ b/vendor/github.com/gogo/protobuf/proto/table_marshal.go @@ -389,8 +389,13 @@ func (u *marshalInfo) computeMarshalInfo() { // get oneof implementers var oneofImplementers []interface{} // gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler - if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok && isOneofMessage { - _, _, _, oneofImplementers = m.XXX_OneofFuncs() + if isOneofMessage { + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() + } } // normal fields @@ -519,10 +524,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI } } -type oneofMessage interface { - XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) -} - // wiretype returns the wire encoding of the type. func wiretype(encoding string) uint64 { switch encoding { @@ -2968,7 +2969,9 @@ func (p *Buffer) Marshal(pb Message) error { if m, ok := pb.(newMarshaler); ok { siz := m.XXX_Size() p.grow(siz) // make sure buf has enough capacity - p.buf, err = m.XXX_Marshal(p.buf, p.deterministic) + pp := p.buf[len(p.buf) : len(p.buf) : len(p.buf)+siz] + pp, err = m.XXX_Marshal(pp, p.deterministic) + p.buf = append(p.buf, pp...) return err } if m, ok := pb.(Marshaler); ok { diff --git a/vendor/github.com/gogo/protobuf/proto/table_merge.go b/vendor/github.com/gogo/protobuf/proto/table_merge.go index f520106..60dcf70 100644 --- a/vendor/github.com/gogo/protobuf/proto/table_merge.go +++ b/vendor/github.com/gogo/protobuf/proto/table_merge.go @@ -530,6 +530,25 @@ func (mi *mergeInfo) computeMergeInfo() { } case reflect.Struct: switch { + case isSlice && !isPointer: // E.g. []pb.T + mergeInfo := getMergeInfo(tf) + zero := reflect.Zero(tf) + mfi.merge = func(dst, src pointer) { + // TODO: Make this faster? + dstsp := dst.asPointerTo(f.Type) + dsts := dstsp.Elem() + srcs := src.asPointerTo(f.Type).Elem() + for i := 0; i < srcs.Len(); i++ { + dsts = reflect.Append(dsts, zero) + srcElement := srcs.Index(i).Addr() + dstElement := dsts.Index(dsts.Len() - 1).Addr() + mergeInfo.merge(valToPointer(dstElement), valToPointer(srcElement)) + } + if dsts.IsNil() { + dsts = reflect.MakeSlice(f.Type, 0, 0) + } + dstsp.Elem().Set(dsts) + } case !isPointer: mergeInfo := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { diff --git a/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go b/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go index bb2622f..9372293 100644 --- a/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go +++ b/vendor/github.com/gogo/protobuf/proto/table_unmarshal.go @@ -371,15 +371,18 @@ func (u *unmarshalInfo) computeUnmarshalInfo() { } // Find any types associated with oneof fields. - // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it? - fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs") // gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler - if fn.IsValid() && len(oneofFields) > 0 { - res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{} - for i := res.Len() - 1; i >= 0; i-- { - v := res.Index(i) // interface{} - tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X - typ := tptr.Elem() // Msg_X + if len(oneofFields) > 0 { + var oneofImplementers []interface{} + switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { + case oneofFuncsIface: + _, _, _, oneofImplementers = m.XXX_OneofFuncs() + case oneofWrappersIface: + oneofImplementers = m.XXX_OneofWrappers() + } + for _, v := range oneofImplementers { + tptr := reflect.TypeOf(v) // *Msg_X + typ := tptr.Elem() // Msg_X f := typ.Field(0) // oneof implementers have one field baseUnmarshal := fieldUnmarshaler(&f) @@ -407,11 +410,12 @@ func (u *unmarshalInfo) computeUnmarshalInfo() { u.setTag(fieldNum, of.field, unmarshal, 0, name) } } + } } // Get extension ranges, if any. - fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") + fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") if fn.IsValid() { if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() { panic("a message with extensions, but no extensions field in " + t.Name()) diff --git a/vendor/github.com/gogo/protobuf/proto/text.go b/vendor/github.com/gogo/protobuf/proto/text.go index 0407ba8..87416af 100644 --- a/vendor/github.com/gogo/protobuf/proto/text.go +++ b/vendor/github.com/gogo/protobuf/proto/text.go @@ -476,6 +476,8 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error { return nil } +var textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + // writeAny writes an arbitrary field. func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) @@ -589,8 +591,8 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert // mutating this value. v = v.Addr() } - if etm, ok := v.Interface().(encoding.TextMarshaler); ok { - text, err := etm.MarshalText() + if v.Type().Implements(textMarshalerType) { + text, err := v.Interface().(encoding.TextMarshaler).MarshalText() if err != nil { return err } diff --git a/vendor/github.com/mattn/go-colorable/colorable_appengine.go b/vendor/github.com/mattn/go-colorable/colorable_appengine.go index 1f28d77..0b0aef8 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_appengine.go +++ b/vendor/github.com/mattn/go-colorable/colorable_appengine.go @@ -9,7 +9,7 @@ import ( _ "github.com/mattn/go-isatty" ) -// NewColorable return new instance of Writer which handle escape sequence. +// NewColorable returns new instance of Writer which handles escape sequence. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -18,12 +18,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return os.Stdout } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return os.Stderr } diff --git a/vendor/github.com/mattn/go-colorable/colorable_others.go b/vendor/github.com/mattn/go-colorable/colorable_others.go index 887f203..3fb771d 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_others.go +++ b/vendor/github.com/mattn/go-colorable/colorable_others.go @@ -10,7 +10,7 @@ import ( _ "github.com/mattn/go-isatty" ) -// NewColorable return new instance of Writer which handle escape sequence. +// NewColorable returns new instance of Writer which handles escape sequence. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -19,12 +19,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return os.Stdout } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return os.Stderr } diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index 404e10c..1bd628f 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -81,7 +81,7 @@ var ( procCreateConsoleScreenBuffer = kernel32.NewProc("CreateConsoleScreenBuffer") ) -// Writer provide colorable Writer to the console +// Writer provides colorable Writer to the console type Writer struct { out io.Writer handle syscall.Handle @@ -91,7 +91,7 @@ type Writer struct { rest bytes.Buffer } -// NewColorable return new instance of Writer which handle escape sequence from File. +// NewColorable returns new instance of Writer which handles escape sequence from File. func NewColorable(file *os.File) io.Writer { if file == nil { panic("nil passed instead of *os.File to NewColorable()") @@ -106,12 +106,12 @@ func NewColorable(file *os.File) io.Writer { return file } -// NewColorableStdout return new instance of Writer which handle escape sequence for stdout. +// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. func NewColorableStdout() io.Writer { return NewColorable(os.Stdout) } -// NewColorableStderr return new instance of Writer which handle escape sequence for stderr. +// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. func NewColorableStderr() io.Writer { return NewColorable(os.Stderr) } @@ -414,7 +414,15 @@ func doTitleSequence(er *bytes.Reader) error { return nil } -// Write write data on console +// returns Atoi(s) unless s == "" in which case it returns def +func atoiWithDefault(s string, def int) (int, error) { + if s == "" { + return def, nil + } + return strconv.Atoi(s) +} + +// Write writes data on console func (w *Writer) Write(data []byte) (n int, err error) { var csbi consoleScreenBufferInfo procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) @@ -500,7 +508,7 @@ loop: switch m { case 'A': - n, err = strconv.Atoi(buf.String()) + n, err = atoiWithDefault(buf.String(), 1) if err != nil { continue } @@ -508,7 +516,7 @@ loop: csbi.cursorPosition.y -= short(n) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'B': - n, err = strconv.Atoi(buf.String()) + n, err = atoiWithDefault(buf.String(), 1) if err != nil { continue } @@ -516,7 +524,7 @@ loop: csbi.cursorPosition.y += short(n) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'C': - n, err = strconv.Atoi(buf.String()) + n, err = atoiWithDefault(buf.String(), 1) if err != nil { continue } @@ -524,7 +532,7 @@ loop: csbi.cursorPosition.x += short(n) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) case 'D': - n, err = strconv.Atoi(buf.String()) + n, err = atoiWithDefault(buf.String(), 1) if err != nil { continue } @@ -557,6 +565,9 @@ loop: if err != nil { continue } + if n < 1 { + n = 1 + } procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) csbi.cursorPosition.x = short(n - 1) procSetConsoleCursorPosition.Call(uintptr(handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition))) @@ -635,6 +646,20 @@ loop: } procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + case 'X': + n := 0 + if buf.Len() > 0 { + n, err = strconv.Atoi(buf.String()) + if err != nil { + continue + } + } + procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) + var cursor coord + var written dword + cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y} + procFillConsoleOutputCharacter.Call(uintptr(handle), uintptr(' '), uintptr(n), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) + procFillConsoleOutputAttribute.Call(uintptr(handle), uintptr(csbi.attributes), uintptr(n), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written))) case 'm': procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi))) attr := csbi.attributes diff --git a/vendor/github.com/mattn/go-colorable/noncolorable.go b/vendor/github.com/mattn/go-colorable/noncolorable.go index 9721e16..95f2c6b 100644 --- a/vendor/github.com/mattn/go-colorable/noncolorable.go +++ b/vendor/github.com/mattn/go-colorable/noncolorable.go @@ -5,17 +5,17 @@ import ( "io" ) -// NonColorable hold writer but remove escape sequence. +// NonColorable holds writer but removes escape sequence. type NonColorable struct { out io.Writer } -// NewNonColorable return new instance of Writer which remove escape sequence from Writer. +// NewNonColorable returns new instance of Writer which removes escape sequence from Writer. func NewNonColorable(w io.Writer) io.Writer { return &NonColorable{out: w} } -// Write write data on console +// Write writes data on console func (w *NonColorable) Write(data []byte) (n int, err error) { er := bytes.NewReader(data) var bw [1]byte diff --git a/vendor/github.com/mattn/go-isatty/go.mod b/vendor/github.com/mattn/go-isatty/go.mod index f310320..a8ddf40 100644 --- a/vendor/github.com/mattn/go-isatty/go.mod +++ b/vendor/github.com/mattn/go-isatty/go.mod @@ -1,3 +1,5 @@ module github.com/mattn/go-isatty -require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 +require golang.org/x/sys v0.0.0-20191008105621-543471e840be + +go 1.14 diff --git a/vendor/github.com/mattn/go-isatty/go.sum b/vendor/github.com/mattn/go-isatty/go.sum index 426c897..c141fc5 100644 --- a/vendor/github.com/mattn/go-isatty/go.sum +++ b/vendor/github.com/mattn/go-isatty/go.sum @@ -1,2 +1,4 @@ -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/mattn/go-isatty/isatty_plan9.go b/vendor/github.com/mattn/go-isatty/isatty_plan9.go new file mode 100644 index 0000000..bc0a709 --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_plan9.go @@ -0,0 +1,22 @@ +// +build plan9 + +package isatty + +import ( + "syscall" +) + +// IsTerminal returns true if the given file descriptor is a terminal. +func IsTerminal(fd uintptr) bool { + path, err := syscall.Fd2path(fd) + if err != nil { + return false + } + return path == "/dev/cons" || path == "/mnt/term/dev/cons" +} + +// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index af51cbc..1fa8691 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -4,6 +4,7 @@ package isatty import ( + "errors" "strings" "syscall" "unicode/utf16" @@ -11,15 +12,18 @@ import ( ) const ( - fileNameInfo uintptr = 2 - fileTypePipe = 3 + objectNameInfo uintptr = 1 + fileNameInfo = 2 + fileTypePipe = 3 ) var ( kernel32 = syscall.NewLazyDLL("kernel32.dll") + ntdll = syscall.NewLazyDLL("ntdll.dll") procGetConsoleMode = kernel32.NewProc("GetConsoleMode") procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") procGetFileType = kernel32.NewProc("GetFileType") + procNtQueryObject = ntdll.NewProc("NtQueryObject") ) func init() { @@ -45,7 +49,10 @@ func isCygwinPipeName(name string) bool { return false } - if token[0] != `\msys` && token[0] != `\cygwin` { + if token[0] != `\msys` && + token[0] != `\cygwin` && + token[0] != `\Device\NamedPipe\msys` && + token[0] != `\Device\NamedPipe\cygwin` { return false } @@ -68,11 +75,35 @@ func isCygwinPipeName(name string) bool { return true } +// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler +// since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion +// guys are using Windows XP, this is a workaround for those guys, it will also work on system from +// Windows vista to 10 +// see https://stackoverflow.com/a/18792477 for details +func getFileNameByHandle(fd uintptr) (string, error) { + if procNtQueryObject == nil { + return "", errors.New("ntdll.dll: NtQueryObject not supported") + } + + var buf [4 + syscall.MAX_PATH]uint16 + var result int + r, _, e := syscall.Syscall6(procNtQueryObject.Addr(), 5, + fd, objectNameInfo, uintptr(unsafe.Pointer(&buf)), uintptr(2*len(buf)), uintptr(unsafe.Pointer(&result)), 0) + if r != 0 { + return "", e + } + return string(utf16.Decode(buf[4 : 4+buf[0]/2])), nil +} + // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 // terminal. func IsCygwinTerminal(fd uintptr) bool { if procGetFileInformationByHandleEx == nil { - return false + name, err := getFileNameByHandle(fd) + if err != nil { + return false + } + return isCygwinPipeName(name) } // Cygwin/msys's pty is a pipe. diff --git a/vendor/github.com/russross/blackfriday/.gitignore b/vendor/github.com/russross/blackfriday/.gitignore new file mode 100644 index 0000000..75623dc --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.gitignore @@ -0,0 +1,8 @@ +*.out +*.swp +*.8 +*.6 +_obj +_test* +markdown +tags diff --git a/vendor/github.com/russross/blackfriday/.travis.yml b/vendor/github.com/russross/blackfriday/.travis.yml new file mode 100644 index 0000000..2f3351d --- /dev/null +++ b/vendor/github.com/russross/blackfriday/.travis.yml @@ -0,0 +1,17 @@ +sudo: false +language: go +go: + - "1.9.x" + - "1.10.x" + - tip +matrix: + fast_finish: true + allow_failures: + - go: tip +install: + - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). +script: + - go get -t -v ./... + - diff -u <(echo -n) <(gofmt -d -s .) + - go tool vet . + - go test -v -race ./... diff --git a/vendor/github.com/russross/blackfriday/LICENSE.txt b/vendor/github.com/russross/blackfriday/LICENSE.txt new file mode 100644 index 0000000..2885af3 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/LICENSE.txt @@ -0,0 +1,29 @@ +Blackfriday is distributed under the Simplified BSD License: + +> Copyright © 2011 Russ Ross +> All rights reserved. +> +> Redistribution and use in source and binary forms, with or without +> modification, are permitted provided that the following conditions +> are met: +> +> 1. Redistributions of source code must retain the above copyright +> notice, this list of conditions and the following disclaimer. +> +> 2. Redistributions in binary form must reproduce the above +> copyright notice, this list of conditions and the following +> disclaimer in the documentation and/or other materials provided with +> the distribution. +> +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +> COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +> INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +> BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +> LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +> LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +> ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +> POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/russross/blackfriday/README.md b/vendor/github.com/russross/blackfriday/README.md new file mode 100644 index 0000000..3c62e13 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/README.md @@ -0,0 +1,369 @@ +Blackfriday +[![Build Status][BuildSVG]][BuildURL] +[![Godoc][GodocV2SVG]][GodocV2URL] +=========== + +Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It +is paranoid about its input (so you can safely feed it user-supplied +data), it is fast, it supports common extensions (tables, smart +punctuation substitutions, etc.), and it is safe for all utf-8 +(unicode) input. + +HTML output is currently supported, along with Smartypants +extensions. + +It started as a translation from C of [Sundown][3]. + + +Installation +------------ + +Blackfriday is compatible with any modern Go release. With Go and git installed: + + go get -u gopkg.in/russross/blackfriday.v2 + +will download, compile, and install the package into your `$GOPATH` directory +hierarchy. + + +Versions +-------- + +Currently maintained and recommended version of Blackfriday is `v2`. It's being +developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the +documentation is available at +https://godoc.org/gopkg.in/russross/blackfriday.v2. + +It is `go get`-able via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`, +but we highly recommend using package management tool like [dep][7] or +[Glide][8] and make use of semantic versioning. With package management you +should import `github.com/russross/blackfriday` and specify that you're using +version 2.0.0. + +Version 2 offers a number of improvements over v1: + +* Cleaned up API +* A separate call to [`Parse`][4], which produces an abstract syntax tree for + the document +* Latest bug fixes +* Flexibility to easily add your own rendering extensions + +Potential drawbacks: + +* Our benchmarks show v2 to be slightly slower than v1. Currently in the + ballpark of around 15%. +* API breakage. If you can't afford modifying your code to adhere to the new API + and don't care too much about the new features, v2 is probably not for you. +* Several bug fixes are trailing behind and still need to be forward-ported to + v2. See issue [#348](https://github.com/russross/blackfriday/issues/348) for + tracking. + +If you are still interested in the legacy `v1`, you can import it from +`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found +here: https://godoc.org/github.com/russross/blackfriday + +### Known issue with `dep` + +There is a known problem with using Blackfriday v1 _transitively_ and `dep`. +Currently `dep` prioritizes semver versions over anything else, and picks the +latest one, plus it does not apply a `[[constraint]]` specifier to transitively +pulled in packages. So if you're using something that uses Blackfriday v1, but +that something does not use `dep` yet, you will get Blackfriday v2 pulled in and +your first dependency will fail to build. + +There are couple of fixes for it, documented here: +https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version + +Meanwhile, `dep` team is working on a more general solution to the constraints +on transitive dependencies problem: https://github.com/golang/dep/issues/1124. + + +Usage +----- + +### v1 + +For basic usage, it is as simple as getting your input into a byte +slice and calling: + + output := blackfriday.MarkdownBasic(input) + +This renders it with no extensions enabled. To get a more useful +feature set, use this instead: + + output := blackfriday.MarkdownCommon(input) + +### v2 + +For the most sensible markdown processing, it is as simple as getting your input +into a byte slice and calling: + +```go +output := blackfriday.Run(input) +``` + +Your input will be parsed and the output rendered with a set of most popular +extensions enabled. If you want the most basic feature set, corresponding with +the bare Markdown specification, use: + +```go +output := blackfriday.Run(input, blackfriday.WithNoExtensions()) +``` + +### Sanitize untrusted content + +Blackfriday itself does nothing to protect against malicious content. If you are +dealing with user-supplied markdown, we recommend running Blackfriday's output +through HTML sanitizer such as [Bluemonday][5]. + +Here's an example of simple usage of Blackfriday together with Bluemonday: + +```go +import ( + "github.com/microcosm-cc/bluemonday" + "gopkg.in/russross/blackfriday.v2" +) + +// ... +unsafe := blackfriday.Run(input) +html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) +``` + +### Custom options, v1 + +If you want to customize the set of options, first get a renderer +(currently only the HTML output engine), then use it to +call the more general `Markdown` function. For examples, see the +implementations of `MarkdownBasic` and `MarkdownCommon` in +`markdown.go`. + +### Custom options, v2 + +If you want to customize the set of options, use `blackfriday.WithExtensions`, +`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`. + +### `blackfriday-tool` + +You can also check out `blackfriday-tool` for a more complete example +of how to use it. Download and install it using: + + go get github.com/russross/blackfriday-tool + +This is a simple command-line tool that allows you to process a +markdown file using a standalone program. You can also browse the +source directly on github if you are just looking for some example +code: + +* + +Note that if you have not already done so, installing +`blackfriday-tool` will be sufficient to download and install +blackfriday in addition to the tool itself. The tool binary will be +installed in `$GOPATH/bin`. This is a statically-linked binary that +can be copied to wherever you need it without worrying about +dependencies and library versions. + +### Sanitized anchor names + +Blackfriday includes an algorithm for creating sanitized anchor names +corresponding to a given input text. This algorithm is used to create +anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The +algorithm has a specification, so that other packages can create +compatible anchor names and links to those anchors. + +The specification is located at https://godoc.org/github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names. + +[`SanitizedAnchorName`](https://godoc.org/github.com/russross/blackfriday#SanitizedAnchorName) exposes this functionality, and can be used to +create compatible links to the anchor names generated by blackfriday. +This algorithm is also implemented in a small standalone package at +[`github.com/shurcooL/sanitized_anchor_name`](https://godoc.org/github.com/shurcooL/sanitized_anchor_name). It can be useful for clients +that want a small package and don't need full functionality of blackfriday. + + +Features +-------- + +All features of Sundown are supported, including: + +* **Compatibility**. The Markdown v1.0.3 test suite passes with + the `--tidy` option. Without `--tidy`, the differences are + mostly in whitespace and entity escaping, where blackfriday is + more consistent and cleaner. + +* **Common extensions**, including table support, fenced code + blocks, autolinks, strikethroughs, non-strict emphasis, etc. + +* **Safety**. Blackfriday is paranoid when parsing, making it safe + to feed untrusted user input without fear of bad things + happening. The test suite stress tests this and there are no + known inputs that make it crash. If you find one, please let me + know and send me the input that does it. + + NOTE: "safety" in this context means *runtime safety only*. In order to + protect yourself against JavaScript injection in untrusted content, see + [this example](https://github.com/russross/blackfriday#sanitize-untrusted-content). + +* **Fast processing**. It is fast enough to render on-demand in + most web applications without having to cache the output. + +* **Thread safety**. You can run multiple parsers in different + goroutines without ill effect. There is no dependence on global + shared state. + +* **Minimal dependencies**. Blackfriday only depends on standard + library packages in Go. The source code is pretty + self-contained, so it is easy to add to any project, including + Google App Engine projects. + +* **Standards compliant**. Output successfully validates using the + W3C validation tool for HTML 4.01 and XHTML 1.0 Transitional. + + +Extensions +---------- + +In addition to the standard markdown syntax, this package +implements the following extensions: + +* **Intra-word emphasis supression**. The `_` character is + commonly used inside words when discussing code, so having + markdown interpret it as an emphasis command is usually the + wrong thing. Blackfriday lets you treat all emphasis markers as + normal characters when they occur inside a word. + +* **Tables**. Tables can be created by drawing them in the input + using a simple syntax: + + ``` + Name | Age + --------|------ + Bob | 27 + Alice | 23 + ``` + +* **Fenced code blocks**. In addition to the normal 4-space + indentation to mark code blocks, you can explicitly mark them + and supply a language (to make syntax highlighting simple). Just + mark it like this: + + ``` go + func getTrue() bool { + return true + } + ``` + + You can use 3 or more backticks to mark the beginning of the + block, and the same number to mark the end of the block. + + To preserve classes of fenced code blocks while using the bluemonday + HTML sanitizer, use the following policy: + + ``` go + p := bluemonday.UGCPolicy() + p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code") + html := p.SanitizeBytes(unsafe) + ``` + +* **Definition lists**. A simple definition list is made of a single-line + term followed by a colon and the definition for that term. + + Cat + : Fluffy animal everyone likes + + Internet + : Vector of transmission for pictures of cats + + Terms must be separated from the previous definition by a blank line. + +* **Footnotes**. A marker in the text that will become a superscript number; + a footnote definition that will be placed in a list of footnotes at the + end of the document. A footnote looks like this: + + This is a footnote.[^1] + + [^1]: the footnote text. + +* **Autolinking**. Blackfriday can find URLs that have not been + explicitly marked as links and turn them into links. + +* **Strikethrough**. Use two tildes (`~~`) to mark text that + should be crossed out. + +* **Hard line breaks**. With this extension enabled (it is off by + default in the `MarkdownBasic` and `MarkdownCommon` convenience + functions), newlines in the input translate into line breaks in + the output. + +* **Smart quotes**. Smartypants-style punctuation substitution is + supported, turning normal double- and single-quote marks into + curly quotes, etc. + +* **LaTeX-style dash parsing** is an additional option, where `--` + is translated into `–`, and `---` is translated into + `—`. This differs from most smartypants processors, which + turn a single hyphen into an ndash and a double hyphen into an + mdash. + +* **Smart fractions**, where anything that looks like a fraction + is translated into suitable HTML (instead of just a few special + cases like most smartypant processors). For example, `4/5` + becomes `45`, which renders as + 45. + + +Other renderers +--------------- + +Blackfriday is structured to allow alternative rendering engines. Here +are a few of note: + +* [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown): + provides a GitHub Flavored Markdown renderer with fenced code block + highlighting, clickable heading anchor links. + + It's not customizable, and its goal is to produce HTML output + equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode), + except the rendering is performed locally. + +* [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt, + but for markdown. + +* [LaTeX output](https://bitbucket.org/ambrevar/blackfriday-latex): + renders output as LaTeX. + +* [bfchroma](https://github.com/Depado/bfchroma/): provides convenience + integration with the [Chroma](https://github.com/alecthomas/chroma) code + highlighting library. bfchroma is only compatible with v2 of Blackfriday and + provides a drop-in renderer ready to use with Blackfriday, as well as + options and means for further customization. + + +TODO +---- + +* More unit testing +* Improve Unicode support. It does not understand all Unicode + rules (about what constitutes a letter, a punctuation symbol, + etc.), so it may fail to detect word boundaries correctly in + some instances. It is safe on all UTF-8 input. + + +License +------- + +[Blackfriday is distributed under the Simplified BSD License](LICENSE.txt) + + + [1]: https://daringfireball.net/projects/markdown/ "Markdown" + [2]: https://golang.org/ "Go Language" + [3]: https://github.com/vmg/sundown "Sundown" + [4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func" + [5]: https://github.com/microcosm-cc/bluemonday "Bluemonday" + [6]: https://labix.org/gopkg.in "gopkg.in" + [7]: https://github.com/golang/dep/ "dep" + [8]: https://github.com/Masterminds/glide "Glide" + + [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master + [BuildURL]: https://travis-ci.org/russross/blackfriday + [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg + [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2 diff --git a/vendor/github.com/russross/blackfriday/block.go b/vendor/github.com/russross/blackfriday/block.go new file mode 100644 index 0000000..45c21a6 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/block.go @@ -0,0 +1,1474 @@ +// +// Blackfriday Markdown Processor +// Available at http://github.com/russross/blackfriday +// +// Copyright © 2011 Russ Ross . +// Distributed under the Simplified BSD License. +// See README.md for details. +// + +// +// Functions to parse block-level elements. +// + +package blackfriday + +import ( + "bytes" + "strings" + "unicode" +) + +// Parse block-level data. +// Note: this function and many that it calls assume that +// the input buffer ends with a newline. +func (p *parser) block(out *bytes.Buffer, data []byte) { + if len(data) == 0 || data[len(data)-1] != '\n' { + panic("block input is missing terminating newline") + } + + // this is called recursively: enforce a maximum depth + if p.nesting >= p.maxNesting { + return + } + p.nesting++ + + // parse out one block-level construct at a time + for len(data) > 0 { + // prefixed header: + // + // # Header 1 + // ## Header 2 + // ... + // ###### Header 6 + if p.isPrefixHeader(data) { + data = data[p.prefixHeader(out, data):] + continue + } + + // block of preformatted HTML: + // + //
+ // ... + //
+ if data[0] == '<' { + if i := p.html(out, data, true); i > 0 { + data = data[i:] + continue + } + } + + // title block + // + // % stuff + // % more stuff + // % even more stuff + if p.flags&EXTENSION_TITLEBLOCK != 0 { + if data[0] == '%' { + if i := p.titleBlock(out, data, true); i > 0 { + data = data[i:] + continue + } + } + } + + // blank lines. note: returns the # of bytes to skip + if i := p.isEmpty(data); i > 0 { + data = data[i:] + continue + } + + // indented code block: + // + // func max(a, b int) int { + // if a > b { + // return a + // } + // return b + // } + if p.codePrefix(data) > 0 { + data = data[p.code(out, data):] + continue + } + + // fenced code block: + // + // ``` go info string here + // func fact(n int) int { + // if n <= 1 { + // return n + // } + // return n * fact(n-1) + // } + // ``` + if p.flags&EXTENSION_FENCED_CODE != 0 { + if i := p.fencedCodeBlock(out, data, true); i > 0 { + data = data[i:] + continue + } + } + + // horizontal rule: + // + // ------ + // or + // ****** + // or + // ______ + if p.isHRule(data) { + p.r.HRule(out) + var i int + for i = 0; data[i] != '\n'; i++ { + } + data = data[i:] + continue + } + + // block quote: + // + // > A big quote I found somewhere + // > on the web + if p.quotePrefix(data) > 0 { + data = data[p.quote(out, data):] + continue + } + + // table: + // + // Name | Age | Phone + // ------|-----|--------- + // Bob | 31 | 555-1234 + // Alice | 27 | 555-4321 + if p.flags&EXTENSION_TABLES != 0 { + if i := p.table(out, data); i > 0 { + data = data[i:] + continue + } + } + + // an itemized/unordered list: + // + // * Item 1 + // * Item 2 + // + // also works with + or - + if p.uliPrefix(data) > 0 { + data = data[p.list(out, data, 0):] + continue + } + + // a numbered/ordered list: + // + // 1. Item 1 + // 2. Item 2 + if p.oliPrefix(data) > 0 { + data = data[p.list(out, data, LIST_TYPE_ORDERED):] + continue + } + + // definition lists: + // + // Term 1 + // : Definition a + // : Definition b + // + // Term 2 + // : Definition c + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if p.dliPrefix(data) > 0 { + data = data[p.list(out, data, LIST_TYPE_DEFINITION):] + continue + } + } + + // anything else must look like a normal paragraph + // note: this finds underlined headers, too + data = data[p.paragraph(out, data):] + } + + p.nesting-- +} + +func (p *parser) isPrefixHeader(data []byte) bool { + if data[0] != '#' { + return false + } + + if p.flags&EXTENSION_SPACE_HEADERS != 0 { + level := 0 + for level < 6 && data[level] == '#' { + level++ + } + if data[level] != ' ' { + return false + } + } + return true +} + +func (p *parser) prefixHeader(out *bytes.Buffer, data []byte) int { + level := 0 + for level < 6 && data[level] == '#' { + level++ + } + i := skipChar(data, level, ' ') + end := skipUntilChar(data, i, '\n') + skip := end + id := "" + if p.flags&EXTENSION_HEADER_IDS != 0 { + j, k := 0, 0 + // find start/end of header id + for j = i; j < end-1 && (data[j] != '{' || data[j+1] != '#'); j++ { + } + for k = j + 1; k < end && data[k] != '}'; k++ { + } + // extract header id iff found + if j < end && k < end { + id = string(data[j+2 : k]) + end = j + skip = k + 1 + for end > 0 && data[end-1] == ' ' { + end-- + } + } + } + for end > 0 && data[end-1] == '#' { + if isBackslashEscaped(data, end-1) { + break + } + end-- + } + for end > 0 && data[end-1] == ' ' { + end-- + } + if end > i { + if id == "" && p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { + id = SanitizedAnchorName(string(data[i:end])) + } + work := func() bool { + p.inline(out, data[i:end]) + return true + } + p.r.Header(out, work, level, id) + } + return skip +} + +func (p *parser) isUnderlinedHeader(data []byte) int { + // test of level 1 header + if data[0] == '=' { + i := skipChar(data, 1, '=') + i = skipChar(data, i, ' ') + if data[i] == '\n' { + return 1 + } else { + return 0 + } + } + + // test of level 2 header + if data[0] == '-' { + i := skipChar(data, 1, '-') + i = skipChar(data, i, ' ') + if data[i] == '\n' { + return 2 + } else { + return 0 + } + } + + return 0 +} + +func (p *parser) titleBlock(out *bytes.Buffer, data []byte, doRender bool) int { + if data[0] != '%' { + return 0 + } + splitData := bytes.Split(data, []byte("\n")) + var i int + for idx, b := range splitData { + if !bytes.HasPrefix(b, []byte("%")) { + i = idx // - 1 + break + } + } + + data = bytes.Join(splitData[0:i], []byte("\n")) + p.r.TitleBlock(out, data) + + return len(data) +} + +func (p *parser) html(out *bytes.Buffer, data []byte, doRender bool) int { + var i, j int + + // identify the opening tag + if data[0] != '<' { + return 0 + } + curtag, tagfound := p.htmlFindTag(data[1:]) + + // handle special cases + if !tagfound { + // check for an HTML comment + if size := p.htmlComment(out, data, doRender); size > 0 { + return size + } + + // check for an
tag + if size := p.htmlHr(out, data, doRender); size > 0 { + return size + } + + // check for HTML CDATA + if size := p.htmlCDATA(out, data, doRender); size > 0 { + return size + } + + // no special case recognized + return 0 + } + + // look for an unindented matching closing tag + // followed by a blank line + found := false + /* + closetag := []byte("\n") + j = len(curtag) + 1 + for !found { + // scan for a closing tag at the beginning of a line + if skip := bytes.Index(data[j:], closetag); skip >= 0 { + j += skip + len(closetag) + } else { + break + } + + // see if it is the only thing on the line + if skip := p.isEmpty(data[j:]); skip > 0 { + // see if it is followed by a blank line/eof + j += skip + if j >= len(data) { + found = true + i = j + } else { + if skip := p.isEmpty(data[j:]); skip > 0 { + j += skip + found = true + i = j + } + } + } + } + */ + + // if not found, try a second pass looking for indented match + // but not if tag is "ins" or "del" (following original Markdown.pl) + if !found && curtag != "ins" && curtag != "del" { + i = 1 + for i < len(data) { + i++ + for i < len(data) && !(data[i-1] == '<' && data[i] == '/') { + i++ + } + + if i+2+len(curtag) >= len(data) { + break + } + + j = p.htmlFindEnd(curtag, data[i-1:]) + + if j > 0 { + i += j - 1 + found = true + break + } + } + } + + if !found { + return 0 + } + + // the end of the block has been found + if doRender { + // trim newlines + end := i + for end > 0 && data[end-1] == '\n' { + end-- + } + p.r.BlockHtml(out, data[:end]) + } + + return i +} + +func (p *parser) renderHTMLBlock(out *bytes.Buffer, data []byte, start int, doRender bool) int { + // html block needs to end with a blank line + if i := p.isEmpty(data[start:]); i > 0 { + size := start + i + if doRender { + // trim trailing newlines + end := size + for end > 0 && data[end-1] == '\n' { + end-- + } + p.r.BlockHtml(out, data[:end]) + } + return size + } + return 0 +} + +// HTML comment, lax form +func (p *parser) htmlComment(out *bytes.Buffer, data []byte, doRender bool) int { + i := p.inlineHTMLComment(out, data) + return p.renderHTMLBlock(out, data, i, doRender) +} + +// HTML CDATA section +func (p *parser) htmlCDATA(out *bytes.Buffer, data []byte, doRender bool) int { + const cdataTag = "') { + i++ + } + i++ + // no end-of-comment marker + if i >= len(data) { + return 0 + } + return p.renderHTMLBlock(out, data, i, doRender) +} + +// HR, which is the only self-closing block tag considered +func (p *parser) htmlHr(out *bytes.Buffer, data []byte, doRender bool) int { + if data[0] != '<' || (data[1] != 'h' && data[1] != 'H') || (data[2] != 'r' && data[2] != 'R') { + return 0 + } + if data[3] != ' ' && data[3] != '/' && data[3] != '>' { + // not an
tag after all; at least not a valid one + return 0 + } + + i := 3 + for data[i] != '>' && data[i] != '\n' { + i++ + } + + if data[i] == '>' { + return p.renderHTMLBlock(out, data, i+1, doRender) + } + + return 0 +} + +func (p *parser) htmlFindTag(data []byte) (string, bool) { + i := 0 + for isalnum(data[i]) { + i++ + } + key := string(data[:i]) + if _, ok := blockTags[key]; ok { + return key, true + } + return "", false +} + +func (p *parser) htmlFindEnd(tag string, data []byte) int { + // assume data[0] == '<' && data[1] == '/' already tested + + // check if tag is a match + closetag := []byte("") + if !bytes.HasPrefix(data, closetag) { + return 0 + } + i := len(closetag) + + // check that the rest of the line is blank + skip := 0 + if skip = p.isEmpty(data[i:]); skip == 0 { + return 0 + } + i += skip + skip = 0 + + if i >= len(data) { + return i + } + + if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { + return i + } + if skip = p.isEmpty(data[i:]); skip == 0 { + // following line must be blank + return 0 + } + + return i + skip +} + +func (*parser) isEmpty(data []byte) int { + // it is okay to call isEmpty on an empty buffer + if len(data) == 0 { + return 0 + } + + var i int + for i = 0; i < len(data) && data[i] != '\n'; i++ { + if data[i] != ' ' && data[i] != '\t' { + return 0 + } + } + return i + 1 +} + +func (*parser) isHRule(data []byte) bool { + i := 0 + + // skip up to three spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // look at the hrule char + if data[i] != '*' && data[i] != '-' && data[i] != '_' { + return false + } + c := data[i] + + // the whole line must be the char or whitespace + n := 0 + for data[i] != '\n' { + switch { + case data[i] == c: + n++ + case data[i] != ' ': + return false + } + i++ + } + + return n >= 3 +} + +// isFenceLine checks if there's a fence line (e.g., ``` or ``` go) at the beginning of data, +// and returns the end index if so, or 0 otherwise. It also returns the marker found. +// If syntax is not nil, it gets set to the syntax specified in the fence line. +// A final newline is mandatory to recognize the fence line, unless newlineOptional is true. +func isFenceLine(data []byte, info *string, oldmarker string, newlineOptional bool) (end int, marker string) { + i, size := 0, 0 + + // skip up to three spaces + for i < len(data) && i < 3 && data[i] == ' ' { + i++ + } + + // check for the marker characters: ~ or ` + if i >= len(data) { + return 0, "" + } + if data[i] != '~' && data[i] != '`' { + return 0, "" + } + + c := data[i] + + // the whole line must be the same char or whitespace + for i < len(data) && data[i] == c { + size++ + i++ + } + + // the marker char must occur at least 3 times + if size < 3 { + return 0, "" + } + marker = string(data[i-size : i]) + + // if this is the end marker, it must match the beginning marker + if oldmarker != "" && marker != oldmarker { + return 0, "" + } + + // TODO(shurcooL): It's probably a good idea to simplify the 2 code paths here + // into one, always get the info string, and discard it if the caller doesn't care. + if info != nil { + infoLength := 0 + i = skipChar(data, i, ' ') + + if i >= len(data) { + if newlineOptional && i == len(data) { + return i, marker + } + return 0, "" + } + + infoStart := i + + if data[i] == '{' { + i++ + infoStart++ + + for i < len(data) && data[i] != '}' && data[i] != '\n' { + infoLength++ + i++ + } + + if i >= len(data) || data[i] != '}' { + return 0, "" + } + + // strip all whitespace at the beginning and the end + // of the {} block + for infoLength > 0 && isspace(data[infoStart]) { + infoStart++ + infoLength-- + } + + for infoLength > 0 && isspace(data[infoStart+infoLength-1]) { + infoLength-- + } + + i++ + } else { + for i < len(data) && !isverticalspace(data[i]) { + infoLength++ + i++ + } + } + + *info = strings.TrimSpace(string(data[infoStart : infoStart+infoLength])) + } + + i = skipChar(data, i, ' ') + if i >= len(data) || data[i] != '\n' { + if newlineOptional && i == len(data) { + return i, marker + } + return 0, "" + } + + return i + 1, marker // Take newline into account. +} + +// fencedCodeBlock returns the end index if data contains a fenced code block at the beginning, +// or 0 otherwise. It writes to out if doRender is true, otherwise it has no side effects. +// If doRender is true, a final newline is mandatory to recognize the fenced code block. +func (p *parser) fencedCodeBlock(out *bytes.Buffer, data []byte, doRender bool) int { + var infoString string + beg, marker := isFenceLine(data, &infoString, "", false) + if beg == 0 || beg >= len(data) { + return 0 + } + + var work bytes.Buffer + + for { + // safe to assume beg < len(data) + + // check for the end of the code block + newlineOptional := !doRender + fenceEnd, _ := isFenceLine(data[beg:], nil, marker, newlineOptional) + if fenceEnd != 0 { + beg += fenceEnd + break + } + + // copy the current line + end := skipUntilChar(data, beg, '\n') + 1 + + // did we reach the end of the buffer without a closing marker? + if end >= len(data) { + return 0 + } + + // verbatim copy to the working buffer + if doRender { + work.Write(data[beg:end]) + } + beg = end + } + + if doRender { + p.r.BlockCode(out, work.Bytes(), infoString) + } + + return beg +} + +func (p *parser) table(out *bytes.Buffer, data []byte) int { + var header bytes.Buffer + i, columns := p.tableHeader(&header, data) + if i == 0 { + return 0 + } + + var body bytes.Buffer + + for i < len(data) { + pipes, rowStart := 0, i + for ; data[i] != '\n'; i++ { + if data[i] == '|' { + pipes++ + } + } + + if pipes == 0 { + i = rowStart + break + } + + // include the newline in data sent to tableRow + i++ + p.tableRow(&body, data[rowStart:i], columns, false) + } + + p.r.Table(out, header.Bytes(), body.Bytes(), columns) + + return i +} + +// check if the specified position is preceded by an odd number of backslashes +func isBackslashEscaped(data []byte, i int) bool { + backslashes := 0 + for i-backslashes-1 >= 0 && data[i-backslashes-1] == '\\' { + backslashes++ + } + return backslashes&1 == 1 +} + +func (p *parser) tableHeader(out *bytes.Buffer, data []byte) (size int, columns []int) { + i := 0 + colCount := 1 + for i = 0; data[i] != '\n'; i++ { + if data[i] == '|' && !isBackslashEscaped(data, i) { + colCount++ + } + } + + // doesn't look like a table header + if colCount == 1 { + return + } + + // include the newline in the data sent to tableRow + header := data[:i+1] + + // column count ignores pipes at beginning or end of line + if data[0] == '|' { + colCount-- + } + if i > 2 && data[i-1] == '|' && !isBackslashEscaped(data, i-1) { + colCount-- + } + + columns = make([]int, colCount) + + // move on to the header underline + i++ + if i >= len(data) { + return + } + + if data[i] == '|' && !isBackslashEscaped(data, i) { + i++ + } + i = skipChar(data, i, ' ') + + // each column header is of form: / *:?-+:? *|/ with # dashes + # colons >= 3 + // and trailing | optional on last column + col := 0 + for data[i] != '\n' { + dashes := 0 + + if data[i] == ':' { + i++ + columns[col] |= TABLE_ALIGNMENT_LEFT + dashes++ + } + for data[i] == '-' { + i++ + dashes++ + } + if data[i] == ':' { + i++ + columns[col] |= TABLE_ALIGNMENT_RIGHT + dashes++ + } + for data[i] == ' ' { + i++ + } + + // end of column test is messy + switch { + case dashes < 3: + // not a valid column + return + + case data[i] == '|' && !isBackslashEscaped(data, i): + // marker found, now skip past trailing whitespace + col++ + i++ + for data[i] == ' ' { + i++ + } + + // trailing junk found after last column + if col >= colCount && data[i] != '\n' { + return + } + + case (data[i] != '|' || isBackslashEscaped(data, i)) && col+1 < colCount: + // something else found where marker was required + return + + case data[i] == '\n': + // marker is optional for the last column + col++ + + default: + // trailing junk found after last column + return + } + } + if col != colCount { + return + } + + p.tableRow(out, header, columns, true) + size = i + 1 + return +} + +func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int, header bool) { + i, col := 0, 0 + var rowWork bytes.Buffer + + if data[i] == '|' && !isBackslashEscaped(data, i) { + i++ + } + + for col = 0; col < len(columns) && i < len(data); col++ { + for data[i] == ' ' { + i++ + } + + cellStart := i + + for (data[i] != '|' || isBackslashEscaped(data, i)) && data[i] != '\n' { + i++ + } + + cellEnd := i + + // skip the end-of-cell marker, possibly taking us past end of buffer + i++ + + for cellEnd > cellStart && data[cellEnd-1] == ' ' { + cellEnd-- + } + + var cellWork bytes.Buffer + p.inline(&cellWork, data[cellStart:cellEnd]) + + if header { + p.r.TableHeaderCell(&rowWork, cellWork.Bytes(), columns[col]) + } else { + p.r.TableCell(&rowWork, cellWork.Bytes(), columns[col]) + } + } + + // pad it out with empty columns to get the right number + for ; col < len(columns); col++ { + if header { + p.r.TableHeaderCell(&rowWork, nil, columns[col]) + } else { + p.r.TableCell(&rowWork, nil, columns[col]) + } + } + + // silently ignore rows with too many cells + + p.r.TableRow(out, rowWork.Bytes()) +} + +// returns blockquote prefix length +func (p *parser) quotePrefix(data []byte) int { + i := 0 + for i < 3 && data[i] == ' ' { + i++ + } + if data[i] == '>' { + if data[i+1] == ' ' { + return i + 2 + } + return i + 1 + } + return 0 +} + +// blockquote ends with at least one blank line +// followed by something without a blockquote prefix +func (p *parser) terminateBlockquote(data []byte, beg, end int) bool { + if p.isEmpty(data[beg:]) <= 0 { + return false + } + if end >= len(data) { + return true + } + return p.quotePrefix(data[end:]) == 0 && p.isEmpty(data[end:]) == 0 +} + +// parse a blockquote fragment +func (p *parser) quote(out *bytes.Buffer, data []byte) int { + var raw bytes.Buffer + beg, end := 0, 0 + for beg < len(data) { + end = beg + // Step over whole lines, collecting them. While doing that, check for + // fenced code and if one's found, incorporate it altogether, + // irregardless of any contents inside it + for data[end] != '\n' { + if p.flags&EXTENSION_FENCED_CODE != 0 { + if i := p.fencedCodeBlock(out, data[end:], false); i > 0 { + // -1 to compensate for the extra end++ after the loop: + end += i - 1 + break + } + } + end++ + } + end++ + + if pre := p.quotePrefix(data[beg:]); pre > 0 { + // skip the prefix + beg += pre + } else if p.terminateBlockquote(data, beg, end) { + break + } + + // this line is part of the blockquote + raw.Write(data[beg:end]) + beg = end + } + + var cooked bytes.Buffer + p.block(&cooked, raw.Bytes()) + p.r.BlockQuote(out, cooked.Bytes()) + return end +} + +// returns prefix length for block code +func (p *parser) codePrefix(data []byte) int { + if data[0] == ' ' && data[1] == ' ' && data[2] == ' ' && data[3] == ' ' { + return 4 + } + return 0 +} + +func (p *parser) code(out *bytes.Buffer, data []byte) int { + var work bytes.Buffer + + i := 0 + for i < len(data) { + beg := i + for data[i] != '\n' { + i++ + } + i++ + + blankline := p.isEmpty(data[beg:i]) > 0 + if pre := p.codePrefix(data[beg:i]); pre > 0 { + beg += pre + } else if !blankline { + // non-empty, non-prefixed line breaks the pre + i = beg + break + } + + // verbatim copy to the working buffeu + if blankline { + work.WriteByte('\n') + } else { + work.Write(data[beg:i]) + } + } + + // trim all the \n off the end of work + workbytes := work.Bytes() + eol := len(workbytes) + for eol > 0 && workbytes[eol-1] == '\n' { + eol-- + } + if eol != len(workbytes) { + work.Truncate(eol) + } + + work.WriteByte('\n') + + p.r.BlockCode(out, work.Bytes(), "") + + return i +} + +// returns unordered list item prefix +func (p *parser) uliPrefix(data []byte) int { + i := 0 + + // start with up to 3 spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // need a *, +, or - followed by a space + if (data[i] != '*' && data[i] != '+' && data[i] != '-') || + data[i+1] != ' ' { + return 0 + } + return i + 2 +} + +// returns ordered list item prefix +func (p *parser) oliPrefix(data []byte) int { + i := 0 + + // start with up to 3 spaces + for i < 3 && data[i] == ' ' { + i++ + } + + // count the digits + start := i + for data[i] >= '0' && data[i] <= '9' { + i++ + } + + // we need >= 1 digits followed by a dot and a space + if start == i || data[i] != '.' || data[i+1] != ' ' { + return 0 + } + return i + 2 +} + +// returns definition list item prefix +func (p *parser) dliPrefix(data []byte) int { + i := 0 + + // need a : followed by a spaces + if data[i] != ':' || data[i+1] != ' ' { + return 0 + } + for data[i] == ' ' { + i++ + } + return i + 2 +} + +// parse ordered or unordered list block +func (p *parser) list(out *bytes.Buffer, data []byte, flags int) int { + i := 0 + flags |= LIST_ITEM_BEGINNING_OF_LIST + work := func() bool { + for i < len(data) { + skip := p.listItem(out, data[i:], &flags) + i += skip + + if skip == 0 || flags&LIST_ITEM_END_OF_LIST != 0 { + break + } + flags &= ^LIST_ITEM_BEGINNING_OF_LIST + } + return true + } + + p.r.List(out, work, flags) + return i +} + +// Parse a single list item. +// Assumes initial prefix is already removed if this is a sublist. +func (p *parser) listItem(out *bytes.Buffer, data []byte, flags *int) int { + // keep track of the indentation of the first line + itemIndent := 0 + for itemIndent < 3 && data[itemIndent] == ' ' { + itemIndent++ + } + + i := p.uliPrefix(data) + if i == 0 { + i = p.oliPrefix(data) + } + if i == 0 { + i = p.dliPrefix(data) + // reset definition term flag + if i > 0 { + *flags &= ^LIST_TYPE_TERM + } + } + if i == 0 { + // if in defnition list, set term flag and continue + if *flags&LIST_TYPE_DEFINITION != 0 { + *flags |= LIST_TYPE_TERM + } else { + return 0 + } + } + + // skip leading whitespace on first line + for data[i] == ' ' { + i++ + } + + // find the end of the line + line := i + for i > 0 && data[i-1] != '\n' { + i++ + } + + // get working buffer + var raw bytes.Buffer + + // put the first line into the working buffer + raw.Write(data[line:i]) + line = i + + // process the following lines + containsBlankLine := false + sublist := 0 + codeBlockMarker := "" + +gatherlines: + for line < len(data) { + i++ + + // find the end of this line + for data[i-1] != '\n' { + i++ + } + + // if it is an empty line, guess that it is part of this item + // and move on to the next line + if p.isEmpty(data[line:i]) > 0 { + containsBlankLine = true + raw.Write(data[line:i]) + line = i + continue + } + + // calculate the indentation + indent := 0 + for indent < 4 && line+indent < i && data[line+indent] == ' ' { + indent++ + } + + chunk := data[line+indent : i] + + if p.flags&EXTENSION_FENCED_CODE != 0 { + // determine if in or out of codeblock + // if in codeblock, ignore normal list processing + _, marker := isFenceLine(chunk, nil, codeBlockMarker, false) + if marker != "" { + if codeBlockMarker == "" { + // start of codeblock + codeBlockMarker = marker + } else { + // end of codeblock. + *flags |= LIST_ITEM_CONTAINS_BLOCK + codeBlockMarker = "" + } + } + // we are in a codeblock, write line, and continue + if codeBlockMarker != "" || marker != "" { + raw.Write(data[line+indent : i]) + line = i + continue gatherlines + } + } + + // evaluate how this line fits in + switch { + // is this a nested list item? + case (p.uliPrefix(chunk) > 0 && !p.isHRule(chunk)) || + p.oliPrefix(chunk) > 0 || + p.dliPrefix(chunk) > 0: + + if containsBlankLine { + // end the list if the type changed after a blank line + if indent <= itemIndent && + ((*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) || + (*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0)) { + + *flags |= LIST_ITEM_END_OF_LIST + break gatherlines + } + *flags |= LIST_ITEM_CONTAINS_BLOCK + } + + // to be a nested list, it must be indented more + // if not, it is the next item in the same list + if indent <= itemIndent { + break gatherlines + } + + // is this the first item in the nested list? + if sublist == 0 { + sublist = raw.Len() + } + + // is this a nested prefix header? + case p.isPrefixHeader(chunk): + // if the header is not indented, it is not nested in the list + // and thus ends the list + if containsBlankLine && indent < 4 { + *flags |= LIST_ITEM_END_OF_LIST + break gatherlines + } + *flags |= LIST_ITEM_CONTAINS_BLOCK + + // anything following an empty line is only part + // of this item if it is indented 4 spaces + // (regardless of the indentation of the beginning of the item) + case containsBlankLine && indent < 4: + if *flags&LIST_TYPE_DEFINITION != 0 && i < len(data)-1 { + // is the next item still a part of this list? + next := i + for data[next] != '\n' { + next++ + } + for next < len(data)-1 && data[next] == '\n' { + next++ + } + if i < len(data)-1 && data[i] != ':' && data[next] != ':' { + *flags |= LIST_ITEM_END_OF_LIST + } + } else { + *flags |= LIST_ITEM_END_OF_LIST + } + break gatherlines + + // a blank line means this should be parsed as a block + case containsBlankLine: + *flags |= LIST_ITEM_CONTAINS_BLOCK + } + + containsBlankLine = false + + // add the line into the working buffer without prefix + raw.Write(data[line+indent : i]) + + line = i + } + + // If reached end of data, the Renderer.ListItem call we're going to make below + // is definitely the last in the list. + if line >= len(data) { + *flags |= LIST_ITEM_END_OF_LIST + } + + rawBytes := raw.Bytes() + + // render the contents of the list item + var cooked bytes.Buffer + if *flags&LIST_ITEM_CONTAINS_BLOCK != 0 && *flags&LIST_TYPE_TERM == 0 { + // intermediate render of block item, except for definition term + if sublist > 0 { + p.block(&cooked, rawBytes[:sublist]) + p.block(&cooked, rawBytes[sublist:]) + } else { + p.block(&cooked, rawBytes) + } + } else { + // intermediate render of inline item + if sublist > 0 { + p.inline(&cooked, rawBytes[:sublist]) + p.block(&cooked, rawBytes[sublist:]) + } else { + p.inline(&cooked, rawBytes) + } + } + + // render the actual list item + cookedBytes := cooked.Bytes() + parsedEnd := len(cookedBytes) + + // strip trailing newlines + for parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\n' { + parsedEnd-- + } + p.r.ListItem(out, cookedBytes[:parsedEnd], *flags) + + return line +} + +// render a single paragraph that has already been parsed out +func (p *parser) renderParagraph(out *bytes.Buffer, data []byte) { + if len(data) == 0 { + return + } + + // trim leading spaces + beg := 0 + for data[beg] == ' ' { + beg++ + } + + // trim trailing newline + end := len(data) - 1 + + // trim trailing spaces + for end > beg && data[end-1] == ' ' { + end-- + } + + work := func() bool { + p.inline(out, data[beg:end]) + return true + } + p.r.Paragraph(out, work) +} + +func (p *parser) paragraph(out *bytes.Buffer, data []byte) int { + // prev: index of 1st char of previous line + // line: index of 1st char of current line + // i: index of cursor/end of current line + var prev, line, i int + + // keep going until we find something to mark the end of the paragraph + for i < len(data) { + // mark the beginning of the current line + prev = line + current := data[i:] + line = i + + // did we find a blank line marking the end of the paragraph? + if n := p.isEmpty(current); n > 0 { + // did this blank line followed by a definition list item? + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if i < len(data)-1 && data[i+1] == ':' { + return p.list(out, data[prev:], LIST_TYPE_DEFINITION) + } + } + + p.renderParagraph(out, data[:i]) + return i + n + } + + // an underline under some text marks a header, so our paragraph ended on prev line + if i > 0 { + if level := p.isUnderlinedHeader(current); level > 0 { + // render the paragraph + p.renderParagraph(out, data[:prev]) + + // ignore leading and trailing whitespace + eol := i - 1 + for prev < eol && data[prev] == ' ' { + prev++ + } + for eol > prev && data[eol-1] == ' ' { + eol-- + } + + // render the header + // this ugly double closure avoids forcing variables onto the heap + work := func(o *bytes.Buffer, pp *parser, d []byte) func() bool { + return func() bool { + pp.inline(o, d) + return true + } + }(out, p, data[prev:eol]) + + id := "" + if p.flags&EXTENSION_AUTO_HEADER_IDS != 0 { + id = SanitizedAnchorName(string(data[prev:eol])) + } + + p.r.Header(out, work, level, id) + + // find the end of the underline + for data[i] != '\n' { + i++ + } + return i + } + } + + // if the next line starts a block of HTML, then the paragraph ends here + if p.flags&EXTENSION_LAX_HTML_BLOCKS != 0 { + if data[i] == '<' && p.html(out, current, false) > 0 { + // rewind to before the HTML block + p.renderParagraph(out, data[:i]) + return i + } + } + + // if there's a prefixed header or a horizontal rule after this, paragraph is over + if p.isPrefixHeader(current) || p.isHRule(current) { + p.renderParagraph(out, data[:i]) + return i + } + + // if there's a fenced code block, paragraph is over + if p.flags&EXTENSION_FENCED_CODE != 0 { + if p.fencedCodeBlock(out, current, false) > 0 { + p.renderParagraph(out, data[:i]) + return i + } + } + + // if there's a definition list item, prev line is a definition term + if p.flags&EXTENSION_DEFINITION_LISTS != 0 { + if p.dliPrefix(current) != 0 { + return p.list(out, data[prev:], LIST_TYPE_DEFINITION) + } + } + + // if there's a list after this, paragraph is over + if p.flags&EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK != 0 { + if p.uliPrefix(current) != 0 || + p.oliPrefix(current) != 0 || + p.quotePrefix(current) != 0 || + p.codePrefix(current) != 0 { + p.renderParagraph(out, data[:i]) + return i + } + } + + // otherwise, scan to the beginning of the next line + for data[i] != '\n' { + i++ + } + i++ + } + + p.renderParagraph(out, data[:i]) + return i +} + +// SanitizedAnchorName returns a sanitized anchor name for the given text. +// +// It implements the algorithm specified in the package comment. +func SanitizedAnchorName(text string) string { + var anchorName []rune + futureDash := false + for _, r := range text { + switch { + case unicode.IsLetter(r) || unicode.IsNumber(r): + if futureDash && len(anchorName) > 0 { + anchorName = append(anchorName, '-') + } + futureDash = false + anchorName = append(anchorName, unicode.ToLower(r)) + default: + futureDash = true + } + } + return string(anchorName) +} diff --git a/vendor/github.com/russross/blackfriday/doc.go b/vendor/github.com/russross/blackfriday/doc.go new file mode 100644 index 0000000..9656c42 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/doc.go @@ -0,0 +1,32 @@ +// Package blackfriday is a Markdown processor. +// +// It translates plain text with simple formatting rules into HTML or LaTeX. +// +// Sanitized Anchor Names +// +// Blackfriday includes an algorithm for creating sanitized anchor names +// corresponding to a given input text. This algorithm is used to create +// anchors for headings when EXTENSION_AUTO_HEADER_IDS is enabled. The +// algorithm is specified below, so that other packages can create +// compatible anchor names and links to those anchors. +// +// The algorithm iterates over the input text, interpreted as UTF-8, +// one Unicode code point (rune) at a time. All runes that are letters (category L) +// or numbers (category N) are considered valid characters. They are mapped to +// lower case, and included in the output. All other runes are considered +// invalid characters. Invalid characters that preceed the first valid character, +// as well as invalid character that follow the last valid character +// are dropped completely. All other sequences of invalid characters +// between two valid characters are replaced with a single dash character '-'. +// +// SanitizedAnchorName exposes this functionality, and can be used to +// create compatible links to the anchor names generated by blackfriday. +// This algorithm is also implemented in a small standalone package at +// github.com/shurcooL/sanitized_anchor_name. It can be useful for clients +// that want a small package and don't need full functionality of blackfriday. +package blackfriday + +// NOTE: Keep Sanitized Anchor Name algorithm in sync with package +// github.com/shurcooL/sanitized_anchor_name. +// Otherwise, users of sanitized_anchor_name will get anchor names +// that are incompatible with those generated by blackfriday. diff --git a/vendor/github.com/russross/blackfriday/go.mod b/vendor/github.com/russross/blackfriday/go.mod new file mode 100644 index 0000000..b05561a --- /dev/null +++ b/vendor/github.com/russross/blackfriday/go.mod @@ -0,0 +1 @@ +module github.com/russross/blackfriday diff --git a/vendor/github.com/russross/blackfriday/html.go b/vendor/github.com/russross/blackfriday/html.go new file mode 100644 index 0000000..e0a6c69 --- /dev/null +++ b/vendor/github.com/russross/blackfriday/html.go @@ -0,0 +1,938 @@ +// +// Blackfriday Markdown Processor +// Available at http://github.com/russross/blackfriday +// +// Copyright © 2011 Russ Ross . +// Distributed under the Simplified BSD License. +// See README.md for details. +// + +// +// +// HTML rendering backend +// +// + +package blackfriday + +import ( + "bytes" + "fmt" + "regexp" + "strconv" + "strings" +) + +// Html renderer configuration options. +const ( + HTML_SKIP_HTML = 1 << iota // skip preformatted HTML blocks + HTML_SKIP_STYLE // skip embedded