Failing test to demo seqkey generation issue

This commit is contained in:
Ethan Frey 2017-07-16 20:38:51 +02:00
parent 3d5cf393b9
commit 84a376eecb
2 changed files with 10 additions and 0 deletions

View File

@ -101,6 +101,7 @@ func (n Tx) getSeqKey() (seqKey []byte) {
sort.Sort(basecoin.ByAddress(n.Signers))
for _, signer := range n.Signers {
// rigel: use signer.Bytes()... instead of signer.Address
seqKey = append(seqKey, signer.Address...)
}
//seqKey = merkle.SimpleHashFromBinary(n.Signers)

View File

@ -90,6 +90,14 @@ func TestNonce(t *testing.T) {
{false, 3, set123, set123App2}, // sign with different app actors
{false, 3, set123, set123MixedChains}, // sign with mixed chain actor
{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})
@ -109,4 +117,5 @@ func TestNonce(t *testing.T) {
assert.NotNil(err, "%d", i)
}
}
}