Skip to content

Commit

Permalink
deterministic: ci test
Browse files Browse the repository at this point in the history
Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node committed Apr 23, 2024
1 parent 9c052da commit 991f111
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 43 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
uses: ./.github/workflows/acceptance-workflow.yml
with:
testfilter: api_batch1
networkTag: 0.49.0-alpha.3

# api_batch_2:
# name: API Batch 2
Expand Down Expand Up @@ -73,13 +72,12 @@ jobs:
# with:
# testfilter: precompile-calls

websocket:
name: Websocket
uses: ./.github/workflows/acceptance-workflow.yml
with:
testfilter: ws
test_ws_server: true
networkTag: 0.49.0-alpha.3
# websocket:
# name: Websocket
# uses: ./.github/workflows/acceptance-workflow.yml
# with:
# testfilter: ws
# test_ws_server: true

# cacheservice:
# name: Cache Service
Expand All @@ -101,7 +99,7 @@ jobs:
# - tokenmanagement
# - htsprecompilev1
# - precompilecalls
- websocket
# - websocket
# - cacheservice

runs-on: ubuntu-latest
Expand Down
71 changes: 37 additions & 34 deletions packages/server/tests/acceptance/rpc_batch1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,40 +853,43 @@ describe('@api-batch-1 RPC Server Acceptance Tests', function () {
// is not 0, it means the DETERMINISTIC_DEPLOYER_TRANSACTION has already been submitted, and the DETERMINISTIC_PROXY_CONTRACT
// has already been deployed to the network. Therefore, it only matters to test this flow once.
const signerNonce = await relay.getAccountNonce(constants.DETERMINISTIC_DEPLOYMENT_SIGNER, requestId);
if (signerNonce === 0) {
const deployerBalance = await relay.getBalance(
constants.DETERMINISTIC_DEPLOYMENT_SIGNER,
'latest',
requestId,
);
expect(deployerBalance).to.not.eq(0);

// send transaction to deploy proxy transaction
const deterministicDeployTransactionHash = await relay.sendRawTransaction(
constants.DETERMINISTIC_DEPLOYER_TRANSACTION,
requestId,
);
const receipt = await mirrorNode.get(`/contracts/results/${deterministicDeployTransactionHash}`, requestId);

const fromAccountInfo = await global.mirrorNode.get(`/accounts/${receipt.from}`);
const toAccountInfo = await global.mirrorNode.get(`/accounts/${receipt.to}`);

expect(receipt).to.exist;
expect(fromAccountInfo.evm_address).to.eq(constants.DETERMINISTIC_DEPLOYMENT_SIGNER);
expect(toAccountInfo.evm_address).to.eq(constants.DETERMINISTIC_PROXY_CONTRACT);
expect(receipt.address).to.eq(constants.DETERMINISTIC_PROXY_CONTRACT);
} else {
try {
await relay.sendRawTransaction(constants.DETERMINISTIC_DEPLOYER_TRANSACTION, requestId);
expect(true).to.be.false;
} catch (error) {
const expectedNonceTooLowError = predefined.NONCE_TOO_LOW(0, signerNonce);
const errObj = JSON.parse(error.info.responseBody).error;
expect(errObj.code).to.eq(expectedNonceTooLowError.code);
expect(errObj.name).to.eq(expectedNonceTooLowError.name);
expect(errObj.message).to.contain(expectedNonceTooLowError.message);
}
}
console.log(`signerNoncesignerNoncesignerNoncesignerNonce`);
console.log(signerNonce);

// if (signerNonce === 0) {
// const deployerBalance = await relay.getBalance(
// constants.DETERMINISTIC_DEPLOYMENT_SIGNER,
// 'latest',
// requestId,
// );
// expect(deployerBalance).to.not.eq(0);

// // send transaction to deploy proxy transaction
// const deterministicDeployTransactionHash = await relay.sendRawTransaction(
// constants.DETERMINISTIC_DEPLOYER_TRANSACTION,
// requestId,
// );
// const receipt = await mirrorNode.get(`/contracts/results/${deterministicDeployTransactionHash}`, requestId);

// const fromAccountInfo = await global.mirrorNode.get(`/accounts/${receipt.from}`);
// const toAccountInfo = await global.mirrorNode.get(`/accounts/${receipt.to}`);

// expect(receipt).to.exist;
// expect(fromAccountInfo.evm_address).to.eq(constants.DETERMINISTIC_DEPLOYMENT_SIGNER);
// expect(toAccountInfo.evm_address).to.eq(constants.DETERMINISTIC_PROXY_CONTRACT);
// expect(receipt.address).to.eq(constants.DETERMINISTIC_PROXY_CONTRACT);
// } else {
// try {
// await relay.sendRawTransaction(constants.DETERMINISTIC_DEPLOYER_TRANSACTION, requestId);
// expect(true).to.be.false;
// } catch (error) {
// const expectedNonceTooLowError = predefined.NONCE_TOO_LOW(0, signerNonce);
// const errObj = JSON.parse(error.info.responseBody).error;
// expect(errObj.code).to.eq(expectedNonceTooLowError.code);
// expect(errObj.name).to.eq(expectedNonceTooLowError.name);
// expect(errObj.message).to.contain(expectedNonceTooLowError.message);
// }
// }
});

it('@release should execute "eth_sendRawTransaction" for legacy EIP 155 transactions', async function () {
Expand Down

0 comments on commit 991f111

Please sign in to comment.