Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add executeCalls #566

Merged
merged 2 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 61 additions & 61 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daostack/arc.js",
"version": "0.2.77",
"version": "0.2.78",
"description": "",
"keywords": [],
"main": "dist/lib/index.js",
Expand Down
16 changes: 16 additions & 0 deletions src/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,22 @@ export class Proposal implements IStateful<IProposalState> {
return toIOperationObservable(observable)
}

/**
* [executeCalls description] execute the actual proposals call of a GenericScheme or
* GenericSchemeMultiCall
* @return an Operation
*/
public executeCalls(): Operation<boolean> {
const observable = this.state().pipe(
first(),
concatMap((state) => {
const transaction = (this.context.getContract(state.scheme.address)).methods.execute(this.id)
return this.context.sendTransaction(transaction, () => true)
})
)
return toIOperationObservable(observable)
}

/**
* calll the 'execute()' function on the votingMachine.
* the main purpose of this function is to set the stage of the proposals
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const REDEEMER_CONTRACT_VERSIONS = [
export const REPUTATION_CONTRACT_VERSION = '0.0.1-rc.19'
export const DAOTOKEN_CONTRACT_VERSION = '0.0.1-rc.19'
// used for a workaround
export const CONTRIBUTION_REWARD_DUMMY_VERSION = '0.0.1-rc.19'
export const CONTRIBUTION_REWARD_DUMMY_VERSION = '0.0.1-rc.44'

// export const ABI_DIR = path.resolve('./node_modules/@daostack/migration/contracts-optimized')
export const ABI_DIR = './abis'