You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(agent): syncTimeWithSubnet method for HttpAgent (#1240)
# Description
Introduces the `syncTimeWithSubnet` method in the `HttpAgent` class to
sync the time with a particular subnet.
Additionally, makes the `Certificate` sync time with subnet in case a
subnet is used as principal.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
- feat(agent): lookup canister ranges using the `/canister_ranges/<subnet_id>/<ranges>` certificate path
16
16
- feat(agent): introduce the `lookupCanisterRanges`, `lookupCanisterRangesFallback`, and `decodeCanisterRanges` utility functions to lookup canister ranges from certificate trees
17
17
- feat(agent): introduce the `getSubnetIdFromCanister` and `readSubnetState` methods in the `HttpAgent` class
18
+
- feat(agent): introduce the `syncTimeWithSubnet` method in the `HttpAgent` class to sync the time with a particular subnet
18
19
- feat(agent): introduce the `SubnetStatus` utility namespace to request subnet information directly from the IC public API
@@ -1221,7 +1222,7 @@ export class HttpAgent implements Agent {
1221
1222
}
1222
1223
1223
1224
/**
1224
-
* Allows agent to sync its time with the network. Can be called during intialization or mid-lifecycle if the device's clock has drifted away from the network time. This is necessary to set the Expiry for a request
1225
+
* Allows agent to sync its time with the network. Can be called during initialization or mid-lifecycle if the device's clock has drifted away from the network time. This is necessary to set the Expiry for a request
1225
1226
* @param {Principal} canisterIdOverride - Pass a canister ID if you need to sync the time with a particular subnet. Uses the ICP ledger canister by default.
* The agent used to sync time with the IC network, if the certificate fails the freshness check.
207
-
* If the agent does not implement the {@link HttpAgent.getTimeDiffMsecs}, {@link HttpAgent.hasSyncedTime}and {@link HttpAgent.syncTime} methods,
207
+
* If the agent does not implement the {@link HttpAgent.getTimeDiffMsecs}, {@link HttpAgent.hasSyncedTime}, {@link HttpAgent.syncTime} and {@link HttpAgent.syncTimeWithSubnet} methods,
208
208
* time will not be synced in case of a freshness check failure.
0 commit comments