diff --git a/.goreleaser-cross.yaml b/.goreleaser-cross.yaml index e4eedb22..dab046c3 100644 --- a/.goreleaser-cross.yaml +++ b/.goreleaser-cross.yaml @@ -134,7 +134,7 @@ archives: - none* checksum: - name_template: '{{ .ProjectName }}d_v{{ .Version }}_{{ if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}_cross_checksums.txt' + name_template: '{{ .ProjectName }}d_v{{ .Version }}_{{ if eq .Env.BUILD_TAG "testnet" }}testnet{{ end }}_cross_checksums.txt' dockers: - use: buildx diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 72e55ff7..b316b364 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -60,7 +60,7 @@ archives: files: - none* checksum: - name_template: '{{ .ProjectName }}d_v{{ .Version }}_{{ if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}_checksums.txt' + name_template: '{{ .ProjectName }}d_v{{ .Version }}_{{ if eq .Env.BUILD_TAG "testnet" }}testnet{{ end }}_checksums.txt' dockers: - use: buildx goos: linux diff --git a/CHANGELOG.md b/CHANGELOG.md index 7433c930..b833829f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,16 @@ Contains bug fixes. Contains all the PRs that improved the code without changing the behaviors. --> +# v1.0.2-Prerelease + +## Added + +## Changed +- Updated thorchain claim server address handling + +## Fixed +- Fixed Regression Test Version Issues + # v1.0.1-Prerelease ## Added diff --git a/test/regression/cmd/export.go b/test/regression/cmd/export.go index dae96fb8..ffbcd419 100644 --- a/test/regression/cmd/export.go +++ b/test/regression/cmd/export.go @@ -44,6 +44,7 @@ func export(path string) error { appState, _ := export["app_state"].(map[string]any) claimArkeo, _ := appState["claimarkeo"].(map[string]any) params, _ := claimArkeo["params"].(map[string]any) + delete(export, "app_version") delete(params, "airdrop_start_time") staking, _ := appState["staking"].(map[string]any) validators, _ := staking["validators"].([]any) diff --git a/test/regression/mnt/exports/suites_contracts_pay-as-you-go.json b/test/regression/mnt/exports/suites_contracts_pay-as-you-go.json index 7a501b76..2c532eb8 100644 --- a/test/regression/mnt/exports/suites_contracts_pay-as-you-go.json +++ b/test/regression/mnt/exports/suites_contracts_pay-as-you-go.json @@ -690,7 +690,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_contracts_subscription.json b/test/regression/mnt/exports/suites_contracts_subscription.json index 0f673df1..c3eeea7b 100644 --- a/test/regression/mnt/exports/suites_contracts_subscription.json +++ b/test/regression/mnt/exports/suites_contracts_subscription.json @@ -708,7 +708,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_core_send.json b/test/regression/mnt/exports/suites_core_send.json index d72943be..88a02d22 100644 --- a/test/regression/mnt/exports/suites_core_send.json +++ b/test/regression/mnt/exports/suites_core_send.json @@ -583,7 +583,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_initialize.json b/test/regression/mnt/exports/suites_initialize.json index 13d7817d..559c4ace 100644 --- a/test/regression/mnt/exports/suites_initialize.json +++ b/test/regression/mnt/exports/suites_initialize.json @@ -580,7 +580,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_providers_providers.json b/test/regression/mnt/exports/suites_providers_providers.json index 07cd9f65..0595f67a 100644 --- a/test/regression/mnt/exports/suites_providers_providers.json +++ b/test/regression/mnt/exports/suites_providers_providers.json @@ -594,7 +594,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_sentinel_contract_config.json b/test/regression/mnt/exports/suites_sentinel_contract_config.json index dc413497..7978be7d 100644 --- a/test/regression/mnt/exports/suites_sentinel_contract_config.json +++ b/test/regression/mnt/exports/suites_sentinel_contract_config.json @@ -667,7 +667,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/test/regression/mnt/exports/suites_sentinel_sentinel.json b/test/regression/mnt/exports/suites_sentinel_sentinel.json index efdd4fa1..2fa669f4 100644 --- a/test/regression/mnt/exports/suites_sentinel_sentinel.json +++ b/test/regression/mnt/exports/suites_sentinel_sentinel.json @@ -560,7 +560,6 @@ "upgrade": {}, "vesting": {} }, - "app_version": "v1.0.0-prerelease", "chain_id": "arkeo", "consensus": { "params": { diff --git a/x/claim/keeper/msg_server_claim_thorchain_test.go b/x/claim/keeper/msg_server_claim_thorchain_test.go index bff4b920..8d30ca62 100644 --- a/x/claim/keeper/msg_server_claim_thorchain_test.go +++ b/x/claim/keeper/msg_server_claim_thorchain_test.go @@ -10,7 +10,7 @@ import ( "github.com/arkeonetwork/arkeo/x/claim/types" ) -func TestClaimThorchain(t *testing.T) { +func TestClaimThorchainTestnetAddress(t *testing.T) { msgServer, keepers, ctx := setupMsgServer(t) sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -81,3 +81,75 @@ func TestClaimThorchain(t *testing.T) { _, err = msgServer.ClaimThorchain(ctx, &claimMessage) require.ErrorIs(t, err, types.ErrNoClaimableAmount) } + +func TestClaimThorchainMainnetAddress(t *testing.T) { + msgServer, keepers, ctx := setupMsgServer(t) + sdkCtx := sdk.UnwrapSDKContext(ctx) + + config := sdk.GetConfig() + config.SetBech32PrefixForAccount("arkeo", "arkeopub") + + arkeoServerAddress, err := sdk.AccAddressFromBech32("arkeo1z02ke8639m47g9dfrheegr2u9zecegt50fjg7v") + require.NoError(t, err) + + fromAddr := utils.GetRandomArkeoAddress() + toAddr := utils.GetRandomArkeoAddress() + + claimRecordFrom := types.ClaimRecord{ + Chain: types.ARKEO, + Address: fromAddr.String(), + AmountClaim: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + AmountVote: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + AmountDelegate: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + } + claimRecordTo := types.ClaimRecord{ + Chain: types.ARKEO, + Address: toAddr.String(), + AmountClaim: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + AmountVote: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + AmountDelegate: sdk.NewInt64Coin(types.DefaultClaimDenom, 100), + } + err = keepers.ClaimKeeper.SetClaimRecord(sdkCtx, claimRecordFrom) + require.NoError(t, err) + err = keepers.ClaimKeeper.SetClaimRecord(sdkCtx, claimRecordTo) + require.NoError(t, err) + + // mint coins to module account + err = keepers.BankKeeper.MintCoins(sdkCtx, types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin(types.DefaultClaimDenom, 10000))) + require.NoError(t, err) + + invalidClaimMessage := types.MsgClaimThorchain{ + Creator: fromAddr.String(), + FromAddress: fromAddr.String(), + ToAddress: toAddr.String(), + } + _, err = msgServer.ClaimThorchain(ctx, &invalidClaimMessage) + require.ErrorIs(t, types.ErrInvalidCreator, err) + + claimMessage := types.MsgClaimThorchain{ + Creator: arkeoServerAddress.String(), + FromAddress: fromAddr.String(), + ToAddress: toAddr.String(), + } + _, err = msgServer.ClaimThorchain(ctx, &claimMessage) + require.NoError(t, err) + + // check if claimrecord is updated + claimRecordFrom, err = keepers.ClaimKeeper.GetClaimRecord(sdkCtx, fromAddr.String(), types.ARKEO) + require.NoError(t, err) + require.True(t, claimRecordFrom.IsEmpty()) + + claimRecordTo, err = keepers.ClaimKeeper.GetClaimRecord(sdkCtx, toAddr.String(), types.ARKEO) + require.NoError(t, err) + require.True(t, !claimRecordTo.IsEmpty()) + + require.Equal(t, claimRecordTo.Address, toAddr.String()) + require.Equal(t, claimRecordTo.Chain, types.ARKEO) + require.Equal(t, claimRecordTo.AmountClaim, sdk.NewInt64Coin(types.DefaultClaimDenom, 200)) + require.Equal(t, claimRecordTo.AmountVote, sdk.NewInt64Coin(types.DefaultClaimDenom, 200)) + require.Equal(t, claimRecordTo.AmountDelegate, sdk.NewInt64Coin(types.DefaultClaimDenom, 200)) + + // attempt to claim again to ensure it fails. + _, err = msgServer.ClaimThorchain(ctx, &claimMessage) + require.ErrorIs(t, err, types.ErrNoClaimableAmount) +}