Skip to content

Commit

Permalink
implementation of complicatedDeploy function (with constructor params…
Browse files Browse the repository at this point in the history
…, constructor headers and init params)
  • Loading branch information
rightjelkin committed Feb 15, 2021
1 parent 320f246 commit 251e39e
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 16 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,30 @@ await manager.contracts['9_PiggyBank'].deployContract({
});
```
### Deploy with custom headers
### "Complicated" deploy
This method allows you to provide: constructor parameters, constructor headers and init parameters of your deployable smart contract
```js
await manager.contracts['someName'].complicatedDeploy(
constructorParams,
constructorHeader,
initParams,
)
```
```js
await manager.contracts['9_PiggyBank'].deployContractWithCustomHeaders(
await manager.contracts['9_PiggyBank'].complicatedDeploy(
{
own: manager.contracts['9_PiggyBank_Owner'].address,
lim: 1000000,
},
{
pubkey: keypair.public,
expire: new Date()
},
{
randomNonce: '0x' + crypto.createHash('sha256').update(crypto.randomBytes(32)).digest('hex')
}
);

Expand Down
2 changes: 1 addition & 1 deletion build/BaseContractObject/BaseContractObject.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export declare abstract class BaseContract {
protected keys: any;
constructor(contractPath: string, abiPath: string, client: any, keys: any, noPath?: boolean);
deployContract(constructorParams?: {}, giveGram?: boolean, keys?: any): Promise<void>;
deployContractWithCustomHeaders(constructorParams?: {}, constructorHeader?: {}, giveGram?: boolean, keys?: any): Promise<void>;
complicatedDeploy(constructorParams?: {}, constructorHeader?: {}, initParams?: {}, giveGram?: boolean, keys?: any): Promise<void>;
runWithMessage(functionName: any, input: any, keyPair?: any): Promise<any>;
runLocal(functionName: any, input: any, keyPair?: any): Promise<any>;
futureAddress(): Promise<any>;
Expand Down
9 changes: 4 additions & 5 deletions build/BaseContractObject/BaseContractObject.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/Contract/Wallet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/Deploy/Deploy.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare const deploy: (client: any, contractPackage: any, keys: any, constructorParams: any, constructorHeader: any, giveGram?: boolean) => Promise<any>;
export declare const deploy: (client: any, contractPackage: any, keys: any, constructorParams: any, constructorHeader: any, initParams: any, giveGram?: boolean) => Promise<any>;
export declare const giveGrams: (client: any, address: any, amount?: any) => Promise<void>;
Loading

0 comments on commit 251e39e

Please sign in to comment.