Skip to content

Commit 22f066f

Browse files
committed
renamed timestamp to block_time
1 parent 711dd09 commit 22f066f

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/contract.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3772,7 +3772,7 @@ mod tests {
37723772
amount: Uint128(2500),
37733773
},
37743774
memo: Some("my transfer message #3".to_string()),
3775-
timestamp: 1571797419,
3775+
block_time: 1571797419,
37763776
block_height: 12345,
37773777
},
37783778
RichTx {
@@ -3787,7 +3787,7 @@ mod tests {
37873787
amount: Uint128(500),
37883788
},
37893789
memo: Some("my transfer message #2".to_string()),
3790-
timestamp: 1571797419,
3790+
block_time: 1571797419,
37913791
block_height: 12345,
37923792
},
37933793
RichTx {
@@ -3802,7 +3802,7 @@ mod tests {
38023802
amount: Uint128(1000),
38033803
},
38043804
memo: Some("my transfer message #1".to_string()),
3805-
timestamp: 1571797419,
3805+
block_time: 1571797419,
38063806
block_height: 12345,
38073807
},
38083808
RichTx {
@@ -3813,7 +3813,7 @@ mod tests {
38133813
amount: Uint128(1000),
38143814
},
38153815
memo: None,
3816-
timestamp: 1571797419,
3816+
block_time: 1571797419,
38173817
block_height: 12345,
38183818
},
38193819
RichTx {
@@ -3827,7 +3827,7 @@ mod tests {
38273827
amount: Uint128(100),
38283828
},
38293829
memo: Some("my mint message".to_string()),
3830-
timestamp: 1571797419,
3830+
block_time: 1571797419,
38313831
block_height: 12345,
38323832
},
38333833
RichTx {
@@ -3838,7 +3838,7 @@ mod tests {
38383838
amount: Uint128(1000),
38393839
},
38403840
memo: None,
3841-
timestamp: 1571797419,
3841+
block_time: 1571797419,
38423842
block_height: 12345,
38433843
},
38443844
RichTx {
@@ -3852,7 +3852,7 @@ mod tests {
38523852
amount: Uint128(1),
38533853
},
38543854
memo: Some("my burn message".to_string()),
3855-
timestamp: 1571797419,
3855+
block_time: 1571797419,
38563856
block_height: 12345,
38573857
},
38583858
RichTx {
@@ -3867,7 +3867,7 @@ mod tests {
38673867
},
38683868

38693869
memo: Some("Initial Balance".to_string()),
3870-
timestamp: 1571797419,
3870+
block_time: 1571797419,
38713871
block_height: 12345,
38723872
},
38733873
];

src/transaction_history.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub struct Tx {
2626
pub coins: Coin,
2727
#[serde(skip_serializing_if = "Option::is_none")]
2828
pub memo: Option<String>,
29-
// The timestamp and block height are optional so that the JSON schema
29+
// The block time and block height are optional so that the JSON schema
3030
// reflects that some SNIP-20 contracts may not include this info.
31-
pub timestamp: Option<u64>,
31+
pub block_time: Option<u64>,
3232
pub block_height: Option<u64>,
3333
}
3434

@@ -64,7 +64,7 @@ pub struct RichTx {
6464
pub coins: Coin,
6565
#[serde(skip_serializing_if = "Option::is_none")]
6666
pub memo: Option<String>,
67-
pub timestamp: u64,
67+
pub block_time: u64,
6868
pub block_height: u64,
6969
}
7070

@@ -80,7 +80,7 @@ struct StoredLegacyTransfer {
8080
receiver: CanonicalAddr,
8181
coins: Coin,
8282
memo: Option<String>,
83-
timestamp: u64,
83+
block_time: u64,
8484
block_height: u64,
8585
}
8686

@@ -93,7 +93,7 @@ impl StoredLegacyTransfer {
9393
receiver: api.human_address(&self.receiver)?,
9494
coins: self.coins,
9595
memo: self.memo,
96-
timestamp: Some(self.timestamp),
96+
block_time: Some(self.block_time),
9797
block_height: Some(self.block_height),
9898
};
9999
Ok(tx)
@@ -239,7 +239,7 @@ struct StoredRichTx {
239239
action: StoredTxAction,
240240
coins: Coin,
241241
memo: Option<String>,
242-
timestamp: u64,
242+
block_time: u64,
243243
block_height: u64,
244244
}
245245

@@ -256,7 +256,7 @@ impl StoredRichTx {
256256
action,
257257
coins,
258258
memo,
259-
timestamp: block.time,
259+
block_time: block.time,
260260
block_height: block.height,
261261
}
262262
}
@@ -267,7 +267,7 @@ impl StoredRichTx {
267267
action: self.action.into_humanized(api)?,
268268
coins: self.coins,
269269
memo: self.memo,
270-
timestamp: self.timestamp,
270+
block_time: self.block_time,
271271
block_height: self.block_height,
272272
})
273273
}
@@ -279,7 +279,7 @@ impl StoredRichTx {
279279
action,
280280
coins: transfer.coins,
281281
memo: transfer.memo,
282-
timestamp: transfer.timestamp,
282+
block_time: transfer.block_time,
283283
block_height: transfer.block_height,
284284
}
285285
}
@@ -314,7 +314,7 @@ pub fn store_transfer<S: Storage>(
314314
receiver: receiver.clone(),
315315
coins,
316316
memo,
317-
timestamp: block.time,
317+
block_time: block.time,
318318
block_height: block.height,
319319
};
320320
let tx = StoredRichTx::from_stored_legacy_transfer(transfer.clone());

tests/integration.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ function check_latest_tx_history() {
563563
local from="$5"
564564
local receiver="$6"
565565
local amount="$7"
566-
local timestamp="$8"
566+
local block_time="$8"
567567
local block_height="$9"
568568

569569
local txs
@@ -577,7 +577,7 @@ function check_latest_tx_history() {
577577
assert_eq "$(jq -r '.receiver' <<<"$tx")" "$receiver"
578578
assert_eq "$(jq -r '.coins.amount' <<<"$tx")" "$amount"
579579
assert_eq "$(jq -r '.coins.denom' <<<"$tx")" 'SSCRT'
580-
assert_eq "$(jq -r '.timestamp' <<<"$tx")" "$timestamp"
580+
assert_eq "$(jq -r '.block_time' <<<"$tx")" "$block_time"
581581
assert_eq "$(jq -r '.block_height' <<<"$tx")" "$block_height"
582582

583583
jq -r '.id' <<<"$tx"
@@ -1121,11 +1121,11 @@ function main() {
11211121

11221122
# This first test also sets the `VK[*]` global variables that are used in the other tests
11231123
test_viewing_key "$contract_addr"
1124-
# test_deposit "$contract_addr"
1125-
# test_transfer "$contract_addr"
1124+
test_deposit "$contract_addr"
1125+
test_transfer "$contract_addr"
11261126
test_send "$contract_addr"
1127-
# test_burn "$contract_addr"
1128-
# test_transfer_from "$contract_addr"
1127+
test_burn "$contract_addr"
1128+
test_transfer_from "$contract_addr"
11291129
test_send_from "$contract_addr"
11301130

11311131
log 'Tests completed successfully'

0 commit comments

Comments
 (0)