Bump dev (w/ eslint 8) (#4070)

* Bump dev (w/ eslint 8)

* Additional linting

* Additional

* More lint fixes

* Last batch

* Additional

* Cleanups
This commit is contained in:
Jaco
2021-10-17 14:49:26 +03:00
committed by GitHub
parent 806fda67e9
commit 5eb3534d8e
46 changed files with 328 additions and 307 deletions
+1 -1
View File
@@ -66,5 +66,5 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
))
);
}
};
}
+5 -3
View File
@@ -1,6 +1,8 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyJson } from '@polkadot/types/types';
import fs from 'fs';
import path from 'path';
@@ -17,19 +19,19 @@ const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {
expect(
() => new Code(mockApi, v0abiFlipper, v0wasmFlipper, decorateMethodPromise)
() => new Code(mockApi, v0abiFlipper as AnyJson, v0wasmFlipper, decorateMethodPromise)
).not.toThrow();
});
it('can construct with an .contract ABI (v0)', (): void => {
expect(
() => new Code(mockApi, v0contractFlipper, null, decorateMethodPromise)
() => new Code(mockApi, v0contractFlipper as AnyJson, null, decorateMethodPromise)
).not.toThrow();
});
it.only('can construct with an .contract ABI (v1)', (): void => {
expect(
() => new Code(mockApi, v1contractFlipper, null, decorateMethodPromise)
() => new Code(mockApi, v1contractFlipper as AnyJson, null, decorateMethodPromise)
).not.toThrow();
});
});
+1 -1
View File
@@ -76,5 +76,5 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
[])
) || []))
);
}
};
}
+3 -3
View File
@@ -100,7 +100,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
: this.api.consts.system.maximumBlockWeight as Weight
).muln(64).div(BN_HUNDRED)
: gasLimit;
}
};
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
return this.api.tx.contracts
@@ -126,7 +126,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
.filter((decoded): decoded is DecodedEvent => !!decoded)
))
);
}
};
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
@@ -159,5 +159,5 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
)
)
};
}
};
}