Skip to content

Commit

Permalink
Merge 0040ebf into f3ae6f3
Browse files Browse the repository at this point in the history
  • Loading branch information
keefertaylor committed Dec 10, 2020
2 parents f3ae6f3 + 0040ebf commit b13d997
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/chain/tezos/contracts/WrappedTezosHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export namespace WrappedTezosHelper {
}

/**
* Open a new oven.
* Deploy a new oven contract.
*
* The oven's owner is assigned to the sender's address.
*
Expand All @@ -370,22 +370,25 @@ export namespace WrappedTezosHelper {
* @param keystore A Keystore for the sourceAddress.
* @param fee The fee to use.
* @param coreAddress The address of the core contract.
* @param baker The inital baker for the Oven. If `undefined` the oven will not have an initial baker. Defaults to `undefined`.
* @param gasLimit The gas limit to use.
* @param storageLimit The storage limit to use.
* @returns A property bag of data about the operation.
*/
export async function openOven(
export async function deployOven(
nodeUrl: string,
signer: Signer,
keystore: KeyStore,
fee: number,
coreAddress: string,
baker: string | undefined = undefined,
gasLimit: number = 115_000,
storageLimit: number = 1100
): Promise<OpenOvenResult> {
const entryPoint = 'runEntrypointLambda'
const lambdaName = 'createOven'
const bytes = TezosMessageUtils.writePackedData(`Pair None "${keystore.publicKeyHash}"`, 'pair (option key_hash) address', TezosParameterFormat.Michelson)
const bakerParam = baker !== undefined ? `Some "${baker}"` : 'None'
const bytes = TezosMessageUtils.writePackedData(`Pair ${bakerParam} "${keystore.publicKeyHash}"`, 'pair (option key_hash) address', TezosParameterFormat.Michelson)
const parameters = `Pair "${lambdaName}" 0x${bytes}`

const nodeResult = await TezosNodeWriter.sendContractInvocationOperation(
Expand Down

0 comments on commit b13d997

Please sign in to comment.