daostack / infra

GNU General Public License v3.0
25 stars 22 forks source link

GenesisProtocol.organizations should be public #20

Closed dkent600 closed 6 years ago

dkent600 commented 6 years ago

GenesisProtocol.organizations should be public. We should be able to discover the creator of a proposal given the proposal's organizationId.

Suppose I have a proposalId. I can obtain the proposal struct which gives me the organizationId. But I still don't know what the creator (currently typically the avatar) is. Arc.js already has a function called getProposalCreator that calls getProposalOrganization which now returns an organizationId hash rather than the organization address. It needs to be able to return the address of the creator. Arc.js will now have a separate function called getProposalsOrganizationId that can return the organizationId.

orenyodfat commented 6 years ago

GenesisProtocol.organizations tells nothing about the creator of the proposal. Though you can have the organisation the proposal belong to via the events.

dkent600 commented 6 years ago

@orenyodfat

GenesisProtocol.organizations returns the avatar for proposals created by schemes. This is what we want. Is there any reason not to make this public?

orenyodfat commented 6 years ago

because it is not needed .

dkent600 commented 6 years ago

I think you are saying that applications can fetch an event on the proposal and obtain the avatar from the event arguments. It would seem a lot more performant for the application to make organizations public, and trivial to implement in infra. Is there a reason not to expose this bit of implementation?