From 72731481ea9d2d5122071312d86eb111a9482ee3 Mon Sep 17 00:00:00 2001 From: georgezgeorgez Date: Sun, 10 Sep 2023 00:05:32 +0000 Subject: [PATCH] Fix simple whitespace --- common/crypto/hash.go | 2 +- common/types/address.go | 2 +- common/types/spork.go | 8 ++++---- protocol/chain_bridge.go | 2 +- protocol/downloader/queue.go | 2 +- vm/constants/errors.go | 2 +- vm/embedded/embedded.go | 8 ++++---- vm/vm_context/spork.go | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/crypto/hash.go b/common/crypto/hash.go index e498eea..d7b5384 100644 --- a/common/crypto/hash.go +++ b/common/crypto/hash.go @@ -29,4 +29,4 @@ func Keccak256(data ...[]byte) []byte { } return d.Sum(nil) -} \ No newline at end of file +} diff --git a/common/types/address.go b/common/types/address.go index 31490d5..3324159 100644 --- a/common/types/address.go +++ b/common/types/address.go @@ -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} diff --git a/common/types/spork.go b/common/types/spork.go index 05d856d..3f63468 100644 --- a/common/types/spork.go +++ b/common/types/spork.go @@ -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, } ) diff --git a/protocol/chain_bridge.go b/protocol/chain_bridge.go index 168d597..4e1d0c1 100644 --- a/protocol/chain_bridge.go +++ b/protocol/chain_bridge.go @@ -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) { diff --git a/protocol/downloader/queue.go b/protocol/downloader/queue.go index 9171abf..f0bf363 100644 --- a/protocol/downloader/queue.go +++ b/protocol/downloader/queue.go @@ -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) } diff --git a/vm/constants/errors.go b/vm/constants/errors.go index a36b7bc..70ea71c 100644 --- a/vm/constants/errors.go +++ b/vm/constants/errors.go @@ -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") diff --git a/vm/embedded/embedded.go b/vm/embedded/embedded.go index 096cac2..ca5814e 100644 --- a/vm/embedded/embedded.go +++ b/vm/embedded/embedded.go @@ -32,9 +32,9 @@ type embeddedImplementation struct { } var ( - originEmbedded = getOrigin() - acceleratorEmbedded = getAccelerator() - htlcEmbedded = getHtlc() + originEmbedded = getOrigin() + acceleratorEmbedded = getAccelerator() + htlcEmbedded = getHtlc() bridgeAndLiquidityEmbedded = getBridgeAndLiquidity() ) @@ -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() { diff --git a/vm/vm_context/spork.go b/vm/vm_context/spork.go index 99f9b20..5ddc9d3 100644 --- a/vm/vm_context/spork.go +++ b/vm/vm_context/spork.go @@ -21,4 +21,4 @@ func (ctx *accountVmContext) IsBridgeAndLiquiditySporkEnforced() bool { active, err := ctx.momentumStore.IsSporkActive(types.BridgeAndLiquiditySpork) common.DealWithErr(err) return active -} \ No newline at end of file +}