Skip to content

Commit

Permalink
Fix/get asset (#7)
Browse files Browse the repository at this point in the history
* fix: get asset method
  • Loading branch information
2yuri authored Oct 27, 2022
1 parent e55e103 commit aed35ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
jobs:
ensure-code:
uses: klever-io/workflow-calls/.github/workflows/go-ci.yaml@master
with:
sonar_check_gate_active: false
secrets:
sonar_host_url: ${{ secrets.SONAR_HOST_URL }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions provider/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (kc *kleverChain) GetAsset(assetID string) (*proto.KDAData, error) {
} `json:"data"`
}{}

err := kc.httpClient.Get(fmt.Sprintf("%s/assets/%s", kc.networkConfig.GetAPIUri(), assetID), &result)
err := kc.httpClient.Get(fmt.Sprintf("%s/asset/%s", kc.networkConfig.GetNodeUri(), assetID), &result)

return result.Data.Asset, err
}
Expand Down Expand Up @@ -91,8 +91,9 @@ func (kc *kleverChain) AssetTrigger(
return nil, fmt.Errorf("can only add one roler per trigger")
}

stakingInfo := &models.StakingInfo{}
var stakingInfo *models.StakingInfo
if len(op.Staking) > 0 {
stakingInfo = &models.StakingInfo{}
apr, err := strconv.ParseFloat(op.Staking["apr"], 64)
if err != nil {
return nil, fmt.Errorf("invalid apr %s: %w", op.Staking["apr"], err)
Expand Down

0 comments on commit aed35ee

Please sign in to comment.