Skip to content

Commit 831d3dc

Browse files
add log (#42)
1 parent 1289cc8 commit 831d3dc

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

appchain/src/lib.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ pub mod pallet {
645645
pub fn force_set_next_set_id(origin: OriginFor<T>, next_set_id: u32) -> DispatchResult {
646646
ensure_root(origin)?;
647647
<NextSetId<T>>::put(next_set_id);
648+
log!(info, "️️️force set next_set_id, next_set_id is : {:?} ", NextSetId::<T>::get());
648649
Ok(())
649650
}
650651

@@ -1087,7 +1088,7 @@ pub mod pallet {
10871088
NextNotificationId::<T>::try_mutate(|next_id| -> DispatchResultWithPostInfo {
10881089
if let Some(v) = next_id.checked_add(1) {
10891090
*next_id = v;
1090-
log!(debug, "️️️increase next_notification_id{:?} ", v);
1091+
log!(debug, "️️️increase next_notification_id: {:?} ", v);
10911092
} else {
10921093
return Err(Error::<T>::NextNotificationIdOverflow.into())
10931094
}
@@ -1099,6 +1100,7 @@ pub mod pallet {
10991100
NextSetId::<T>::try_mutate(|next_id| -> DispatchResultWithPostInfo {
11001101
if let Some(v) = next_id.checked_add(1) {
11011102
*next_id = v;
1103+
log!(debug, "️️️increase next_set_id: {:?} ", v);
11021104
} else {
11031105
return Err(Error::<T>::NextSetIdOverflow.into())
11041106
}
@@ -1252,6 +1254,11 @@ pub mod pallet {
12521254
let set_id = NextSetId::<T>::get();
12531255
Self::deposit_event(Event::NewPlannedValidators { set_id, validators });
12541256
Self::increase_next_set_id()?;
1257+
log!(
1258+
info,
1259+
"️️️processed updata validator set, next_set_id is : {:?} ",
1260+
NextSetId::<T>::get()
1261+
);
12551262
},
12561263
Observation::Burn(event) => {
12571264
Self::increase_next_notification_id()?;
@@ -1282,6 +1289,11 @@ pub mod pallet {
12821289
obs_id,
12831290
result
12841291
);
1292+
log!(
1293+
info,
1294+
"️️️processed burn observation, next_notification_id is : {:?} ",
1295+
NextNotificationId::<T>::get()
1296+
);
12851297
},
12861298
Observation::LockAsset(event) => {
12871299
Self::increase_next_notification_id()?;
@@ -1337,6 +1349,11 @@ pub mod pallet {
13371349
obs_id,
13381350
result
13391351
);
1352+
log!(
1353+
info,
1354+
"️️️processed lock observation, next_notification_id is : {:?} ",
1355+
NextNotificationId::<T>::get()
1356+
);
13401357
},
13411358
}
13421359

appchain/src/mainchain.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<T: Config> Pallet<T> {
8989
let response = pending.try_wait(deadline).map_err(|_| http::Error::DeadlineReached)??;
9090
// Let's check the status code before we proceed to reading the response.
9191
if response.code != 200 {
92-
log!(warn, "Unexpected status code: {}", response.code);
92+
log!(warn, "Unexpected status code when get validator: {}", response.code);
9393
return Err(http::Error::Unknown)
9494
}
9595

@@ -193,7 +193,7 @@ impl<T: Config> Pallet<T> {
193193
let response = pending.try_wait(deadline).map_err(|_| http::Error::DeadlineReached)??;
194194
// Let's check the status code before we proceed to reading the response.
195195
if response.code != 200 {
196-
log!(warn, "Unexpected status code: {}", response.code);
196+
log!(warn, "Unexpected status code when get notification: {}", response.code);
197197
return Err(http::Error::Unknown)
198198
}
199199

0 commit comments

Comments
 (0)