Skip to content

Commit

Permalink
Merge branch 'broxus:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyFromAlfeya authored Apr 28, 2023
2 parents cdc8e73 + caf539d commit d6d1579
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 174 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,3 +921,9 @@ import { toNano, fromNano, getRandomNonce, convertAmount, isValidEverAddress, st
toNano(10); // 10000000000
fromNano(10000000000); // 10```
````

## Plugins

1. [locklift-verify](https://github.com/broxus/locklift-verifier)
2. [locklift-deploy](https://github.com/broxus/locklift-deploy)
3. [locklift-plugin-boilerplate(example of implementation)](https://github.com/broxus/locklift-plugin-boilerplate)
370 changes: 206 additions & 164 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locklift",
"version": "2.5.0",
"version": "2.5.2",
"description": "Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
1 change: 1 addition & 0 deletions sample-project-typescript/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tsol linguist-language=Solidity
4 changes: 4 additions & 0 deletions sample-project-typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
node_modules
.temp
.vscode
28 changes: 28 additions & 0 deletions sample-project-typescript/locklift.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ declare global {
const LOCAL_NETWORK_ENDPOINT = process.env.NETWORK_ENDPOINT || "http://localhost/graphql";
const DEV_NET_NETWORK_ENDPOINT = process.env.DEV_NET_NETWORK_ENDPOINT || "https://devnet-sandbox.evercloud.dev/graphql";

const VENOM_TESTNET_ENDPOINT = process.env.VENOM_TESTNET_ENDPOINT || "https://jrpc-testnet.venom.foundation/rpc";
const VENOM_TESTNET_TRACE_ENDPOINT =
process.env.VENOM_TESTNET_TRACE_ENDPOINT || "https://gql-testnet.venom.foundation/graphql";

// Create your own link on https://dashboard.evercloud.dev/
const MAIN_NET_NETWORK_ENDPOINT = process.env.MAIN_NET_NETWORK_ENDPOINT || "https://mainnet.evercloud.dev/XXX/graphql";

Expand Down Expand Up @@ -87,6 +91,30 @@ const config: LockliftConfig = {
amount: 20,
},
},
venom_testnet: {
connection: {
id: 1000,
type: "jrpc",
group: "dev",
data: {
endpoint: VENOM_TESTNET_ENDPOINT,
},
},
giver: {
address: "0:0000000000000000000000000000000000000000000000000000000000000000",
phrase: "phrase",
accountId: 0,
},
tracing: {
endpoint: VENOM_TESTNET_TRACE_ENDPOINT,
},
keys: {
// Use everdev to generate your phrase
// !!! Never commit it in your repos !!!
// phrase: "action inject penalty envelope rabbit element slim tornado dinner pizza off blood",
amount: 20,
},
},
main: {
// Specify connection settings for https://github.com/broxus/everscale-standalone-client/
connection: {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export { toNano, fromNano, getRandomNonce, convertAmount } from "./utils";
export { WalletTypes } from "./types";
export { TraceType, InteractionType } from "./internal/tracing/types";
export { lockliftChai } from "./chaiPlugin";
export { NetworkValue, ConfigState } from "./internal/config";

export class Locklift<FactorySource extends FactoryType> {
public readonly utils = utils;
Expand Down
14 changes: 8 additions & 6 deletions src/internal/cli/builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export class Builder {
contractFileName: parse(contractFileName).name,
path,
})),
catchError(e => {
logger.printError(
`path: ${path}, contractFile: ${contractFileName} error: ${e?.stderr?.toString() || e}`,
);
return throwError(undefined);
}),
);
}),
//Warnings
Expand All @@ -79,11 +85,7 @@ export class Builder {
isValidCompilerOutputLog(output.output.stderr.toString()) &&
logger.printBuilderLog(output.output.stderr.toString()),
),
//Errors
catchError(e => {
logger.printError(e?.stderr?.toString() || e);
return throwError(undefined);
}),

filter(({ output }) => {
//Only contracts
return !!output?.stdout.toString();
Expand All @@ -106,7 +108,7 @@ export class Builder {
return tvmLinkerLog.stdout.toString().match(new RegExp("Saved to file (.*)."));
}),
catchError(e => {
logger.printError(e?.stderr?.toString());
logger.printError(`contractFileName: ${contractFileName} error:${e?.stderr?.toString()}`);
return throwError(undefined);
}),
map(matchResult => {
Expand Down
6 changes: 3 additions & 3 deletions src/internal/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export type KeysConfig = {
};

export type Networks<T extends ConfigState = ConfigState.EXTERNAL> = Record<"local" | string, NetworkValue<T>>;
export type NetworkValue<T extends ConfigState = ConfigState.EXTERNAL> = {
export interface NetworkValue<T extends ConfigState = ConfigState.EXTERNAL> {
giver: GiverConfig;
keys: T extends ConfigState.EXTERNAL ? KeysConfig : Required<KeysConfig>;
connection: ConnectionProperties;
tracing?: {
endpoint: string;
};
};
}

export type ExternalCotracts = Record<string, Array<string>>;
export type GiverConfig = {
Expand Down Expand Up @@ -122,7 +122,7 @@ export const JoiConfig = Joi.object<LockliftConfig>({
tracing: Joi.object({
endpoint: Joi.string(),
}).optional(),
}),
}).unknown(),
),
mocha: Joi.object({
tsconfig: Joi.string().optional(),
Expand Down

0 comments on commit d6d1579

Please sign in to comment.