test: don't parse err messages in messagepool_test
Per @vyzo's feedback, we shouldn't parse err messages but figure out a way to do this smarter. I updated the code just check for error existence and @brdji should figure out what to do next.
This commit is contained in:
parent
03bc45a26a
commit
7d2810abbc
@ -901,7 +901,8 @@ func TestMessageSignatureInvalid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
err = mp.Add(context.TODO(), sm)
|
err = mp.Add(context.TODO(), sm)
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "invalid signature length")
|
// assert.Contains(t, err.Error(), "invalid signature length")
|
||||||
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -931,7 +932,8 @@ func TestAddMessageTwice(t *testing.T) {
|
|||||||
|
|
||||||
// try to add it twice
|
// try to add it twice
|
||||||
err = mp.Add(context.TODO(), sm)
|
err = mp.Add(context.TODO(), sm)
|
||||||
assert.Contains(t, err.Error(), "with nonce 0 already in mpool")
|
// assert.Contains(t, err.Error(), "with nonce 0 already in mpool")
|
||||||
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -961,7 +963,8 @@ func TestAddMessageTwiceNonceGap(t *testing.T) {
|
|||||||
|
|
||||||
// then try to add message again
|
// then try to add message again
|
||||||
err = mp.Add(context.TODO(), sm)
|
err = mp.Add(context.TODO(), sm)
|
||||||
assert.Contains(t, err.Error(), "unfulfilled nonce gap")
|
// assert.Contains(t, err.Error(), "unfulfilled nonce gap")
|
||||||
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -993,7 +996,8 @@ func TestAddMessageTwiceCidDiff(t *testing.T) {
|
|||||||
//stm: @CHAIN_MEMPOOL_PUSH_001
|
//stm: @CHAIN_MEMPOOL_PUSH_001
|
||||||
// then try to add message again
|
// then try to add message again
|
||||||
err = mp.Add(context.TODO(), sm2)
|
err = mp.Add(context.TODO(), sm2)
|
||||||
assert.Contains(t, err.Error(), "replace by fee has too low GasPremium")
|
// assert.Contains(t, err.Error(), "replace by fee has too low GasPremium")
|
||||||
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user