From 4d4704ac6f0045b0b52f0a5dc7689dc50bf8e127 Mon Sep 17 00:00:00 2001 From: "Iulian Rotaru (mortimr)" Date: Tue, 19 Mar 2019 11:58:01 -0400 Subject: [PATCH] feat(@embark/embarkjs): add bytecode to contract Contract artifacts built by `new.EmbarkJS.Blockchain.Contract(config)` now save the bytecode and runtime bytecode from the config in the instance --- packages/embarkjs/src/blockchain.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/embarkjs/src/blockchain.js b/packages/embarkjs/src/blockchain.js index 5f8ca5ea8..4475181f4 100644 --- a/packages/embarkjs/src/blockchain.js +++ b/packages/embarkjs/src/blockchain.js @@ -253,6 +253,9 @@ let Contract = function(options) { ContractClass.abi = ContractClass.options.abi; ContractClass.address = this.address; ContractClass.gas = this.gas; + ContractClass.bytecode = '0x' + options.code; + ContractClass.runtime_bytecode = '0x' + options.runtime_bytecode; + ContractClass.real_runtime_bytecode = '0x' + options.real_runtime_bytecode; let originalMethods = Object.keys(ContractClass);