Skip to content
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

minor: style code vertically and implement consts & vars #21

Closed
wants to merge 10 commits into from
Closed
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.db
*.bak
*.dfs
*.bin
gnomon
77 changes: 77 additions & 0 deletions const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 2023-2024 DERO Foundation. All rights reserved.
// Use of this source code in any form is governed by RESEARCH license.
// license can be found in the LICENSE file.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package main

// Constants
const (
// ports
DEFAULT_TESTNET_WALLET_PORT = 40403
DEFAULT_TESTNET_DAEMON_PORT = 40402
DEFAULT_TESTNET_WORK_PORT = 40400
DEFAULT_WALLET_PORT = 10103
DEFAULT_DAEMON_PORT = 10102
DEFAULT_WORK_PORT = 10100

// endpoints
DEFAULT_LOCAL_IP_ADDRESS = "127.0.0.1"

// testnet
DEFAULT_LOCAL_TESTNET_WALLET_RPC = "127.0.0.1:40403"
DEFAULT_LOCAL_TESTNET_DAEMON = "127.0.0.1:40402"
DEFAULT_LOCAL_TESTNET_P2P = "127.0.0.1:40401"
DEFAULT_LOCAL_TESTNET_WORK = "0.0.0.0:40400"
DEFAULT_REMOTE_TESTNET_DAEMON = "testnetexplorer.dero.io:40402"
DEFAULT_TESTNET_EXPLORER_URL = "https://testnetexplorer.dero.io"

// mainnet
DEFAULT_LOCAL_WALLET_RPC = "127.0.0.1:10103"
DEFAULT_LOCAL_DAEMON = "127.0.0.1:10102"
DEFAULT_LOCAL_P2P = "127.0.0.1:10101"
DEFAULT_DISCOVER_DAEMON = "0.0.0.0:10102"
DEFAULT_LOCAL_WORK = "0.0.0.0:10100"
DEFAULT_REMOTE_DAEMON = "node.derofoundation.org:11012"
DEFAULT_EXPLORER_URL = "https://explorer.dero.io"

// wallet
DEFAULT_CONFIRMATION_TIMEOUT = 5
DEFAULT_MAX_RINGSIZE = 128

// platform
DERO_DEVELOPER_MAINNET_ADDRESS = "dero1qykyta6ntpd27nl0yq4xtzaf4ls6p5e9pqu0k2x4x3pqq5xavjsdxqgny8270"
DERO_DEVELOPER_TESTNET_ADDRESS = "deto1qy0ehnqjpr0wxqnknyc66du2fsxyktppkr8m8e6jvplp954klfjz2qqdzcd8p"
DERO_DEVELOPER_SIMULATOR_ADDRESS = "deto1qyvyeyzrcm2fzf6kyq7egkes2ufgny5xn77y6typhfx9s7w3mvyd5qqynr5hx"

// daemon
DAEMON_GET_GAS_ESTIMATE = "DERO.GetGasEstimate"
DAEMON_GET_SC = "DERO.GetSC"
DAEMON_GET_TX = "DERO.GetTransaction"
DAEMON_NAME_TO_ADDRESS = "DERO.NameToAddress"

// contract functions
DEFAULT_SC_RINGSIZE = 2
DEFAULT_SC_ENTRYPOINT = "entrypoint"
POST_STRING = "POST"
GET_STRING = "GET"
CONTENT_TYPE_STRING = "Content-Type"
APP_OCTET_STREAM_STRING = "application/octet-stream"
APP_JSON_STRING = "application/json"

// name_service
DERO_NAME_SERVICE_SCID = "0000000000000000000000000000000000000000000000000000000000000001"
TRANSFER_OWNERSHIP_STRING = "TransferOwnership"
NAME_STRING = "name"
OWNER_STRING = "owner"
NEWOWNER_STRING = "newowner"
REGISTER_STRING = "Register"
)
12 changes: 8 additions & 4 deletions custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func (o *iframe) DragEnd() {
*/
if engram.Disk != nil {
if nav.CurY > nav.PosY+30 {
if session.Domain == "app.messages" {
if session.Domain == appMessages {
session.Window.SetContent(layoutTransition())
session.Window.SetContent(layoutMessages())
} else if session.Domain == "app.messages.contact" {
} else if session.Domain == appMessagesContact {
session.Window.SetContent(layoutTransition())
session.Window.SetContent(layoutPM())
} else if session.Domain == "app.Identity" {
} else if session.Domain == appIdentity {
session.Window.SetContent(layoutTransition())
session.Window.SetContent(layoutIdentity())
}
Expand Down Expand Up @@ -196,7 +196,11 @@ type contextMenuButton struct {
}

func (o *contextMenuButton) Tapped(e *fyne.PointEvent) {
widget.ShowPopUpMenuAtPosition(o.menu, fyne.CurrentApp().Driver().CanvasForObject(o), e.AbsolutePosition)
widget.ShowPopUpMenuAtPosition(
o.menu,
fyne.CurrentApp().Driver().CanvasForObject(o),
e.AbsolutePosition,
)
}

// NewContextMenuButton creates a new button widget with a dropdown menu
Expand Down
Loading