Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed Jun 24, 2024
1 parent 4d6fb39 commit c9cb724
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions common/price_compoent/price_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func GetPriceUsd(tokenType global_const.TokenType) (float64, error) {
if global_const.IsStableToken(tokenType) {
return 1, nil
}
//if tokenType == global_const.ETH {
// return 3100, nil
//}
if tokenType == global_const.TokenTypeETH {
return 3500, nil
}
tokenUrl, ok := URLMap[tokenType]
if !ok {
return 0, xerrors.Errorf("tokens type [%w] not found", tokenType)
Expand Down Expand Up @@ -76,7 +76,7 @@ func GetPriceUsd(tokenType global_const.TokenType) (float64, error) {
return strconv.ParseFloat(usdstr, 64)
}

// GetToken Get The FromToken/ToToken Rate
// GetToken Get The FromToken/ToToken Ratew
func GetToken(fromToken global_const.TokenType, toToken global_const.TokenType) (float64, error) {
if toToken == global_const.TokenTypeUSDT {
return GetPriceUsd(fromToken)
Expand Down
6 changes: 4 additions & 2 deletions rpc_server/api/v1/paymaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,12 @@ func parseTryPayUserOperationParams(params []interface{}) (*model.UserOpRequest,
}

if extra["token"] != nil {
result.UserPayErc20Token = extra["token"].(global_const.TokenType)
tokenStr := extra["token"].(string)
result.UserPayErc20Token = global_const.TokenType(tokenStr)
}
if extra["version"] != nil {
result.EntryPointVersion = extra["version"].(global_const.EntrypointVersion)
versionStr := extra["version"].(string)
result.EntryPointVersion = global_const.EntrypointVersion(versionStr)
}
return &result, nil
}
Expand Down

0 comments on commit c9cb724

Please sign in to comment.