Skip to content

Commit

Permalink
update multi_index in wasm NftTransferHistoryTable and PRIMARY KEY in…
Browse files Browse the repository at this point in the history
… sql transfer history
  • Loading branch information
laruh committed Sep 3, 2024
1 parent 7ca140a commit 1d49536
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mm2src/coins/nft/storage/db_test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub(crate) fn nft_transfer_history() -> Vec<NftTransferHistory> {
transaction_index: Some(198),
log_index: 495,
value: Default::default(),
transaction_type: Some("Single".to_string()),
transaction_type: Some("Batch".to_string()),
token_address: Address::from_str("0xfd913a305d70a60aac4faac70c739563738e1f81").unwrap(),
from_address: Address::from_str("0x6fad0ec6bb76914b2a2a800686acc22970645820").unwrap(),
to_address: Address::from_str("0xf622a6c52c94b500542e2ae6bcad24c53bc5b6a2").unwrap(),
Expand Down Expand Up @@ -290,9 +290,9 @@ pub(crate) fn nft_transfer_history() -> Vec<NftTransferHistory> {
block_hash: Some("0x3d68b78391fb3cf8570df27036214f7e9a5a6a45d309197936f51d826041bfe7".to_string()),
transaction_hash: "0x1e9f04e9b571b283bde02c98c2a97da39b2bb665b57c1f2b0b733f9b681debbe".to_string(),
transaction_index: Some(198),
log_index: 496,
log_index: 495,
value: Default::default(),
transaction_type: Some("Single".to_string()),
transaction_type: Some("Batch".to_string()),
token_address: Address::from_str("0xfd913a305d70a60aac4faac70c739563738e1f81").unwrap(),
from_address: Address::from_str("0x6fad0ec6bb76914b2a2a800686acc22970645820").unwrap(),
to_address: Address::from_str("0xf622a6c52c94b500542e2ae6bcad24c53bc5b6a2").unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/nft/storage/sql_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn create_transfer_history_table_sql(chain: &Chain) -> Result<String, SqlError>
image_domain TEXT,
token_name TEXT,
details_json TEXT,
PRIMARY KEY (transaction_hash, log_index)
PRIMARY KEY (transaction_hash, log_index, token_id)
);",
safe_table_name.inner()
);
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/nft/storage/wasm/wasm_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ impl TableSignature for NftTransferHistoryTable {
)?;
table.create_multi_index(
Self::CHAIN_TX_HASH_LOG_INDEX_INDEX,
&["chain", "transaction_hash", "log_index"],
&["chain", "transaction_hash", "log_index", "token_id"],
true,
)?;
table.create_multi_index(CHAIN_BLOCK_NUMBER_INDEX, &["chain", "block_number"], false)?;
Expand Down

0 comments on commit 1d49536

Please sign in to comment.