Skip to content

Commit 8561aa7

Browse files
committed
update xnet cli
1 parent 60b7ef4 commit 8561aa7

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

tools/osp-cli/cli/cli_admin_http.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ func OpenChannel() {
6464
func SendToken() {
6565
amtWei := utils.Float2Wei(*amount)
6666
payID, err := utils.RequestSendToken(
67-
*adminhostport, ctype.Hex2Addr(*receiver), ctype.Hex2Addr(*tokenaddr), amtWei, 0)
67+
*adminhostport, ctype.Hex2Addr(*receiver), ctype.Hex2Addr(*tokenaddr), amtWei, *netid)
6868
if err != nil {
6969
log.Error(err)
7070
return
7171
}
72-
log.Infof("requested to send payment %x to %s, token %s, amount %f",
73-
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount)
72+
if *netid == 0 {
73+
log.Infof("requested to send payment %x to %s, token %s, amount %f",
74+
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount)
75+
} else {
76+
log.Infof("requested to send payment %x to %s, token %s, amount %f, netid %d",
77+
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount, *netid)
78+
}
7479
}
7580

7681
func MakeDeposit() {

tools/osp-cli/cli/cli_flags.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ var (
4646
argfinalize = flag.String("finalize", "", "arg for query finalized")
4747
argoutcome = flag.String("outcome", "", "arg for query outcome")
4848
argdecode = flag.Bool("decode", false, "decode arg according to multisession app format")
49-
// for db update
50-
bridgeaddr = flag.String("bridgeaddr", "", "net bridge address")
51-
netid = flag.Uint64("netid", 0, "net id")
52-
localtoken = flag.String("localtoken", "", "local token address")
49+
netid = flag.Uint64("netid", 0, "net id")
50+
bridgeaddr = flag.String("bridgeaddr", "", "net bridge address")
51+
localtoken = flag.String("localtoken", "", "local token address")
5352
)
5453

5554
func CheckFlags() {

0 commit comments

Comments
 (0)