Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit cf7867a

Browse files
author
Connor Daly
authored
Merge pull request #125 from ava-labs/addCompatibility
Add compatibility tracking
2 parents be20d34 + 260c0fb commit cf7867a

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

compatibility.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"rpcChainVMProtocolVersion": {
3+
"v0.0.11": 19,
4+
"v0.0.10": 19,
5+
"v0.0.9": 17,
6+
"v0.0.8": 16,
7+
"v0.0.7": 15,
8+
"v0.0.6": 15,
9+
"v0.0.5": 14,
10+
"v0.0.4": 12,
11+
"v0.0.3": 11,
12+
"v0.0.2": 10,
13+
"v0.0.1": 9
14+
}
15+
}

compatibility_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package vm
2+
3+
import (
4+
_ "embed"
5+
"encoding/json"
6+
"testing"
7+
8+
avagoVersion "github.com/ava-labs/avalanchego/version"
9+
spacesVersion "github.com/ava-labs/spacesvm/version"
10+
"github.com/stretchr/testify/assert"
11+
)
12+
13+
type rpcChainCompatibility struct {
14+
RPCChainVMProtocolVersion map[string]uint `json:"rpcChainVMProtocolVersion"`
15+
}
16+
17+
//go:embed compatibility.json
18+
var rpcChainVMProtocolCompatibilityBytes []byte
19+
20+
func TestCompatibility(t *testing.T) {
21+
var compat rpcChainCompatibility
22+
err := json.Unmarshal(rpcChainVMProtocolCompatibilityBytes, &compat)
23+
assert.NoError(t, err)
24+
25+
currentSpacesRPC, valueInJSON := compat.RPCChainVMProtocolVersion[spacesVersion.Version.String()]
26+
assert.True(t, valueInJSON)
27+
28+
assert.Equal(t, avagoVersion.RPCChainVMProtocol, currentSpacesRPC)
29+
}

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import "github.com/ava-labs/avalanchego/version"
99
var Version = &version.Semantic{
1010
Major: 0,
1111
Minor: 0,
12-
Patch: 10,
12+
Patch: 11,
1313
}

0 commit comments

Comments
 (0)