-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update SubscribeEpochs * add logger for rpc request * update doc * remove comment * simplify logger Co-authored-by: dayong <dayong@conflux-chain.org>
- Loading branch information
1 parent
16b4157
commit 97831af
Showing
9 changed files
with
126 additions
and
40 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
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,5 +1,5 @@ | ||
NodeURL = "http://127.0.0.1:12539" | ||
BlockHash = "0x33649d83178942524f52c3a3a7b9a86ea161f72ef2e5c40494ca1341c7a86c9d" | ||
TransactionHash = "0xdca75fe1d4c3187702b433a29609c8ef3125d7a2936a80348f9ea6f400110cea" | ||
BlockHashOfNewContract = "0x3e5f823bcb4228e00b8da839667285e551499382e928b43dbebecf82088df5bf" | ||
ERC20Address = "NET4021259308:TYPE.CONTRACT:ACC2PMEWZKPR34N3DEU10S2DM47SSBMXS2RFYWAD9X" | ||
NodeURL = "http://127.0.0.1:22537" | ||
BlockHash = "0xbbbf51dab51c02413413edf0c5d9e03f7c2bfeb584d4154d82f0b38cd63f2e22" | ||
TransactionHash = "0x1498b96d6e3976b8f167a49436addcb907bb8c202df6100aebb2441a55654691" | ||
BlockHashOfNewContract = "0x2e7dd6c1896dd15729fd9f3573b5a6033464385951f557f44906e8a32d3f1307" | ||
ERC20Address = "NET8958:TYPE.CONTRACT:ACC2PMEWZKPR34N3DEU10S2DM47SSBMXS2CUF67X96" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package types | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/Conflux-Chain/go-conflux-sdk/rpc" | ||
"github.com/Conflux-Chain/go-conflux-sdk/utils" | ||
) | ||
|
||
func DefaultCallRPCLog(method string, args []interface{}, result interface{}, resultError error, duration time.Duration) { | ||
if resultError == nil { | ||
fmt.Printf("call rpc %v sucessfully, args %+v, result %+v, use %v\n", method, utils.PrettyJSON(args), utils.PrettyJSON(result), duration) | ||
return | ||
} | ||
fmt.Printf("call rpc %v failed, args %+v, error: %+v, use %v\n", method, args, resultError, duration) | ||
} | ||
|
||
func DefaultBatchCallRPCLog(b []rpc.BatchElem, err error, duration time.Duration) { | ||
if err == nil { | ||
fmt.Printf("batch call %+v sucessfully, use %v\n", b, duration) | ||
return | ||
} | ||
fmt.Printf("batch call %+v failed, error: %+v, use %v\n", b, err, duration) | ||
} |