wormhole/sdk/vaa/quorum.go

10 lines
405 B
Go
Raw Normal View History

2022-10-21 10:32:24 -07:00
package vaa
// CalculateQuorum returns the minimum number of guardians that need to sign a VAA for a given guardian set.
//
// The canonical source is the calculation in the contracts (solana/bridge/src/processor.rs and
// ethereum/contracts/Wormhole.sol), and this needs to match the implementation in the contracts.
func CalculateQuorum(numGuardians int) int {
return ((numGuardians*10/3)*2)/10 + 1
}