feat: move up caller to the view state method
This commit is contained in:
@@ -129,12 +129,14 @@ export interface Contract<State = unknown> {
|
||||
* @param input - the input to the contract - eg. function name and parameters
|
||||
* @param tags - a set of tags that can be added to the interaction transaction
|
||||
* @param transfer - additional {@link ArTransfer} data that can be attached to the interaction
|
||||
* @param caller - caller of the view state operation
|
||||
* transaction
|
||||
*/
|
||||
viewState<Input = unknown, View = unknown>(
|
||||
input: Input,
|
||||
tags?: Tags,
|
||||
transfer?: ArTransfer
|
||||
transfer?: ArTransfer,
|
||||
caller?: string
|
||||
): Promise<InteractionResult<State, View>>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -209,10 +209,11 @@ export class HandlerBasedContract<State> implements Contract<State> {
|
||||
async viewState<Input, View>(
|
||||
input: Input,
|
||||
tags: Tags = [],
|
||||
transfer: ArTransfer = emptyTransfer
|
||||
transfer: ArTransfer = emptyTransfer,
|
||||
caller?: string
|
||||
): Promise<InteractionResult<State, View>> {
|
||||
this.logger.info('View state for', this._contractTxId);
|
||||
return await this.callContract<Input, View>(input, 'view', undefined, undefined, tags, transfer);
|
||||
return await this.callContract<Input, View>(input, 'view', caller, undefined, tags, transfer);
|
||||
}
|
||||
|
||||
async viewStateForTx<Input, View>(
|
||||
|
||||
Reference in New Issue
Block a user