Skip to content

Commit

Permalink
more logs+fix tokenprice in base test
Browse files Browse the repository at this point in the history
  • Loading branch information
livingrockrises committed Oct 31, 2024
1 parent 03cba2c commit 7fc869d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions contracts/token/BiconomyTokenPaymaster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,12 @@ contract BiconomyTokenPaymaster is
// Calculate price by using token and native oracle
uint192 tokenPrice = _fetchPrice(tokenInfo.oracle);
uint192 nativeAssetPrice = _fetchPrice(nativeAssetToUsdOracle);
console2.log("tokenPrice oracle", tokenPrice);

Check failure on line 587 in contracts/token/BiconomyTokenPaymaster.sol

View workflow job for this annotation

GitHub Actions / Lint sources

Unexpected console statement
console2.log("nativeAssetPrice oracle", nativeAssetPrice);

Check failure on line 588 in contracts/token/BiconomyTokenPaymaster.sol

View workflow job for this annotation

GitHub Actions / Lint sources

Unexpected console statement

// Adjust to token decimals
price = (nativeAssetPrice * tokenInfo.decimals) / tokenPrice;
console2.log("derived & used price", price);
}

/// @notice Fetches the latest price from the given oracle.
Expand Down
8 changes: 6 additions & 2 deletions test/unit/concrete/TestTokenPaymaster.Base.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ contract TestTokenPaymasterBase is TestBase {
function setUp() public {
uint256 forkId = vm.createFork("https://developer-access-mainnet.base.org");
vm.selectFork(forkId);

// Set block to latest block
// vm.rollFork(21744650);
// assertEq(block.number, 21744650);
setupPaymasterTestEnvironment();

console2.log("current block timestamp ", block.timestamp);
Expand Down Expand Up @@ -82,7 +86,7 @@ contract TestTokenPaymasterBase is TestBase {
vm.stopPrank();

vm.startPrank(PAYMASTER_OWNER.addr);
tokenPaymaster.setUnaccountedGas(200_000);
tokenPaymaster.setUnaccountedGas(40_000);
vm.stopPrank();

uint256 initialBundlerBalance = BUNDLER.addr.balance;
Expand Down Expand Up @@ -124,7 +128,7 @@ contract TestTokenPaymasterBase is TestBase {
initialPaymasterEpBalance,
initialUserTokenBalance,
initialPaymasterTokenBalance,
401606430000000, // tokenPrice
2672598177,
100000,
this.getMaxPenalty(ops[0]));
}
Expand Down

0 comments on commit 7fc869d

Please sign in to comment.