Skip to content

passedByVoting function in channel-ops chaincode decide whether votes meet the policy with hard-coded MAJORITY? #131

@Snowball84

Description

@Snowball84
func (s *SmartContract) passedByVoting(ctx contractapi.TransactionContextInterface, proposal *Proposal) (bool, error) {
	channelID := proposal.ChannelID
	var err error
	// Use organizations in the system channel when creating a channel
	if proposal.Action == CreationAction {
		channelID, err = s.GetSystemChannelID(ctx)
		if err != nil {
			return false, fmt.Errorf("error happend getting the system channel ID: %v", err)
		}
	}
	satisfied, err := s.meetCriteria(ctx, proposal.Artifacts.Signatures, MAJORITY, channelID) // why not choose the actual /Channel/Application/Admins policy of the channel
	if err != nil {
		return false, fmt.Errorf("error happened checking to meet criteria: %v", err)
	}
	return satisfied, nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions