Failing test to demo seqkey generation issue
This commit is contained in:
parent
3d5cf393b9
commit
84a376eecb
|
@ -101,6 +101,7 @@ func (n Tx) getSeqKey() (seqKey []byte) {
|
||||||
sort.Sort(basecoin.ByAddress(n.Signers))
|
sort.Sort(basecoin.ByAddress(n.Signers))
|
||||||
|
|
||||||
for _, signer := range n.Signers {
|
for _, signer := range n.Signers {
|
||||||
|
// rigel: use signer.Bytes()... instead of signer.Address
|
||||||
seqKey = append(seqKey, signer.Address...)
|
seqKey = append(seqKey, signer.Address...)
|
||||||
}
|
}
|
||||||
//seqKey = merkle.SimpleHashFromBinary(n.Signers)
|
//seqKey = merkle.SimpleHashFromBinary(n.Signers)
|
||||||
|
|
|
@ -90,6 +90,14 @@ func TestNonce(t *testing.T) {
|
||||||
{false, 3, set123, set123App2}, // sign with different app actors
|
{false, 3, set123, set123App2}, // sign with different app actors
|
||||||
{false, 3, set123, set123MixedChains}, // sign with mixed chain actor
|
{false, 3, set123, set123MixedChains}, // sign with mixed chain actor
|
||||||
{false, 3, set123, set123MixedApps}, // sign with mixed app actors
|
{false, 3, set123, set123MixedApps}, // sign with mixed app actors
|
||||||
|
|
||||||
|
// Rigel: this is the problem I was refering to.
|
||||||
|
// The sig checks are proper. But the seqkey is not unique
|
||||||
|
// all of these demand 3, as that what is expected for set123
|
||||||
|
{true, 1, set123Chain2, set123Chain2},
|
||||||
|
{true, 1, set123App2, set123App2},
|
||||||
|
{true, 1, set123MixedChains, set123MixedChains},
|
||||||
|
{true, 1, set123MixedApps, set123MixedApps},
|
||||||
}
|
}
|
||||||
|
|
||||||
raw := stack.NewRawTx([]byte{42})
|
raw := stack.NewRawTx([]byte{42})
|
||||||
|
@ -109,4 +117,5 @@ func TestNonce(t *testing.T) {
|
||||||
assert.NotNil(err, "%d", i)
|
assert.NotNil(err, "%d", i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue