From 2fe798a292e8eb7b027a030c4d482158b3e10d5b Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Thu, 9 Dec 2021 09:41:53 +0300 Subject: [PATCH] refactor(contract)!: remove contractDecodeCallDataByCodeAPI use sdk.compilerApi.decodeCalldataBytecode instead --- src/contract/compiler.js | 4 ---- src/contract/index.js | 12 ------------ test/integration/contract.js | 7 ------- 3 files changed, 23 deletions(-) diff --git a/src/contract/compiler.js b/src/contract/compiler.js index 8e1b6e0c9c..d4b01d4df7 100644 --- a/src/contract/compiler.js +++ b/src/contract/compiler.js @@ -132,10 +132,6 @@ export default AsyncInit.compose(ContractBase, { contractGetACI (code, options) { this._ensureCompilerReady() return this.compilerApi.generateACI({ code, options }) - }, - contractDecodeCallDataByCodeAPI (bytecode, calldata) { - this._ensureCompilerReady() - return this.compilerApi.decodeCalldataBytecode({ bytecode, calldata }) } }, props: { diff --git a/src/contract/index.js b/src/contract/index.js index 8358b23b12..0f0a4ec99f 100644 --- a/src/contract/index.js +++ b/src/contract/index.js @@ -75,18 +75,6 @@ const ContractBase = stampit(required({ * @return {String} - Contract encoded data */ -/** - * Decode call data by bytecode - * @function contractDecodeCallDataByCodeAPI - * @instance - * @abstract - * @category async - * @rtype (code: String, callData: String) => decodedResult: Promise[String] - * @param {String} code - contract byte code - * @param {String} callData - Encoded contract call data - * @return {String} - Decoded contract call data - */ - /** * Compile contract * @function compileContractAPI diff --git a/test/integration/contract.js b/test/integration/contract.js index e443c990e4..0d2c0a10ef 100644 --- a/test/integration/contract.js +++ b/test/integration/contract.js @@ -327,13 +327,6 @@ describe('Contract', function () { isString.should.be.equal(true) }) - it('Decode call-data using bytecode', async () => { - const decodedCallData = await sdk.contractDecodeCallDataByCodeAPI(bytecode, callData) - decodedCallData.arguments.should.be.an('array') - decodedCallData.arguments.length.should.be.equal(0) - decodedCallData.function.should.be.equal('init') - }) - it('validate bytecode', async () => { expect(await sdk.compilerApi.validateByteCode({ bytecode, source: identityContract })) .to.be.eql({})