Skip to content

add definition of capSetter method into policy abi #464

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

Merged
merged 1 commit into from
Jun 15, 2021
Merged

Conversation

hhatto
Copy link
Contributor

@hhatto hhatto commented Jun 10, 2021

Fixes dev-protocol/stakes.social#1334

Proposed Changes

  • add capSetter method definition in policy contarct abi, because not exists capSetter method definition
  • If the definition does not exist, the following error will occur
    TypeError: m is not a function

      75 | 	const a =
      76 | 		args !== undefined && padEnd !== undefined ? pad(args, padEnd) : args
    > 77 | 	const x = a ? m(...a) : m()
         | 	                        ^
      78 | 	return mutation === true
      79 | 		? txPromisify(x.send({ from: await getAccount(client as Web3) })).then(
      80 | 				(receipt) => receipt

      at lib/utils/execute.ts:77:26
      at lib/utils/execute.ts:8:71
      at Object.<anonymous>.__awaiter (lib/utils/execute.ts:4:12)
      at Object.execute (lib/utils/execute.ts:73:27)
      at Object.createCapSetterCaller (lib/policy/capSetter.ts:14:3)
      at lib/policy/capSetter.spec.ts:63:19
      at fulfilled (lib/policy/capSetter.spec.ts:5:58)

You can use this changeset to reproduction it.

$ WEB3_PROVIDER=YOUR_WEB3_PROVIDER yarn test

@hhatto hhatto requested review from aggre and Akira-Taniguchi June 10, 2021 10:56
@hhatto hhatto self-assigned this Jun 10, 2021
Copy link
Member

@aggre aggre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@aggre aggre merged commit bd86529 into main Jun 15, 2021
@aggre aggre deleted the fix-cap-setter branch June 15, 2021 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A console error occurs in the property list page
2 participants