Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

update with klaytn v1.10.2 #156

Merged
merged 6 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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 @JayChoi1736

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/DEV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
11 changes: 5 additions & 6 deletions klaytn/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -1627,28 +1627,27 @@ 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 {
// If PoC(=KGF) address is empty, reward must be given to reward base(= block proposer).
// 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 {
// If KIR address is empty, reward must be given to reward base(= block proposer).
// 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)
}

Expand Down
2 changes: 1 addition & 1 deletion services/network_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

var (
// rosetta-klaytn version
middlewareVersion = "1.0.5"
middlewareVersion = "1.0.7"

defaultNetworkOptions = &types.NetworkOptionsResponse{
Version: &types.Version{
Expand Down