-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: upgrade multibuild #113
base: main
Are you sure you want to change the base?
Changes from 14 commits
f6c660c
2f30f9e
8e41658
12ce8ba
74daaf9
886204c
81ab978
5207328
aea173f
94c42cf
bfe7cf0
4efa72e
9482c5b
1e59e84
42b62c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//go:build mainnet | ||
|
||
package app | ||
|
||
import ( | ||
"github.com/babylonlabs-io/babylon/app/upgrades" | ||
v1 "github.com/babylonlabs-io/babylon/app/upgrades/v1" | ||
"github.com/babylonlabs-io/babylon/app/upgrades/v1/mainnet" | ||
) | ||
|
||
// init is used to include v1 upgrade for mainnet data | ||
func init() { | ||
Upgrades = []upgrades.Upgrade{v1.CreateUpgrade(v1.UpgradeDataString{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only place beside tests that imports mainnet and is included only if there is a
|
||
BtcStakingParamStr: mainnet.BtcStakingParamStr, | ||
FinalityParamStr: mainnet.FinalityParamStr, | ||
NewBtcHeadersStr: mainnet.NewBtcHeadersStr, | ||
SignedFPsStr: mainnet.SignedFPsStr, | ||
TokensDistributionStr: mainnet.TokensDistributionStr, | ||
})} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build testnet | ||
|
||
package app | ||
|
||
import ( | ||
"github.com/babylonlabs-io/babylon/app/upgrades" | ||
v1 "github.com/babylonlabs-io/babylon/app/upgrades/v1" | ||
"github.com/babylonlabs-io/babylon/app/upgrades/v1/testnet" | ||
) | ||
|
||
// init is used to include v1 upgrade testnet data | ||
// it is also used for e2e testing | ||
func init() { | ||
Upgrades = []upgrades.Upgrade{v1.CreateUpgrade(v1.UpgradeDataString{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only place beside tests that imports testnet and is included only if there is a |
||
BtcStakingParamStr: testnet.BtcStakingParamStr, | ||
FinalityParamStr: testnet.FinalityParamStr, | ||
NewBtcHeadersStr: testnet.NewBtcHeadersStr, | ||
SignedFPsStr: testnet.SignedFPsStr, | ||
TokensDistributionStr: testnet.TokensDistributionStr, | ||
})} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package v1_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/babylonlabs-io/babylon/app" | ||
v1 "github.com/babylonlabs-io/babylon/app/upgrades/v1" | ||
) | ||
|
||
func TestHardCodedBtcStakingParamsAreValid(t *testing.T) { | ||
bbnApp := app.NewTmpBabylonApp() | ||
for _, upgradeData := range UpgradeV1Data { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. each unit test now check both testnet and mainnet data files |
||
loadedParamas, err := v1.LoadBtcStakingParamsFromData(bbnApp.AppCodec(), upgradeData.BtcStakingParamStr) | ||
require.NoError(t, err) | ||
require.NoError(t, loadedParamas.Validate()) | ||
} | ||
} | ||
|
||
func TestHardCodedFinalityParamsAreValid(t *testing.T) { | ||
bbnApp := app.NewTmpBabylonApp() | ||
for _, upgradeData := range UpgradeV1Data { | ||
loadedParamas, err := v1.LoadFinalityParamsFromData(bbnApp.AppCodec(), upgradeData.FinalityParamStr) | ||
require.NoError(t, err) | ||
require.NoError(t, loadedParamas.Validate()) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember Go allows to build with multiple tags e.g.,
-tags "mainnet,testnet"
. Wondering what will happen in this case 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question, in both cases I am replacing the upgrades var from app.go with a new upgrade
So, the question is which one ? 😅
One other point is that in the makefile or it includes mainnet or testnet to the build tags
babylon/Makefile
Lines 82 to 87 in aea173f