test: add replica test case of processing message sent to a non-existent contract address (#491)

* test: add replica test case of processing message sent to a non-existent contract address

* bug: remove duplicate process

* fix: correct text
buddies-main-deployment
Tong Wang 3 years ago committed by GitHub
parent 679ed0b158
commit ecc336fcbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      typescript/optics-tests/test/replica.test.ts

@ -397,6 +397,24 @@ describe('Replica', async () => {
); );
}); });
it('Processes message sent to a non-existent contract address', async () => {
const sequence = await replica.nextToProcess();
const body = ethers.utils.formatBytes32String('message');
const opticsMessage = optics.formatMessage(
remoteDomain,
opticsMessageSender.address,
sequence,
localDomain,
'0x1234567890123456789012345678901234567890', // non-existent contract address
body,
);
// Set message status to MessageStatus.Pending
await replica.setMessagePending(opticsMessage);
await expect(replica.process(opticsMessage)).to.not.be.reverted;
});
it('Fails to process an undergased transaction', async () => { it('Fails to process an undergased transaction', async () => {
const [sender, recipient] = await ethers.getSigners(); const [sender, recipient] = await ethers.getSigners();
const sequence = await replica.nextToProcess(); const sequence = await replica.nextToProcess();

Loading…
Cancel
Save