Skip to content

Commit

Permalink
refactor: add getter for the query library
Browse files Browse the repository at this point in the history
  • Loading branch information
EndymionJkb committed Oct 27, 2023
1 parent df4ec3a commit e8bd2ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import "../vault/IVault.sol";
interface IBalancerRelayer {
function getLibrary() external view returns (address);

function getQueryLibrary() external view returns (address);

function getVault() external view returns (IVault);

function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);
Expand Down
4 changes: 4 additions & 0 deletions pkg/standalone-utils/contracts/relayer/BalancerRelayer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ contract BalancerRelayer is IBalancerRelayer, Version, ReentrancyGuard {
return _library;
}

function getQueryLibrary() external view override returns (address) {
return _queryLibrary;
}

function multicall(bytes[] calldata data) external payable override nonReentrant returns (bytes[] memory results) {
uint256 numData = data.length;

Expand Down
6 changes: 5 additions & 1 deletion pkg/standalone-utils/test/BaseRelayerLibrary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { deploy, deployedAt } from '@balancer-labs/v2-helpers/src/contract';
import * as expectEvent from '@balancer-labs/v2-helpers/src/test/expectEvent';
import { actionId } from '@balancer-labs/v2-helpers/src/models/misc/actions';

import { ANY_ADDRESS, MAX_UINT256 } from '@balancer-labs/v2-helpers/src/constants';
import { ANY_ADDRESS, MAX_UINT256, ZERO_ADDRESS } from '@balancer-labs/v2-helpers/src/constants';
import Vault from '@balancer-labs/v2-helpers/src/models/vault/Vault';
import { BigNumberish, bn, fp } from '@balancer-labs/v2-helpers/src/numbers';
import { toChainedReference } from './helpers/chainedReferences';
Expand Down Expand Up @@ -48,6 +48,10 @@ describe('BaseRelayerLibrary', function () {
expect(await relayer.getLibrary()).to.equal(relayerLibrary.address);
});

it('returns the query library address', async () => {
expect(await relayer.getQueryLibrary()).not.to.equal(ZERO_ADDRESS);
});

it('returns the vault address', async () => {
expect(await relayer.getVault()).to.equal(vault.address);
});
Expand Down

0 comments on commit e8bd2ea

Please sign in to comment.