-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* progress on PoV tests * started precompile migration * finished author precompile tests * bn and callpermit precompiles done * collective precompile done * beginning conviction voting tests * Updated to moonwall4 * fix * added erc20 precompile tests * progress on local asset precompile * Added Local assets tests * modexp tests done * Added proxy tests * progress on proxy tests * finished proxy tests * updated precompile tests * added more precompile tests * progress * added more precompile tests * refactored wormhole tests * added XCM transactor tests * started xcm utils tests * Precompile tests done * done proxy tests * randomness tests * randomness tests * randomness tests * finished randomness tests * added receipt tests * staking tests * more staking tests * more staking * progress * completed staking tests * added subscription tests * added sudo tests * added treasury tests * update moonwall config * added missing conviction tests * txpool progress * tx pool tests done * CI fix * updated prettier CI * editorconfig * pnpm cache * changed CI * fix CI * changes * fix CI * fixed some tests * more test fixes * fixed tests * lint * editor config * pkg fix * updated lockfile * pkg updates * fix import * fix import * archived old-style dev-tests * lint * PR comments * Port ERC20-XCM tests. Add excess gas tests (#2410) * ERC20XCM tests * Add tsx * Moved expect out of xcm helper * Removed unused imports * removed old tests * editorconfig grr * removed smoke tests * Upgraded randomness smoketest * updated randomness comments * Fix conviction MaxVotes (#2401) * Reduce the ConvictionVoting MaxVotes from 512 to 30 * Set MaxVote to 20 * Run toml-sort and update repo reference (#2426) * [MOON-2434] remove deprecated leave delegator functionality (#2349) * remove leave delegator functionality * remove precompile methods * return error for removed call indices * removed scheduleLeaveDelegators calls * de-bun 馃珦 the CI * fix * smoke-fix * fixed ci --------- Co-authored-by: Francisco Gamundi <52399794+fgamundi@users.noreply.github.com> Co-authored-by: Alan Sapede <alan.sapede@gmail.com>
- Loading branch information
1 parent
ad27c07
commit c784d12
Showing
553 changed files
with
30,797 additions
and
15,210 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
ignore-workspace-root-check = true | ||
strict-peer-dependencies = false | ||
registry = https://registry.npmjs.org/ | ||
auto-install-peers = false | ||
node-linker = hoisted | ||
auto-install-peers = true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
pragma solidity >=0.8.3; | ||
|
||
import "./ERC20WithInitialSupply.sol"; | ||
|
||
contract ERC20ExcessGas is ERC20WithInitialSupply { | ||
uint public _gasHog; | ||
|
||
constructor( | ||
string memory name_, | ||
string memory symbol_, | ||
address initialAccount, | ||
uint256 initialSupply | ||
) ERC20WithInitialSupply(name_, symbol_, initialAccount, initialSupply) {} | ||
|
||
function transfer( | ||
address to, | ||
uint256 amount | ||
) public override returns (bool) { | ||
// Consume gas to over Erc20XcmBridgeTransferGasLimit | ||
for (uint i = 0; i < 500; i++) { | ||
_gasHog += i; | ||
} | ||
|
||
address owner = msg.sender; | ||
_transfer(owner, to, amount); | ||
return true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { DevModeContext } from "@moonwall/cli"; | ||
import { ALITH_ADDRESS, alith } from "@moonwall/util"; | ||
|
||
export interface HeavyContract { | ||
deployed: boolean; | ||
account: string; | ||
key: string; | ||
} | ||
/** | ||
* @description Deploy multiple contracts to test the EVM storage limit. | ||
* @param context Context of the test | ||
* @param count Number of contracts to deploy | ||
* @returns | ||
*/ | ||
export const deployHeavyContracts = async (context: DevModeContext, first = 6000, last = 6999) => { | ||
// Generate the contract addresses | ||
const contracts = await Promise.all( | ||
new Array(last - first + 1).fill(0).map(async (_, i) => { | ||
const account = `0x${(i + first).toString(16).padStart(40, "0")}`; | ||
return { | ||
deployed: false, | ||
account, | ||
key: context.polkadotJs().query.evm.accountCodes.key(account), | ||
}; | ||
}) | ||
); | ||
|
||
// Check which contracts are already deployed | ||
for (const contract of contracts) { | ||
contract.deployed = | ||
(await context.polkadotJs().rpc.state.getStorage(contract.key))!.toString().length > 10; | ||
} | ||
|
||
// Create the contract code (24kb of zeros) | ||
const evmCode = `60006000fd${"0".repeat(24_000 * 2)}`; | ||
const storageData = `${context | ||
.polkadotJs() | ||
.registry.createType("Compact<u32>", `0x${BigInt((evmCode.length + 1) * 2).toString(16)}`) | ||
.toHex(true)}${evmCode}`; | ||
|
||
// Create the batchs of contracts to deploy | ||
const batchs = contracts | ||
.reduce( | ||
(acc, value) => { | ||
if (acc[acc.length - 1].length >= 30) acc.push([]); | ||
if (!value.deployed) acc[acc.length - 1].push([value.key, storageData]); | ||
return acc; | ||
}, | ||
[[]] as [string, string][][] | ||
) | ||
.filter((batch) => batch.length > 0); | ||
|
||
// Set the storage of the contracts | ||
let nonce = await context.viem().getTransactionCount({ address: ALITH_ADDRESS }); | ||
for (let i = 0; i < batchs.length; i++) { | ||
const batch = batchs[i]; | ||
await context.createBlock([ | ||
context | ||
.polkadotJs() | ||
.tx.sudo.sudo(context.polkadotJs().tx.system.setStorage(batch)) | ||
.signAsync(alith, { | ||
nonce: nonce++, | ||
}), | ||
]); | ||
} | ||
return contracts as HeavyContract[]; | ||
}; |
Oops, something went wrong.