Skip to content

Commit

Permalink
Merge pull request #32 from zenon-network/fmt/bridge-liq
Browse files Browse the repository at this point in the history
[fmt] Fix simple whitespace
  • Loading branch information
georgezgeorgez authored Oct 10, 2023
2 parents 83469e4 + 7273148 commit 7c976e0
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion common/crypto/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ func Keccak256(data ...[]byte) []byte {
}

return d.Sum(nil)
}
}
2 changes: 1 addition & 1 deletion common/types/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
LiquidityContract = parseEmbedded("z1qxemdeddedxlyquydytyxxxxxxxxxxxxflaaae")
AcceleratorContract = parseEmbedded("z1qxemdeddedxaccelerat0rxxxxxxxxxxp4tk22")
HtlcContract = parseEmbedded("z1qxemdeddedxhtlcxxxxxxxxxxxxxxxxxygecvw")
BridgeContract = parseEmbedded("z1qxemdeddedxdrydgexxxxxxxxxxxxxxxmqgr0d")
BridgeContract = parseEmbedded("z1qxemdeddedxdrydgexxxxxxxxxxxxxxxmqgr0d")

EmbeddedContracts = []Address{PlasmaContract, PillarContract, TokenContract, SentinelContract, SwapContract, StakeContract, SporkContract, LiquidityContract, AcceleratorContract, HtlcContract, BridgeContract}
EmbeddedWUpdate = []Address{PillarContract, StakeContract, SentinelContract, LiquidityContract, AcceleratorContract}
Expand Down
8 changes: 4 additions & 4 deletions common/types/spork.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package types

var (
AcceleratorSpork = NewImplementedSpork("6d2b1e6cb4025f2f45533f0fe22e9b7ce2014d91cc960471045fa64eee5a6ba3")
HtlcSpork = NewImplementedSpork("ceb7e3808ef17ea910adda2f3ab547be4cdfb54de8400ce3683258d06be1354b")
AcceleratorSpork = NewImplementedSpork("6d2b1e6cb4025f2f45533f0fe22e9b7ce2014d91cc960471045fa64eee5a6ba3")
HtlcSpork = NewImplementedSpork("ceb7e3808ef17ea910adda2f3ab547be4cdfb54de8400ce3683258d06be1354b")
BridgeAndLiquiditySpork = NewImplementedSpork("ddd43466769461c5b5d109c639da0f50a7eeb96ad6e7274b1928a35c431d7b1b")

ImplementedSporksMap = map[Hash]bool{
AcceleratorSpork.SporkId: true,
HtlcSpork.SporkId: true,
AcceleratorSpork.SporkId: true,
HtlcSpork.SporkId: true,
BridgeAndLiquiditySpork.SporkId: true,
}
)
Expand Down
2 changes: 1 addition & 1 deletion protocol/chain_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c chainBridge) CurrentBlock() *nom.Momentum {
store := c.chain.GetFrontierMomentumStore()
momentum, err := store.GetFrontierMomentum()
common.DealWithErr(err)

return momentum
}
func (c chainBridge) GetBlockByNumber(num uint64) (*nom.Momentum, error) {
Expand Down
2 changes: 1 addition & 1 deletion protocol/downloader/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (q *queue) Reserve(p *peer, count int) *fetchRequest {
if space == 0 {
return nil
}

for _, request := range q.pendPool {
space -= len(request.Hashes)
}
Expand Down
2 changes: 1 addition & 1 deletion vm/constants/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var (
ErrInvalidPreimage = errors.New("invalid preimage")
ErrInvalidExpirationTime = errors.New("invalid expiration time")
ErrExpired = errors.New("expired")

// Bridge
ErrUnknownNetwork = errors.New("unknown network")
ErrInvalidToAddress = errors.New("invalid destination address")
Expand Down
8 changes: 4 additions & 4 deletions vm/embedded/embedded.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ type embeddedImplementation struct {
}

var (
originEmbedded = getOrigin()
acceleratorEmbedded = getAccelerator()
htlcEmbedded = getHtlc()
originEmbedded = getOrigin()
acceleratorEmbedded = getAccelerator()
htlcEmbedded = getHtlc()
bridgeAndLiquidityEmbedded = getBridgeAndLiquidity()
)

Expand Down Expand Up @@ -216,7 +216,7 @@ func GetEmbeddedMethod(context vm_context.AccountVmContext, address types.Addres
}

var contractsMap map[types.Address]*embeddedImplementation

if context.IsHtlcSporkEnforced() {
contractsMap = htlcEmbedded
} else if context.IsBridgeAndLiquiditySporkEnforced() {
Expand Down
2 changes: 1 addition & 1 deletion vm/vm_context/spork.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ func (ctx *accountVmContext) IsBridgeAndLiquiditySporkEnforced() bool {
active, err := ctx.momentumStore.IsSporkActive(types.BridgeAndLiquiditySpork)
common.DealWithErr(err)
return active
}
}

0 comments on commit 7c976e0

Please sign in to comment.