From c30b76c94aa01f352458e9e181f8c85ced685d2e Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:12:13 +0900 Subject: [PATCH 1/6] change kir, poc --- go.mod | 2 +- go.sum | 4 ++-- klaytn/client.go | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 18a749c..540bc6f 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/klaytn/rosetta-klaytn require ( github.com/fatih/color v1.13.0 - github.com/klaytn/klaytn v1.10.1 + github.com/klaytn/klaytn v1.10.2 github.com/klaytn/rosetta-sdk-go-klaytn v0.7.10 github.com/spf13/cobra v1.5.0 github.com/stretchr/testify v1.8.0 diff --git a/go.sum b/go.sum index 22abad5..23eeabc 100644 --- a/go.sum +++ b/go.sum @@ -616,8 +616,8 @@ github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPR github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.9.2/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/klaytn/klaytn v1.8.3/go.mod h1:bbf8dqgZn/cLZ+ns+N416knDMKVpyWuUfuOXACpCVH0= -github.com/klaytn/klaytn v1.10.1 h1:XXLP2DYO/0uAg51V0jeJyK+LMOO2vug8qzCSLVIgkSU= -github.com/klaytn/klaytn v1.10.1/go.mod h1:R8eUX9g0sXiiPnQMCDHlWOnDC4oJWWz/1pnudW+1u9c= +github.com/klaytn/klaytn v1.10.2 h1:AAmPn2fcuOTkprMLXkkpvo4uFwqcfAdFpvqBKKqXnNE= +github.com/klaytn/klaytn v1.10.2/go.mod h1:R8eUX9g0sXiiPnQMCDHlWOnDC4oJWWz/1pnudW+1u9c= github.com/klaytn/rosetta-sdk-go-klaytn v0.7.10 h1:ykCtbjVUQQ8NQbWRROXFunmTo81KIdmsujgOPDwPW0M= github.com/klaytn/rosetta-sdk-go-klaytn v0.7.10/go.mod h1:YS9Wj5EvKh7leQJYmtfomC6kMEaqNwjtys+zXbSz0hE= github.com/klaytn/xgo v0.0.0-20220420020737-0d7e3e080122/go.mod h1:1p9sFrvjHQrEknvDHha17xKMZMOqE73LNEGiBt3/3o0= diff --git a/klaytn/client.go b/klaytn/client.go index 79861d2..93a8813 100644 --- a/klaytn/client.go +++ b/klaytn/client.go @@ -1615,7 +1615,7 @@ func (kc *Client) getRewardAndRatioInfo( return nil, nil, nil, fmt.Errorf("could not convert minting amount type from %s", minted) } - // Call `governance_getStakingInfo` to get KIR and KGF addresses. + // Call `governance_getStakingInfo` to get KCF and KFF addresses. var stakingInfo reward.StakingInfo err = kc.c.CallContext(ctx, &stakingInfo, "governance_getStakingInfo", block) if err != nil { @@ -1627,8 +1627,7 @@ func (kc *Client) getRewardAndRatioInfo( rewardAddresses := []string{rewardbase} var kgfAddress, kirAddress string - // TODO-Klaytn: Have to use stakingInfo.KGFAddr instead of stakingInfo.PoCAddr - if common.EmptyAddress(stakingInfo.PoCAddr) { + if common.EmptyAddress(stakingInfo.KFFAddr) { kgfAddress = rewardbase rewardAddresses = append(rewardAddresses, "") } else { @@ -1636,11 +1635,11 @@ func (kc *Client) getRewardAndRatioInfo( // For more info, please check the below source code. // nolint:lll // https://github.com/klaytn/klaytn/blob/7584e71de602ce0367a4fb4e19643b49b076b93c/reward/reward_distributor.go#L116-L121 - kgfAddress = stakingInfo.PoCAddr.String() + kgfAddress = stakingInfo.KFFAddr.String() rewardAddresses = append(rewardAddresses, kgfAddress) } - if common.EmptyAddress(stakingInfo.KIRAddr) { + if common.EmptyAddress(stakingInfo.KCFAddr) { kirAddress = rewardbase rewardAddresses = append(rewardAddresses, "") } else { @@ -1648,7 +1647,7 @@ func (kc *Client) getRewardAndRatioInfo( // For more info, please check the below source code. // nolint:lll // https://github.com/klaytn/klaytn/blob/7584e71de602ce0367a4fb4e19643b49b076b93c/reward/reward_distributor.go#L123-L127 - kirAddress = stakingInfo.KIRAddr.String() + kirAddress = stakingInfo.KCFAddr.String() rewardAddresses = append(rewardAddresses, kirAddress) } From 1e6a43ea3b395a8771c1dcdf64d577bf636851e6 Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:12:22 +0900 Subject: [PATCH 2/6] update release version --- configuration/configuration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/configuration.go b/configuration/configuration.go index c56e5ae..03125d1 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -86,7 +86,7 @@ const ( SkipAdminEnv = "SKIP_ADMIN" // MiddlewareVersion is the version of rosetta-klaytn. - MiddlewareVersion = "1.0.5" + MiddlewareVersion = "1.0.7" ) // Configuration determines how From 543b2fe068a436e3ae27b697151371590d1fbc50 Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:28:45 +0900 Subject: [PATCH 3/6] fix test --- services/network_service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/network_service_test.go b/services/network_service_test.go index 7911043..3de8a3a 100644 --- a/services/network_service_test.go +++ b/services/network_service_test.go @@ -32,7 +32,7 @@ import ( var ( // rosetta-klaytn version - middlewareVersion = "1.0.5" + middlewareVersion = "1.0.7" defaultNetworkOptions = &types.NetworkOptionsResponse{ Version: &types.Version{ From 19b0172834735dc2d9f3ab16ffe0d9b3c9a5d599 Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 14:37:16 +0900 Subject: [PATCH 4/6] add CodeOwners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cccfffb..b9cbcd4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,7 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @jimni1222 @kjhman21 +* @jimni1222 @kjhman21 @kjeom # Order is important; the last matching pattern takes the most # precedence. When someone opens a pull request that only From 623a8c02dece5e26f707764923c840dd257d4266 Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:04:54 +0900 Subject: [PATCH 5/6] test: fix go version in github action --- .github/workflows/DEV.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/DEV.yaml b/.github/workflows/DEV.yaml index 28546e6..0f5015a 100644 --- a/.github/workflows/DEV.yaml +++ b/.github/workflows/DEV.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.18.0' + go-version: '1.18' - name: download dependencies run: | go get ./... @@ -46,7 +46,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.18.0' + go-version: '1.18' - name: check format run: | make check-format @@ -56,7 +56,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.18.0' + go-version: '1.18' - name: check license run: | make check-license @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.18.0' + go-version: '1.18' - name: install dependency run: | go mod download github.com/client9/misspell @@ -79,7 +79,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.18.0' + go-version: '1.18' - name: build test run: | + go get -u go4.org/unsafe/assume-no-moving-gc make test From 442bfa2ea531d5f863459261af6736ebd77f804d Mon Sep 17 00:00:00 2001 From: "Jay (Jaeyeong Choi)" <102955810+JayChoi1736@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:16:13 +0900 Subject: [PATCH 6/6] add codeowner --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b9cbcd4..2195066 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,7 @@ # the repo. Unless a later match takes precedence, # @global-owner1 and @global-owner2 will be requested for # review when someone opens a pull request. -* @jimni1222 @kjhman21 @kjeom +* @jimni1222 @kjhman21 @kjeom @JayChoi1736 # Order is important; the last matching pattern takes the most # precedence. When someone opens a pull request that only