Files
lotus/build/openrpc_test.go
Jakub Sztandera a704e4710d chore: delete STM annotations (#12752)
Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
2024-12-05 16:45:07 +11:00

25 lines
606 B
Go

package build
import (
"testing"
apitypes "github.com/filecoin-project/lotus/api/types"
)
func TestOpenRPCDiscoverJSON_Version(t *testing.T) {
// openRPCDocVersion is the current OpenRPC version of the API docs.
openRPCDocVersion := "1.2.6"
for i, docFn := range []func() apitypes.OpenRPCDocument{
OpenRPCDiscoverJSON_Full,
OpenRPCDiscoverJSON_Miner,
OpenRPCDiscoverJSON_Worker,
OpenRPCDiscoverJSON_Gateway,
} {
doc := docFn()
if got, ok := doc["openrpc"]; !ok || got != openRPCDocVersion {
t.Fatalf("case: %d, want: %s, got: %v, doc: %v", i, openRPCDocVersion, got, doc)
}
}
}