Skip to content

Commit

Permalink
refactor(contract)!: remove contractDecodeCallDataByCodeAPI
Browse files Browse the repository at this point in the history
use sdk.compilerApi.decodeCalldataBytecode instead
  • Loading branch information
davidyuk committed Jan 24, 2022
1 parent 8b13f70 commit 2fe798a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
4 changes: 0 additions & 4 deletions src/contract/compiler.js
Expand Up @@ -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: {
Expand Down
12 changes: 0 additions & 12 deletions src/contract/index.js
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions test/integration/contract.js
Expand Up @@ -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({})
Expand Down

0 comments on commit 2fe798a

Please sign in to comment.