Skip to content

Commit

Permalink
comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dusannosovic-ethernal committed Dec 23, 2023
1 parent 6931d6f commit 22b3a1c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
4 changes: 2 additions & 2 deletions consensus/polybft/contracts_initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func mintRewardTokensToWallet(polyBFTConfig PolyBFTConfig, transition *state.Tra

// mintStakeToken mints configured amount of stake token to stake token address
func mintStakeToken(polyBFTConfig PolyBFTConfig, transition *state.Transition) error {
if IsNativeStakeToken(polyBFTConfig.StakeTokenAddr) {
if isNativeStakeToken(polyBFTConfig.StakeTokenAddr) {
return nil
}

Expand Down Expand Up @@ -432,6 +432,6 @@ func isNativeRewardToken(cfg PolyBFTConfig) bool {
}

// isNativeStakeToken return true in case a native token is used for staking
func IsNativeStakeToken(stakeTokenAddr types.Address) bool {
func isNativeStakeToken(stakeTokenAddr types.Address) bool {
return stakeTokenAddr == contracts.NativeERC20TokenContract
}
2 changes: 1 addition & 1 deletion consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func GenesisPostHookFactory(config *chain.Chain, engineName string) func(txn *st
return err
}

if !IsNativeStakeToken(polyBFTConfig.StakeTokenAddr) && polyBFTConfig.Bridge != nil {
if !isNativeStakeToken(polyBFTConfig.StakeTokenAddr) {
if err := mintStakeToken(polyBFTConfig, transition); err != nil {
return err
}
Expand Down
22 changes: 0 additions & 22 deletions e2e-polybft/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1459,28 +1459,6 @@ func TestE2E_Bridge_NonNative(t *testing.T) {
minter, err := wallet.GenerateKey()
require.NoError(t, err)

receiverKeys := make([]string, transfersCount)
receivers := make([]string, transfersCount)
receiversAddrs := make([]types.Address, transfersCount)
amounts := make([]string, transfersCount)
tokenIDs := make([]string, transfersCount)

for i := 0; i < transfersCount; i++ {
key, err := wallet.GenerateKey()
require.NoError(t, err)

rawKey, err := key.MarshallPrivateKey()
require.NoError(t, err)

receiverKeys[i] = hex.EncodeToString(rawKey)
receivers[i] = types.Address(key.Address()).String()
receiversAddrs[i] = types.Address(key.Address())
amounts[i] = fmt.Sprintf("%d", amount)
tokenIDs[i] = fmt.Sprintf("%d", i+1)

t.Logf("Receiver#%d=%s\n", i+1, receivers[i])
}

cluster := framework.NewTestCluster(t, 5,
framework.WithNumBlockConfirmations(0),
framework.WithEpochSize(epochSize),
Expand Down
2 changes: 1 addition & 1 deletion helper/predeployment/predeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func GenerateGenesisAccountFromFile(

var contractABI *abi.ABI

if filepath == "" {
if conArtifact != nil {
finalBytecode = conArtifact.Bytecode
constructorInfo = conArtifact.Abi.Constructor
contractABI = conArtifact.Abi
Expand Down

0 comments on commit 22b3a1c

Please sign in to comment.