This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- check preCommit Data
- Loading branch information
Eunsoo Park
authored
Jan 8, 2021
1 parent
d9f5b7b
commit 15f4fbc
Showing
8 changed files
with
137 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/hex" | ||
"fmt" | ||
"github.com/icon-project/rewardcalculator/common" | ||
"github.com/icon-project/rewardcalculator/core" | ||
"log" | ||
) | ||
|
||
func (cli *CLI) query(dbName string, key string) { | ||
fmt.Printf("Query account. DB name: %s Address: %s\n", dbName, key) | ||
func (cli *CLI) query(dbName string, key string, txHash []byte) { | ||
fmt.Printf("Query account. DB name: %s Address: %s TXHash: %s\n", | ||
dbName, key, hex.EncodeToString(txHash)) | ||
|
||
ctx, err := core.NewContext(DBDir, DBType, dbName, 0, "") | ||
if nil != err { | ||
log.Printf("Failed to initialize IScore DB") | ||
return | ||
} | ||
|
||
resp := core.DoQuery(ctx, *common.NewAddressFromString(key)) | ||
req := &core.Query{ | ||
Address: *common.NewAddressFromString(key), | ||
TXHash: txHash, | ||
} | ||
|
||
resp := core.DoQuery(ctx, req) | ||
|
||
fmt.Printf("Get value %s for %s\n", resp.IScore.String(), key) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters