Skip to content

Commit

Permalink
Revert baseStake change
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstph-dvx committed Oct 23, 2024
1 parent 36d5f96 commit b63a189
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
10 changes: 0 additions & 10 deletions src/createRollupPrepareDeploymentParamsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
SequencerInboxMaxTimeVariation,
getDefaultSequencerInboxMaxTimeVariation,
} from './getDefaultSequencerInboxMaxTimeVariation';
import { scaleToNativeTokenDecimals } from './utils/decimals';

export type CreateRollupPrepareDeploymentParamsConfigResult =
CreateRollupFunctionInputs[0]['config'];
Expand Down Expand Up @@ -53,7 +52,6 @@ export type CreateRollupPrepareDeploymentParamsConfigParams = Prettify<
* @param {BigInt} [params.sequencerInboxMaxTimeVariation.futureBlocks]
* @param {BigInt} [params.sequencerInboxMaxTimeVariation.delaySeconds]
* @param {BigInt} [params.sequencerInboxMaxTimeVariation.futureSeconds]
* @param {number} [params.decimals]
*
* @returns {Object} {@link CreateRollupPrepareDeploymentParamsConfigResult}
*
Expand Down Expand Up @@ -113,18 +111,10 @@ export function createRollupPrepareDeploymentParamsConfig<TChain extends Chain |
};
}

// Non-18 decimals, scale baseStake
let baseStake = params.baseStake ?? defaults.baseStake;
const decimals = params.decimals;
if (typeof decimals === 'number') {
baseStake = scaleToNativeTokenDecimals({ amount: baseStake, decimals });
}

return {
...defaults,
...paramsByParentBlockTime,
...params,
baseStake,
chainConfig: JSON.stringify(
chainConfig ??
prepareChainConfig({
Expand Down
29 changes: 0 additions & 29 deletions src/createRollupPrepareDeploymentParamsConfig.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,32 +192,3 @@ it('creates a config for a chain on top of a custom parent chain', () => {
}),
).toMatchSnapshot();
});

it('creates config for a chain with non-18 decimals token on top of arbitrum sepolia with defaults', async () => {
const arbitrumSepoliaClient = createPublicClient({
chain: arbitrumSepolia,
transport: http(),
});

expect(
createRollupPrepareDeploymentParamsConfig(arbitrumSepoliaClient, {
owner: vitalik,
chainId,
decimals: 6,
}),
).toMatchSnapshot();
});

it('creates config for a chain with non-18 decimals token on top of arbitrum sepolia with overrides', () => {
const arbitrumSepoliaClient = createPublicClient({
chain: arbitrumSepolia,
transport: http(),
});

expect(
createRollupPrepareDeploymentParamsConfig(arbitrumSepoliaClient, {
...getOverrides({ owner: vitalik, chainId }),
decimals: 6,
}),
).toMatchSnapshot();
});
3 changes: 1 addition & 2 deletions src/createRollupPrepareTransactionRequest.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,12 +446,11 @@ it(`successfully prepare transaction request if "params.nativeToken" doesn't use
}),
batchPosters: [deployer.address],
validators: [deployer.address],
nativeToken: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d',
nativeToken: '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d', // USDC
},
value: createRollupDefaultRetryablesFees,
account: deployer.address,
publicClient,

gasOverrides: { gasLimit: { base: 1_000n } },
});

Expand Down

0 comments on commit b63a189

Please sign in to comment.