diff --git a/wire/message_test.go b/wire/message_test.go index 9f859eadfd..9772c2558e 100644 --- a/wire/message_test.go +++ b/wire/message_test.go @@ -122,13 +122,13 @@ func TestMessage(t *testing.T) { {msgCFTypes, msgCFTypes, pver, MainNet, 26}, {msgGetInitState, msgGetInitState, pver, MainNet, 25}, {msgInitState, msgInitState, pver, MainNet, 28}, - {msgMixPR, msgMixPR, pver, MainNet, 169}, - {msgMixKE, msgMixKE, pver, MainNet, 1449}, - {msgMixCT, msgMixCT, pver, MainNet, 166}, - {msgMixSR, msgMixSR, pver, MainNet, 169}, - {msgMixDC, msgMixDC, pver, MainNet, 189}, - {msgMixCM, msgMixCM, pver, MainNet, 181}, - {msgMixRS, msgMixRS, pver, MainNet, 213}, + {msgMixPR, msgMixPR, pver, MainNet, 165}, + {msgMixKE, msgMixKE, pver, MainNet, 1445}, + {msgMixCT, msgMixCT, pver, MainNet, 162}, + {msgMixSR, msgMixSR, pver, MainNet, 165}, + {msgMixDC, msgMixDC, pver, MainNet, 185}, + {msgMixCM, msgMixCM, pver, MainNet, 177}, + {msgMixRS, msgMixRS, pver, MainNet, 209}, } t.Logf("Running %d tests", len(tests)) diff --git a/wire/msgmixciphertexts.go b/wire/msgmixciphertexts.go index 3c2f634988..e18a208bed 100644 --- a/wire/msgmixciphertexts.go +++ b/wire/msgmixciphertexts.go @@ -19,7 +19,7 @@ type MsgMixCiphertexts struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 Ciphertexts [][1047]byte SeenKeyExchanges []chainhash.Hash @@ -190,21 +190,21 @@ func (msg *MsgMixCiphertexts) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixCiphertexts) MaxPayloadLength(pver uint32) uint32 { - return 552592 + return 552588 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixCiphertexts) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixCiphertexts) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixCiphertexts) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixCiphertexts) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixCiphertexts) Expires() int64 { +func (msg *MsgMixCiphertexts) Expires() uint32 { return msg.Expiry } @@ -226,7 +226,7 @@ func (msg *MsgMixCiphertexts) GetRun() uint32 { // NewMsgMixCiphertexts returns a new mixcphrtxt message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixCiphertexts(identity [33]byte, sid [32]byte, expires int64, run uint32, +func NewMsgMixCiphertexts(identity [33]byte, sid [32]byte, expires uint32, run uint32, ciphertexts [][1047]byte, seenKeyExchanges []chainhash.Hash) *MsgMixCiphertexts { return &MsgMixCiphertexts{ diff --git a/wire/msgmixciphertexts_test.go b/wire/msgmixciphertexts_test.go index 98ded92671..6082e88781 100644 --- a/wire/msgmixciphertexts_test.go +++ b/wire/msgmixciphertexts_test.go @@ -35,7 +35,7 @@ func TestMixCTWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) cts := make([][1047]byte, 4) diff --git a/wire/msgmixconfirm.go b/wire/msgmixconfirm.go index a393d86ff9..03de5d32d4 100644 --- a/wire/msgmixconfirm.go +++ b/wire/msgmixconfirm.go @@ -22,7 +22,7 @@ type MsgMixConfirm struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 Mix MsgTx SeenDCNets []chainhash.Hash @@ -183,21 +183,21 @@ func (msg *MsgMixConfirm) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixConfirm) MaxPayloadLength(pver uint32) uint32 { - return 16543 + MaxBlockPayloadV3 + return 16539 + MaxBlockPayloadV3 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixConfirm) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixConfirm) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixConfirm) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixConfirm) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixConfirm) Expires() int64 { +func (msg *MsgMixConfirm) Expires() uint32 { return msg.Expiry } @@ -219,7 +219,7 @@ func (msg *MsgMixConfirm) GetRun() uint32 { // NewMsgMixConfirm returns a new mixconfirm message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixConfirm(identity [33]byte, sid [32]byte, expiry int64, run uint32, +func NewMsgMixConfirm(identity [33]byte, sid [32]byte, expiry uint32, run uint32, mix *MsgTx, seenDCNets []chainhash.Hash) *MsgMixConfirm { if mix == nil { diff --git a/wire/msgmixconfirm_test.go b/wire/msgmixconfirm_test.go index 663b845b66..9f95754268 100644 --- a/wire/msgmixconfirm_test.go +++ b/wire/msgmixconfirm_test.go @@ -35,7 +35,7 @@ func TestMixCMWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) mix := NewMsgTx() diff --git a/wire/msgmixdcnet.go b/wire/msgmixdcnet.go index f792824e1a..317a51c855 100644 --- a/wire/msgmixdcnet.go +++ b/wire/msgmixdcnet.go @@ -17,7 +17,7 @@ type MsgMixDCNet struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 DCNet []MixVect SeenSlotReserves []chainhash.Hash @@ -257,21 +257,21 @@ func (msg *MsgMixDCNet) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixDCNet) MaxPayloadLength(pver uint32) uint32 { - return 16800915 + return 16800911 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixDCNet) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixDCNet) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixDCNet) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixDCNet) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixDCNet) Expires() int64 { +func (msg *MsgMixDCNet) Expires() uint32 { return msg.Expiry } @@ -293,7 +293,7 @@ func (msg *MsgMixDCNet) GetRun() uint32 { // NewMsgMixDCNet returns a new mixdcnet message that conforms to the Message // interface using the passed parameters and defaults for the remaining // fields. -func NewMsgMixDCNet(identity [33]byte, sid [32]byte, expiry int64, run uint32, +func NewMsgMixDCNet(identity [33]byte, sid [32]byte, expiry uint32, run uint32, dcnet []MixVect, seenSlotReserves []chainhash.Hash) *MsgMixDCNet { return &MsgMixDCNet{ diff --git a/wire/msgmixdcnet_test.go b/wire/msgmixdcnet_test.go index cacd21f255..974d498534 100644 --- a/wire/msgmixdcnet_test.go +++ b/wire/msgmixdcnet_test.go @@ -35,7 +35,7 @@ func TestMixDCWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) mcount := 4 diff --git a/wire/msgmixkeyexchange.go b/wire/msgmixkeyexchange.go index 467ebac289..204cb2ca7e 100644 --- a/wire/msgmixkeyexchange.go +++ b/wire/msgmixkeyexchange.go @@ -26,7 +26,7 @@ type MsgMixKeyExchange struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 ECDH [33]byte // Secp256k1 public key PQPK [1218]byte // Sntrup4591761 public key @@ -180,21 +180,21 @@ func (msg *MsgMixKeyExchange) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixKeyExchange) MaxPayloadLength(pver uint32) uint32 { - return 17811 + return 17807 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixKeyExchange) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixKeyExchange) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixKeyExchange) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixKeyExchange) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixKeyExchange) Expires() int64 { +func (msg *MsgMixKeyExchange) Expires() uint32 { return msg.Expiry } @@ -216,7 +216,7 @@ func (msg *MsgMixKeyExchange) GetRun() uint32 { // NewMsgMixKeyExchange returns a new mixkeyxchg message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixKeyExchange(identity [33]byte, sid [32]byte, expires int64, run uint32, +func NewMsgMixKeyExchange(identity [33]byte, sid [32]byte, expires uint32, run uint32, ecdh [33]byte, pqpk [1218]byte, commitment [32]byte, seenPRs []chainhash.Hash) *MsgMixKeyExchange { return &MsgMixKeyExchange{ diff --git a/wire/msgmixkeyexchange_test.go b/wire/msgmixkeyexchange_test.go index 81bcb920e8..783b05b93c 100644 --- a/wire/msgmixkeyexchange_test.go +++ b/wire/msgmixkeyexchange_test.go @@ -35,7 +35,7 @@ func TestMixKEWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) var ecdh [33]byte diff --git a/wire/msgmixpairreq.go b/wire/msgmixpairreq.go index d8d1c36525..7e8b8300ed 100644 --- a/wire/msgmixpairreq.go +++ b/wire/msgmixpairreq.go @@ -54,7 +54,7 @@ type MixPairReqUTXO struct { type MsgMixPairReq struct { Signature [64]byte Identity [33]byte - Expiry int64 + Expiry uint32 MixAmount int64 ScriptClass string TxVersion uint16 @@ -353,18 +353,18 @@ func (msg *MsgMixPairReq) MaxPayloadLength(pver uint32) uint32 { return MaxBlockPayload } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixPairReq) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixPairReq) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixPairReq) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixPairReq) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixPairReq) Expires() int64 { +func (msg *MsgMixPairReq) Expires() uint32 { return msg.Expiry } @@ -386,7 +386,7 @@ func (msg *MsgMixPairReq) GetRun() uint32 { // NewMsgMixPairReq returns a new mixpairreq message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixPairReq(identity [33]byte, expiry int64, mixAmount int64, +func NewMsgMixPairReq(identity [33]byte, expiry uint32, mixAmount int64, scriptClass string, txVersion uint16, lockTime, messageCount uint32, inputValue int64, utxos []MixPairReqUTXO, change *TxOut) (*MsgMixPairReq, error) { diff --git a/wire/msgmixpairreq_test.go b/wire/msgmixpairreq_test.go index 66bb291369..f6db8f0acd 100644 --- a/wire/msgmixpairreq_test.go +++ b/wire/msgmixpairreq_test.go @@ -39,7 +39,7 @@ func TestMixPairReqWire(t *testing.T) { var id [33]byte copy(id[:], repeat(0x81, 33)) - const expiry = int64(0x0282828282828282) + const expiry = uint32(0x82828282) const mixAmount = int64(0x0383838383838383) const sc = "P2PKH-secp256k1-v0" const txVersion = uint16(0x8484) diff --git a/wire/msgmixsecrets.go b/wire/msgmixsecrets.go index c10b65c0e6..5e79dc872a 100644 --- a/wire/msgmixsecrets.go +++ b/wire/msgmixsecrets.go @@ -21,7 +21,7 @@ type MsgMixSecrets struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 Seed [32]byte SlotReserveMsgs [][]byte @@ -193,21 +193,21 @@ func (msg *MsgMixSecrets) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixSecrets) MaxPayloadLength(pver uint32) uint32 { - return 67773 + return 67769 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixSecrets) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixSecrets) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixSecrets) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixSecrets) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixSecrets) Expires() int64 { +func (msg *MsgMixSecrets) Expires() uint32 { return msg.Expiry } @@ -233,7 +233,7 @@ func (msg *MsgMixSecrets) GetRun() uint32 { // NewMsgMixSecrets returns a new mixsecrets message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixSecrets(identity [33]byte, sid [32]byte, expiry int64, run uint32, +func NewMsgMixSecrets(identity [33]byte, sid [32]byte, expiry uint32, run uint32, seed [32]byte, slotReserveMsgs [][]byte, dcNetMsgs [][]byte) *MsgMixSecrets { return &MsgMixSecrets{ diff --git a/wire/msgmixsecrets_test.go b/wire/msgmixsecrets_test.go index 8c044cf7f3..c2a0fe8cfe 100644 --- a/wire/msgmixsecrets_test.go +++ b/wire/msgmixsecrets_test.go @@ -34,7 +34,7 @@ func TestMixRSWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) var seed [32]byte diff --git a/wire/msgmixslotreserve.go b/wire/msgmixslotreserve.go index cf6d761c92..5ed889df0e 100644 --- a/wire/msgmixslotreserve.go +++ b/wire/msgmixslotreserve.go @@ -34,7 +34,7 @@ type MsgMixSlotReserve struct { Signature [64]byte Identity [33]byte SessionID [32]byte - Expiry int64 + Expiry uint32 Run uint32 DCMix [][][]byte // mcount-by-peers matrix of field numbers SeenCiphertexts []chainhash.Hash @@ -269,21 +269,21 @@ func (msg *MsgMixSlotReserve) Command() string { // MaxPayloadLength returns the maximum length the payload can be for the // receiver. This is part of the Message interface implementation. func (msg *MsgMixSlotReserve) MaxPayloadLength(pver uint32) uint32 { - return 17318038 + return 17318034 } -// GetIdentity returns the message sender's public key identity. -func (msg *MsgMixSlotReserve) GetIdentity() []byte { +// Pub returns the message sender's public key identity. +func (msg *MsgMixSlotReserve) Pub() []byte { return msg.Identity[:] } -// GetSignature returns the message signature. -func (msg *MsgMixSlotReserve) GetSignature() []byte { +// Sig returns the message signature. +func (msg *MsgMixSlotReserve) Sig() []byte { return msg.Signature[:] } // Expires returns the block height at which the message expires. -func (msg *MsgMixSlotReserve) Expires() int64 { +func (msg *MsgMixSlotReserve) Expires() uint32 { return msg.Expiry } @@ -305,7 +305,7 @@ func (msg *MsgMixSlotReserve) GetRun() uint32 { // NewMsgMixSlotReserve returns a new mixslotres message that conforms to the // Message interface using the passed parameters and defaults for the // remaining fields. -func NewMsgMixSlotReserve(identity [33]byte, sid [32]byte, expires int64, run uint32, +func NewMsgMixSlotReserve(identity [33]byte, sid [32]byte, expires uint32, run uint32, dcmix [][][]byte, seenCTs []chainhash.Hash) *MsgMixSlotReserve { return &MsgMixSlotReserve{ diff --git a/wire/msgmixslotreserve_test.go b/wire/msgmixslotreserve_test.go index afcc9fc13f..f458b1e9ac 100644 --- a/wire/msgmixslotreserve_test.go +++ b/wire/msgmixslotreserve_test.go @@ -35,7 +35,7 @@ func TestMixSRWire(t *testing.T) { var sid [32]byte copy(sid[:], repeat(0x82, 32)) - const expiry = int64(0x0383838383838383) + const expiry = uint32(0x83838383) const run = uint32(0x84848484) mcount := 4