-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace snowball/snowflake interface with single shared snow interface (
#2717) Signed-off-by: aaronbuchwald <aaron.buchwald56@gmail.com> Signed-off-by: Stephen Buttolph <stephen@avalabs.org> Co-authored-by: Stephen Buttolph <stephen@avalabs.org>
- Loading branch information
1 parent
f1f88ac
commit adc1d4b
Showing
19 changed files
with
161 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package snowball | ||
|
||
import "github.com/ava-labs/avalanchego/ids" | ||
|
||
var ( | ||
SnowballFactory Factory = snowballFactory{} | ||
SnowflakeFactory Factory = snowflakeFactory{} | ||
) | ||
|
||
type snowballFactory struct{} | ||
|
||
func (snowballFactory) NewNnary(params Parameters, choice ids.ID) Nnary { | ||
sb := newNnarySnowball(params.BetaVirtuous, params.BetaRogue, choice) | ||
return &sb | ||
} | ||
|
||
func (snowballFactory) NewUnary(params Parameters) Unary { | ||
sb := newUnarySnowball(params.BetaVirtuous) | ||
return &sb | ||
} | ||
|
||
type snowflakeFactory struct{} | ||
|
||
func (snowflakeFactory) NewNnary(params Parameters, choice ids.ID) Nnary { | ||
sf := newNnarySnowflake(params.BetaVirtuous, params.BetaRogue, choice) | ||
return &sf | ||
} | ||
|
||
func (snowflakeFactory) NewUnary(params Parameters) Unary { | ||
sf := newUnarySnowflake(params.BetaVirtuous) | ||
return &sf | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.