From 2215b2203edc536865f19a2174d00852b728952f Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Fri, 23 Jun 2023 13:22:35 +0600 Subject: [PATCH] chore(compiler): update cli to the latest develop version --- test/integration/compiler.ts | 20 +++++++------------- test/integration/contracts/Increment.aes | 2 -- tooling/fetch-aesophia-cli.mjs | 4 ++-- 3 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 test/integration/contracts/Increment.aes diff --git a/test/integration/compiler.ts b/test/integration/compiler.ts index f809064618..782302682d 100644 --- a/test/integration/compiler.ts +++ b/test/integration/compiler.ts @@ -12,16 +12,11 @@ function testCompiler(compiler: CompilerBase): void { let inclSourceCode: string; let inclFileSystem: Record; const inclBytecode = 'cb_+QEGRgOg7BH1sCv+p2IrS0Pn3/i6AfE8lOGUuC71lLPn6mbUm9PAuNm4cv4AWolkAjcCBwcHFBQAAgD+RNZEHwA3ADcAGg6CPwEDP/5Nt4A5AjcCBwcHDAECDAEABAMRAFqJZP6SiyA2ADcBBwcMAwgMAQAEAxFNt4A5/pSgnxIANwF3BwwBAAQDEarAwob+qsDChgI3AXcHPgQAALhgLwYRAFqJZD0uU3VibGlicmFyeS5zdW0RRNZEHxFpbml0EU23gDkxLkxpYnJhcnkuc3VtEZKLIDYRdGVzdBGUoJ8SJWdldExlbmd0aBGqwMKGOS5TdHJpbmcubGVuZ3Rogi8AhTcuMS4wAGHgFTw='; - // TODO: use Includes.aes after fixing https://github.com/aeternity/aesophia_cli/issues/74 - const incSourceCodePath = './test/integration/contracts/Increment.aes'; - let incSourceCode: string; - const incBytecode = 'cb_+G1GA6Cln3BxyOo1iNITGseMS58ZfBbRNB0x8Ix7Bh54qZlSOcC4QKD+Er1R0wA3AQcHFDQAAgD+RNZEHwA3ADcAGg6CPwEDP5svAhESvVHTJWluY3JlbWVudBFE1kQfEWluaXSCLwCFNy4wLjEAfImpuQ=='; const testBytecode = 'cb_+GhGA6BgYgXqYB9ctBcQ8mJ0+we5OXhb9PpsSQWP2DhPx9obn8C4O57+RNZEHwA3ADcAGg6CPwEDP/6AeCCSADcBd3cBAQCYLwIRRNZEHxFpbml0EYB4IJIZZ2V0QXJngi8AhTcuMC4xAMXqWXc='; before(async () => { inclSourceCode = await readFile(inclSourceCodePath, 'utf8'); inclFileSystem = await getFileSystem(inclSourceCodePath); - incSourceCode = await readFile(incSourceCodePath, 'utf8'); }); it('returns version', async () => { @@ -60,20 +55,19 @@ function testCompiler(compiler: CompilerBase): void { }); it('validates bytecode by path', async () => { - expect(await compiler.validate(incBytecode, incSourceCodePath)) - .to.be.equal(true); - expect(await compiler.validate(testBytecode, incSourceCodePath)).to.be.equal(false); + expect(await compiler.validate(inclBytecode, inclSourceCodePath)).to.be.equal(true); + expect(await compiler.validate(testBytecode, inclSourceCodePath)).to.be.equal(false); const invalidBytecode = `${testBytecode}test` as Encoded.ContractBytearray; - expect(await compiler.validate(invalidBytecode, incSourceCodePath)) - .to.be.equal(false); + expect(await compiler.validate(invalidBytecode, inclSourceCodePath)).to.be.equal(false); }); it('validates bytecode by source code', async () => { - expect(await compiler.validateBySourceCode(incBytecode, incSourceCode)) + expect(await compiler.validateBySourceCode(inclBytecode, inclSourceCode, inclFileSystem)) .to.be.equal(true); - expect(await compiler.validateBySourceCode(testBytecode, incSourceCode)).to.be.equal(false); + expect(await compiler.validateBySourceCode(testBytecode, inclSourceCode, inclFileSystem)) + .to.be.equal(false); const invalidBytecode = `${testBytecode}test` as Encoded.ContractBytearray; - expect(await compiler.validateBySourceCode(invalidBytecode, incSourceCode)) + expect(await compiler.validateBySourceCode(invalidBytecode, inclSourceCode, inclFileSystem)) .to.be.equal(false); }); } diff --git a/test/integration/contracts/Increment.aes b/test/integration/contracts/Increment.aes deleted file mode 100644 index e1e2e1fe7a..0000000000 --- a/test/integration/contracts/Increment.aes +++ /dev/null @@ -1,2 +0,0 @@ -contract Increment = - entrypoint increment(x: int): int = x + 1 diff --git a/tooling/fetch-aesophia-cli.mjs b/tooling/fetch-aesophia-cli.mjs index b525fa1d29..7e3278a972 100644 --- a/tooling/fetch-aesophia-cli.mjs +++ b/tooling/fetch-aesophia-cli.mjs @@ -3,7 +3,7 @@ import { dirname } from 'path'; import { writeFileSync, readFileSync, mkdirSync } from 'fs'; const path = './bin/aesophia_cli'; -const hash = 'BqnxuwwjV5q+4nmnkB7Ksa6lR2wwFaCVT2Mq3Y5xJ6rgp5GiwQL3At0Sqi2Z573PXYw0JTXNsglA7R1SyuahVQ=='; +const hash = '4iI/WntmiSTHryFmiFHnhwCPPA6JXXvB/T3Y1qVddUdcVIHlofzAcbClmxuSXLXSfM5+1omPJ2Vm1E8KBgCiiA=='; function ensureBinaryCorrect() { const buffer = readFileSync(path); @@ -16,7 +16,7 @@ try { } catch { console.log('Fetching aesophia_cli'); const request = await fetch( - 'https://github.com/aeternity/aesophia_cli/releases/download/v7.1.0/aesophia_cli', + 'https://github.com/aeternity/aesophia_cli/raw/1737f8112093b4ae2ce9e826188ecb6c9bb9c20a/aesophia_cli', ); const body = Buffer.from(await request.arrayBuffer()); mkdirSync(dirname(path), { recursive: true });