Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed May 23, 2024
1 parent f182832 commit f7ba5f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
11 changes: 3 additions & 8 deletions test/contracts/src/dancun/ProxySuicide.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ contract ProxyDeployer {
event ContractDestroyed(address destroyedAddress);

// Function to deploy a new Suicide contract
function deployAndDestroy(address target, uint256 entries) public {
Suicide newContract = new Suicide(entries);
function deployAndDestroy(address target) public {
Suicide newContract = new Suicide();
newContract.destroy(target);
emit ContractDestroyed(address(newContract));
}

}

contract Suicide {
mapping(uint256 => uint256) public map;

constructor(uint256 entries) payable {
for(uint i = 0; i < entries; i++) {
map[i] = i;
}
constructor() payable {
}

function destroy(address target) public {
Expand Down
8 changes: 3 additions & 5 deletions test/suites/dev/moonbase/test-contract/test-eip-6780.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { beforeAll, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli";
import { beforeEach, describeSuite, expect, fetchCompiledContract } from "@moonwall/cli";
import { expectEVMResult, expectSubstrateEvent } from "../../../../helpers";
import { GLMR, BALTATHAR_ADDRESS } from "@moonwall/util";
import { decodeEventLog } from "viem";
Expand All @@ -10,10 +10,9 @@ describeSuite({
testCases: ({ context, it }) => {
let contract: `0x${string}`;

beforeAll(async function () {
beforeEach(async function () {
const { contractAddress } = await context.deployContract!("Suicide", {
gas: 45_000_000n,
args: [1000],
});
contract = contractAddress;
});
Expand Down Expand Up @@ -114,8 +113,7 @@ describeSuite({
contractAddress,
functionName: "deployAndDestroy",
rawTxOnly: true,
gas: "estimate",
args: [BALTATHAR_ADDRESS, 1000],
args: [BALTATHAR_ADDRESS],
})
);

Expand Down

0 comments on commit f7ba5f4

Please sign in to comment.