Skip to content

Commit

Permalink
fix: correctly support absolute timeouts in ica sendTx cli
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Feb 29, 2024
1 parent bb74388 commit 5627e49
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules/apps/27-interchain-accounts/controller/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,19 @@ If no timeout value is set then a default relative timeout value of 10 minutes i
}

// NOTE: relative timeouts using block height are not supported.
if !absoluteTimeouts && timeoutTimestamp == 0 {
return errors.New("relative timeouts must provide a non zero value timestamp")
}
if !absoluteTimeouts {
if timeoutTimestamp == 0 {
return errors.New("relative timeouts must provide a non zero value timestamp")
}

// use local clock time as reference time for calculating timeout timestamp.
now := time.Now().UnixNano()
if now <= 0 {
return errors.New("local clock time is not greater than Jan 1st, 1970 12:00 AM")
}
// use local clock time as reference time for calculating timeout timestamp.
now := time.Now().UnixNano()
if now <= 0 {
return errors.New("local clock time is not greater than Jan 1st, 1970 12:00 AM")
}

timeoutTimestamp = uint64(now) + timeoutTimestamp
timeoutTimestamp = uint64(now) + timeoutTimestamp
}

msg := types.NewMsgSendTx(owner, connectionID, timeoutTimestamp, icaMsgData)

Expand Down

0 comments on commit 5627e49

Please sign in to comment.