-
Notifications
You must be signed in to change notification settings - Fork 702
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
Remove Static Fee Config #3610
base: master
Are you sure you want to change the base?
Remove Static Fee Config #3610
Conversation
52c104b
to
41aaaaa
Compare
@@ -477,81 +442,6 @@ func TestExportTx(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestTransformSubnetTx(t *testing.T) { |
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.
If we are removing this test - should we also be removing NewTransformSubnetTx
entirely? It feels odd to keep that function around but not to have any tests for it
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 agree, could this be done in a follow up? there seems to be a lot of references to TransformSubnetTx
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.
Yeah that's a reasonable followup
{ | ||
name: "valid tx", | ||
newExecutor: func(ctrl *gomock.Controller) (*txs.RemoveSubnetValidatorTx, *standardTxExecutor) { | ||
env := newValidRemoveSubnetValidatorTxVerifyEnv(t, ctrl) | ||
|
||
// Set dependency expectations. | ||
env.state.EXPECT().GetTimestamp().Return(env.latestForkTime).AnyTimes() | ||
env.state.EXPECT().GetCurrentValidator(env.unsignedTx.Subnet, env.unsignedTx.NodeID).Return(env.staker, nil).Times(1) | ||
subnetOwner := fxmock.NewOwner(ctrl) | ||
env.state.EXPECT().GetSubnetOwner(env.unsignedTx.Subnet).Return(subnetOwner, nil).Times(1) | ||
env.fx.EXPECT().VerifyPermission(env.unsignedTx, env.unsignedTx.SubnetAuth, env.tx.Creds[len(env.tx.Creds)-1], subnetOwner).Return(nil).Times(1) | ||
env.flowChecker.EXPECT().VerifySpend( | ||
env.unsignedTx, env.state, env.unsignedTx.Ins, env.unsignedTx.Outs, env.tx.Creds[:len(env.tx.Creds)-1], gomock.Any(), | ||
).Return(nil).Times(1) | ||
env.state.EXPECT().DeleteCurrentValidator(env.staker) | ||
env.state.EXPECT().DeleteUTXO(gomock.Any()).Times(len(env.unsignedTx.Ins)) | ||
env.state.EXPECT().AddUTXO(gomock.Any()).Times(len(env.unsignedTx.Outs)) | ||
|
||
// This isn't actually called, but is added here as a regression | ||
// test to ensure that converted subnets can still remove | ||
// permissioned validators. | ||
env.state.EXPECT().GetSubnetToL1Conversion(env.unsignedTx.Subnet).Return( | ||
state.SubnetToL1Conversion{ | ||
ConversionID: ids.GenerateTestID(), | ||
ChainID: ids.GenerateTestID(), | ||
Addr: []byte("address"), | ||
}, | ||
nil, | ||
).AnyTimes() | ||
|
||
cfg := &config.Internal{ | ||
UpgradeConfig: upgradetest.GetConfigWithUpgradeTime(upgradetest.Etna, env.latestForkTime), | ||
} | ||
feeCalculator := state.NewStaticFeeCalculator(cfg, env.state.GetTimestamp()) | ||
e := &standardTxExecutor{ | ||
backend: &Backend{ | ||
Config: cfg, | ||
Bootstrapped: utils.NewAtomic(true), | ||
Fx: env.fx, | ||
FlowChecker: env.flowChecker, | ||
Ctx: &snow.Context{}, | ||
}, | ||
feeCalculator: feeCalculator, | ||
tx: env.tx, | ||
state: env.state, | ||
} | ||
return env.unsignedTx, e | ||
}, | ||
expectedErr: nil, | ||
}, |
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.
Shouldn't this still be able to be tested? (valid transactions)
Why this should be merged
After the Etna update there is no longer use for the
staticFeeConfig
as well as the static fee calculator. This PR removes these structs as well as cleans up the surrounding tests and configs.How this works
How this was tested
CI/CD
Need to be documented in RELEASES.md?
Yes