Skip to content

Commit

Permalink
update xnet cli
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou committed Feb 14, 2021
1 parent 60b7ef4 commit 8561aa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 8 additions & 3 deletions tools/osp-cli/cli/cli_admin_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,18 @@ func OpenChannel() {
func SendToken() {
amtWei := utils.Float2Wei(*amount)
payID, err := utils.RequestSendToken(
*adminhostport, ctype.Hex2Addr(*receiver), ctype.Hex2Addr(*tokenaddr), amtWei, 0)
*adminhostport, ctype.Hex2Addr(*receiver), ctype.Hex2Addr(*tokenaddr), amtWei, *netid)
if err != nil {
log.Error(err)
return
}
log.Infof("requested to send payment %x to %s, token %s, amount %f",
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount)
if *netid == 0 {
log.Infof("requested to send payment %x to %s, token %s, amount %f",
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount)
} else {
log.Infof("requested to send payment %x to %s, token %s, amount %f, netid %d",
payID, *receiver, utils.PrintTokenAddr(ctype.Hex2Addr(*tokenaddr)), *amount, *netid)
}
}

func MakeDeposit() {
Expand Down
7 changes: 3 additions & 4 deletions tools/osp-cli/cli/cli_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ var (
argfinalize = flag.String("finalize", "", "arg for query finalized")
argoutcome = flag.String("outcome", "", "arg for query outcome")
argdecode = flag.Bool("decode", false, "decode arg according to multisession app format")
// for db update
bridgeaddr = flag.String("bridgeaddr", "", "net bridge address")
netid = flag.Uint64("netid", 0, "net id")
localtoken = flag.String("localtoken", "", "local token address")
netid = flag.Uint64("netid", 0, "net id")
bridgeaddr = flag.String("bridgeaddr", "", "net bridge address")
localtoken = flag.String("localtoken", "", "local token address")
)

func CheckFlags() {
Expand Down

0 comments on commit 8561aa7

Please sign in to comment.