|  | 
| 5 | 5 | 	"fmt" | 
| 6 | 6 | 	"testing" | 
| 7 | 7 | 
 | 
| 8 |  | -	"github.com/Masterminds/semver/v3" | 
| 9 | 8 | 	"github.com/NethermindEth/juno/blockchain" | 
| 10 | 9 | 	"github.com/NethermindEth/juno/clients/feeder" | 
| 11 | 10 | 	"github.com/NethermindEth/juno/core" | 
| @@ -141,10 +140,19 @@ func TestVerifyBlock(t *testing.T) { | 
| 141 | 140 | 		require.Error(t, chain.Store(mainnetBlock0, mainnetStateUpdate0, nil)) | 
| 142 | 141 | 	}) | 
| 143 | 142 | 
 | 
| 144 |  | -	t.Run("error if version is unsupported", func(t *testing.T) { | 
|  | 143 | +	t.Run("needs padding", func(t *testing.T) { | 
|  | 144 | +		mainnetBlock0.ProtocolVersion = "99.0" // should be padded to "99.0.0" | 
|  | 145 | +		require.EqualError(t, chain.Store(mainnetBlock0, mainnetStateUpdate0, nil), "unsupported block version") | 
|  | 146 | +	}) | 
|  | 147 | + | 
|  | 148 | +	t.Run("needs truncating", func(t *testing.T) { | 
|  | 149 | +		mainnetBlock0.ProtocolVersion = "99.0.0.0" // last 0 digit should be ignored | 
|  | 150 | +		require.EqualError(t, chain.Store(mainnetBlock0, mainnetStateUpdate0, nil), "unsupported block version") | 
|  | 151 | +	}) | 
|  | 152 | + | 
|  | 153 | +	t.Run("greater than supportedStarknetVersion", func(t *testing.T) { | 
| 145 | 154 | 		mainnetBlock0.ProtocolVersion = "99.0.0" | 
| 146 |  | -		semver.MustParse(mainnetBlock0.ProtocolVersion) | 
| 147 |  | -		require.Error(t, chain.Store(mainnetBlock0, mainnetStateUpdate0, nil)) | 
|  | 155 | +		require.EqualError(t, chain.Store(mainnetBlock0, mainnetStateUpdate0, nil), "unsupported block version") | 
| 148 | 156 | 	}) | 
| 149 | 157 | 
 | 
| 150 | 158 | 	t.Run("no error with no version string", func(t *testing.T) { | 
|  | 
0 commit comments