-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove generation of token history row when total supply changes for …
…Mint/Wipe/Burn (#7095) Description: Remove the creation of history rows when the token.total_supply column is adjusted for token mints, burns, or wipes. History rows are added for create, update, or delete operations on the token entity itself. Remove setting for timestamp range on the above mentioned token operations. Add token history row check to existing tests. Related issue(s): Fixes #6998
- Loading branch information
1 parent
c46c7b9
commit 22f2a8d
Showing
13 changed files
with
270 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ror-importer/src/test/java/com/hedera/mirror/importer/domain/token/AbstractTokenTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2023 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.mirror.importer.domain.token; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.hedera.mirror.common.domain.token.Token; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
class AbstractTokenTest { | ||
|
||
@ParameterizedTest | ||
@CsvSource( | ||
textBlock = | ||
""" | ||
-100, , -100 | ||
, 500, 500 | ||
, -500, -500 | ||
1200, -500, 700 | ||
""") | ||
void shouldSetTotalSupplyToNewSupply(Long totalSupply, Long newSupply, Long expected) { | ||
// given | ||
// totalSupply will have a null value here | ||
var token = new Token(); | ||
|
||
// when | ||
// This will set the initial value to totalSupply for the purpose of this test | ||
token.setTotalSupply(totalSupply); | ||
|
||
// This will be the updated value of totalSupply | ||
token.setTotalSupply(newSupply); | ||
|
||
// then | ||
assertThat(token.getTotalSupply()).isEqualTo(expected); | ||
} | ||
} |
Oops, something went wrong.