feat(config): optimize log for config without Blackhole account by zeusoo001 · Pull Request #6356 · tronprotocol/java-tron
What does this PR do?
Optimize the log for configuration without Blackhole account. Fixes #6299
Why are these changes required?
This PR has been tested by:
- Unit Tests
- Manual Testing
Follow up
Extra details
zeusoo001
changed the title
feat(config): optimize the log for configuration without Blackhole account
feat(config): optimize log for config without Blackhole account
| assertsAddress.put(accountName, address); | ||
| } | ||
| if (assertsAddress.get(ACCOUNT_BLACKHOLE) == null) { | ||
| throw new TronError("Account[Blackhole] is not configured.", TronError.ErrCode.GENESIS_BLOCK_INIT); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ACCOUNT_BLACKHOLE instead of Blackhole?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this process occurs when the genesis block is being initialized
| AccountStore.setAccount(config); | ||
| Assert.fail(); | ||
| } catch (Throwable e) { | ||
| Assert.assertTrue(e instanceof TronError); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add Assert.assertEquals("Account[Blackhole] is not configured.", e.getMessage());?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is enough to judge the exception type, which is mainly functional testing rather than specific log information comparison.
This file contains hidden or 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