mirror of
https://github.com/filecoin-project/lotus.git
synced 2025-05-19 16:21:24 +08:00
25 lines
606 B
Go
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)
|
|
}
|
|
}
|
|
}
|