diff --git a/app/consumer/genesis.go b/app/consumer/genesis.go index ff9f8e6949..702feda2c8 100644 --- a/app/consumer/genesis.go +++ b/app/consumer/genesis.go @@ -1,6 +1,7 @@ package app import ( + "bytes" "encoding/json" "fmt" "os" @@ -237,6 +238,11 @@ func transformToV2(jsonRaw []byte, ctx client.Context) (json.RawMessage, error) if err != nil { return nil, fmt.Errorf("marshalling transformation result failed: %v", err) } + + // remove all prehash_key_before_comparison entries not supported by ics23 versions used by v2.x + result = bytes.ReplaceAll(result, []byte(`,"prehash_key_before_comparison":false`), []byte{}) + result = bytes.ReplaceAll(result, []byte(`,"prehash_key_before_comparison":true`), []byte{}) + return result, nil } @@ -247,7 +253,8 @@ func transformGenesis(ctx client.Context, targetVersion IcsVersion, jsonRaw []by var err error = nil switch targetVersion { - case v2_x, v3_0_x, v3_1_x: + // v2.x, v3.0-v3.2 share same consumer genesis type + case v2_x, v3_0_x, v3_1_x, v3_2_x: newConsumerGenesis, err = transformToV2(jsonRaw, ctx) case v3_3_x: newConsumerGenesis, err = transformToV33(jsonRaw, ctx)