Add contrived (possibly flaky) test to check that vote extensions code works

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-03-30 20:00:36 -04:00
parent b8e0e0b1e1
commit c9921ebd31

View File

@@ -5,6 +5,7 @@ import (
"context"
"fmt"
"math/rand"
"strconv"
"testing"
"time"
@@ -183,3 +184,18 @@ func TestApp_Tx(t *testing.T) {
}
}
func TestApp_VoteExtensions(t *testing.T) {
testNode(t, func(ctx context.Context, t *testing.T, node e2e.Node) {
client, err := node.Client()
require.NoError(t, err)
// This special value should have been created by way of vote extensions
resp, err := client.ABCIQuery(ctx, "", []byte("extensionSum"))
require.NoError(t, err)
extSum, err := strconv.Atoi(string(resp.Response.Value))
require.NoError(t, err)
require.GreaterOrEqual(t, extSum, 0)
})
}