This commit is contained in:
Cale Teeter 2020-06-30 09:42:53 -04:00
Родитель 618e9bfbe3
Коммит 4a8f711cd1
7 изменённых файлов: 582 добавлений и 59 удалений

Просмотреть файл

@ -2,6 +2,16 @@
All notable changes to the "azure blockchain" extension will be documented in this file.
## 1.5.0
### Enhancements
### Fixes
- Fixed bug as a result of gas configuration changes to Azure Blockchain Service ([#54](https://github.com/microsoft/vscode-azure-blockchain-ethereum/issues/54) by [@rpajunen](https://github.com/rpajunen) and [@davew-msft](https://github.com/davew-msft) adn [@richross](https://github.com/richross))
### Internal Improvements
## 1.4.0
### Enhancements

Просмотреть файл

@ -5,7 +5,7 @@
"publisher": "AzBlockchain",
"preview": false,
"icon": "images/blockchain-service-logo.png",
"version": "1.4.0",
"version": "1.5.0",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-azure-blockchain-ethereum"

Просмотреть файл

@ -11,7 +11,7 @@ const protocolRegExp = new RegExp('^(' +
Constants.networkProtocols.http + '|' +
Constants.networkProtocols.https + '|' +
Constants.networkProtocols.ftp + '|' +
Constants.networkProtocols.file +
Constants.networkProtocols.file +
').*', 'i');
export type NetworkNodeTypes =
@ -62,7 +62,6 @@ export abstract class NetworkNode extends ExtensionItem {
return {
name: this.label,
options: {
gas: await this.getGasLimit(),
gasPrice: await this.getGasPrice(),
network_id: this.networkId,
},

Просмотреть файл

@ -45,10 +45,6 @@ export namespace TruffleConfiguration {
* or to hear Events using .on or .once. Default is false.
*/
websockets?: boolean;
/**
* Gas limit used for deploys. Default is 4712388.
*/
gas?: number;
/**
* Gas price used for deploys. Default is 100000000000 (100 Shannon).
*/
@ -372,11 +368,6 @@ export namespace TruffleConfiguration {
options.websockets = websockets.value.value;
}
const gas = findProperty(node, 'gas');
if (gas && gas.value.type === 'Literal' && typeof gas.value.value === 'number') {
options.gas = gas.value.value;
}
const gasPrice = findProperty(node, 'gasPrice');
if (gasPrice && gasPrice.value.type === 'Literal' && typeof gasPrice.value.value === 'number') {
options.gasPrice = gasPrice.value.value;
@ -435,10 +426,6 @@ export namespace TruffleConfiguration {
obj.properties.push(generateProperty('websockets', generateLiteral(options.websockets)));
}
if (options.gas !== undefined) {
obj.properties.push(generateProperty('gas', generateLiteral(options.gas)));
}
if (options.gasPrice !== undefined) {
obj.properties.push(generateProperty('gasPrice', generateLiteral(options.gasPrice)));
}
@ -506,7 +493,7 @@ export namespace TruffleConfiguration {
};
}
function jsonToConfiguration(truffleConfig: {[key: string]: any}): IConfiguration {
function jsonToConfiguration(truffleConfig: { [key: string]: any }): IConfiguration {
const { contracts_directory, contracts_build_directory, migrations_directory }
= Constants.truffleConfigDefaultDirectory;

Просмотреть файл

@ -128,7 +128,7 @@ describe('TruffleCommands', () => {
mnemonicRepositoryMock = sinon.mock(MnemonicRepository);
getMnemonicMock = mnemonicRepositoryMock.expects('getMnemonic').returns(TestConstants.testMnemonic);
getAllMnemonicPathsMock = mnemonicRepositoryMock.expects('getAllMnemonicPaths').returns([] as string []);
getAllMnemonicPathsMock = mnemonicRepositoryMock.expects('getAllMnemonicPaths').returns([] as string[]);
saveMnemonicPathMock = mnemonicRepositoryMock.expects('saveMnemonicPath');
writeFileSyncMock = sinon.stub(fs, 'writeFileSync');
@ -613,7 +613,7 @@ describe('TruffleCommands', () => {
it('should pass when openZeppelin contracts are valid', async () => {
// Arrange
projectJsonExistsStub.returns(true);
openZeppelinvalidateContractsAsyncMock.resolves([ new OZContractValidated('1', true, true) ]);
openZeppelinvalidateContractsAsyncMock.resolves([new OZContractValidated('1', true, true)]);
// Act
await TruffleCommands.deployContracts();
@ -625,7 +625,7 @@ describe('TruffleCommands', () => {
it('should throw error when downloaded openZeppelin contract has invalid hash', async () => {
// Arrange
projectJsonExistsStub.returns(true);
openZeppelinvalidateContractsAsyncMock.resolves([ new OZContractValidated('1', true, false) ]);
openZeppelinvalidateContractsAsyncMock.resolves([new OZContractValidated('1', true, false)]);
// Act and Assert
await assert.rejects(TruffleCommands.deployContracts(), Error);
@ -634,7 +634,7 @@ describe('TruffleCommands', () => {
it('should throw error when downloaded openZeppelin contract doesn\'t exist on the disk', async () => {
// Arrange
projectJsonExistsStub.returns(true);
openZeppelinvalidateContractsAsyncMock.resolves([ new OZContractValidated('1', false) ]);
openZeppelinvalidateContractsAsyncMock.resolves([new OZContractValidated('1', false)]);
// Act and Assert
await assert.rejects(TruffleCommands.deployContracts(), Error);
@ -725,14 +725,13 @@ function getTestTruffleNetworks(): TruffleConfiguration.INetwork[] {
port: 8545,
},
},
{
name: TestConstants.servicesNames.testNetwork,
options: {
gas: 4712388,
gasPrice: 100000000000,
network_id: 2,
},
});
{
name: TestConstants.servicesNames.testNetwork,
options: {
gasPrice: 100000000000,
network_id: 2,
},
});
return networks;
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -7,33 +7,32 @@ import * as path from 'path';
export const referenceMnemonic = 'some menmonic some menmonic some menmonic some menmonic some menmonic some menmonic';
export const referenceCfgContent = 'const HDWalletProvider = require("truffle-hdwallet-provider");'
+ 'module.exports = {'
+ ' networks: {'
+ ' development: {'
+ ' host: "127.0.0.1",'
+ ' port: 8545,'
+ ' network_id: "*"'
+ ' },'
+ ' "localhost:123": {'
+ ' from: "string",'
+ ' gas: 2,'
+ ' gasPrice: 3,'
+ ' host: "127.0.0.1",'
+ ' network_id: "*",'
+ ' port: 123,'
+ ' provider: new HDWalletProvider('
+ ' fs.readFileSync("path", "encoding"),'
+ ' "url"),'
+ ' skipDryRun: true,'
+ ' timeoutBlocks: 4,'
+ ' websockets: false,'
+ ' }'
+ ' },'
+ ' mocha: {},'
+ ' compilers: {'
+ ' solc: {}'
+ ' }'
+ '};';
+ 'module.exports = {'
+ ' networks: {'
+ ' development: {'
+ ' host: "127.0.0.1",'
+ ' port: 8545,'
+ ' network_id: "*"'
+ ' },'
+ ' "localhost:123": {'
+ ' from: "string",'
+ ' gasPrice: 3,'
+ ' host: "127.0.0.1",'
+ ' network_id: "*",'
+ ' port: 123,'
+ ' provider: new HDWalletProvider('
+ ' fs.readFileSync("path", "encoding"),'
+ ' "url"),'
+ ' skipDryRun: true,'
+ ' timeoutBlocks: 4,'
+ ' websockets: false,'
+ ' }'
+ ' },'
+ ' mocha: {},'
+ ' compilers: {'
+ ' solc: {}'
+ ' }'
+ '};';
export const referenceConfiguration = {
contracts_build_directory: 'build\\contracts',
@ -52,7 +51,6 @@ export const referenceConfiguration = {
name: 'localhost:123',
options: {
from: 'string',
gas: 2,
gasPrice: 3,
host: '127.0.0.1',
network_id: '*',
@ -82,7 +80,8 @@ export const testModuleWithoutDirectories = {
host: '127.0.0.1',
network_id: '*',
port: 8545,
}},
}
},
};
const referenceAstPath = path.join(__dirname, 'referenceAstObject.json');