diff --git a/glide.lock b/glide.lock index 6d57797f72..579db86b76 100644 --- a/glide.lock +++ b/glide.lock @@ -70,9 +70,9 @@ imports: - name: github.com/tendermint/go-config version: 620dcbbd7d587cf3599dedbf329b64311b0c307a - name: github.com/tendermint/go-crypto - version: 8ff4ce222d32c2328ff0d2bf121fcd34254c03c1 + version: 3e1dba7ab762bb689123eec30c468967f077a6a4 - name: github.com/tendermint/go-data - version: e7fcc6d081ec8518912fcdc103188275f83a3ee5 + version: 9fbf0684fefc4fad580992394a0bcf47c1b3d77e - name: github.com/tendermint/go-db version: 9643f60bc2578693844aacf380a7c32e4c029fee - name: github.com/tendermint/go-events diff --git a/state/execution.go b/state/execution.go index eb7f3c6906..f642b80521 100644 --- a/state/execution.go +++ b/state/execution.go @@ -244,7 +244,7 @@ func validateInputAdvanced(acc *types.Account, signBytes []byte, in types.TxInpu return abci.ErrBaseInsufficientFunds.AppendLog(cmn.Fmt("balance is %v, tried to send %v", balance, in.Coins)) } // Check signatures - if !acc.PubKey.VerifyBytes(signBytes, in.Signature.Signature) { + if !acc.PubKey.VerifyBytes(signBytes, in.Signature) { return abci.ErrBaseInvalidSignature.AppendLog(cmn.Fmt("SignBytes: %X", signBytes)) } return abci.OK diff --git a/types/account.go b/types/account.go index b3478fce0c..d1e62d8321 100644 --- a/types/account.go +++ b/types/account.go @@ -7,9 +7,9 @@ import ( ) type Account struct { - PubKey crypto.PubKeyS `json:"pub_key"` // May be nil, if not known. - Sequence int `json:"sequence"` - Balance Coins `json:"coins"` + PubKey crypto.PubKey `json:"pub_key"` // May be nil, if not known. + Sequence int `json:"sequence"` + Balance Coins `json:"coins"` } func (acc *Account) Copy() *Account { @@ -31,7 +31,7 @@ func (acc *Account) String() string { //---------------------------------------- type PrivAccount struct { - crypto.PrivKeyS + crypto.PrivKey Account } diff --git a/types/test_helpers.go b/types/test_helpers.go index 02f96b7814..23e46cdc9b 100644 --- a/types/test_helpers.go +++ b/types/test_helpers.go @@ -10,11 +10,12 @@ import ( // Creates a PrivAccount from secret. // The amount is not set. func PrivAccountFromSecret(secret string) PrivAccount { - privKey := crypto.GenPrivKeyEd25519FromSecret([]byte(secret)) + privKey := crypto.WrapPrivKey( + crypto.GenPrivKeyEd25519FromSecret([]byte(secret))) privAccount := PrivAccount{ - PrivKeyS: crypto.WrapPrivKey(privKey), + PrivKey: privKey, Account: Account{ - PubKey: crypto.WrapPubKey(privKey.PubKey()), + PubKey: privKey.PubKey(), }, } return privAccount @@ -30,10 +31,10 @@ func RandAccounts(num int, minAmount int64, maxAmount int64) []PrivAccount { balance += cmn.RandInt64() % (maxAmount - minAmount) } - privKey := crypto.GenPrivKeyEd25519() - pubKey := crypto.WrapPubKey(privKey.PubKey()) + privKey := crypto.WrapPrivKey(crypto.GenPrivKeyEd25519()) + pubKey := privKey.PubKey() privAccs[i] = PrivAccount{ - PrivKeyS: crypto.WrapPrivKey(privKey), + PrivKey: privKey, Account: Account{ PubKey: pubKey, Balance: Coins{Coin{"", balance}}, diff --git a/types/tx.go b/types/tx.go index 5b0eb84ba5..f8366b0337 100644 --- a/types/tx.go +++ b/types/tx.go @@ -64,11 +64,11 @@ func (p *TxS) UnmarshalJSON(data []byte) (err error) { //----------------------------------------------------------------------------- type TxInput struct { - Address data.Bytes `json:"address"` // Hash of the PubKey - Coins Coins `json:"coins"` // - Sequence int `json:"sequence"` // Must be 1 greater than the last committed TxInput - Signature crypto.SignatureS `json:"signature"` // Depends on the PubKey type and the whole Tx - PubKey crypto.PubKeyS `json:"pub_key"` // Is present iff Sequence == 0 + Address data.Bytes `json:"address"` // Hash of the PubKey + Coins Coins `json:"coins"` // + Sequence int `json:"sequence"` // Must be 1 greater than the last committed TxInput + Signature crypto.Signature `json:"signature"` // Depends on the PubKey type and the whole Tx + PubKey crypto.PubKey `json:"pub_key"` // Is present iff Sequence == 0 } func (txIn TxInput) ValidateBasic() abci.Result {