24 lines
575 B
Go
24 lines
575 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,
|
||
|
} {
|
||
|
doc := docFn()
|
||
|
if got, ok := doc["openrpc"]; !ok || got != openRPCDocVersion {
|
||
|
t.Fatalf("case: %d, want: %s, got: %v, doc: %v", i, openRPCDocVersion, got, doc)
|
||
|
}
|
||
|
}
|
||
|
}
|