From 4841e554b8948767a6cb056b34ff9d9c6ab9106a Mon Sep 17 00:00:00 2001 From: Todd G Date: Mon, 23 Nov 2020 14:54:02 -0700 Subject: [PATCH 1/2] set form defaults for trnsloctoks --- .gitignore | 1 + action-form.go | 3 +++ action-vars.go | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/.gitignore b/.gitignore index f5e1d52..3bca1f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea package +local* .DS_Store diff --git a/action-form.go b/action-form.go index 5b2ed3e..f09283f 100644 --- a/action-form.go +++ b/action-form.go @@ -171,6 +171,9 @@ func GetAbiForm(action string, account *fio.Account, api *fio.API, opts *fio.TxO in.SetText("10,000.00") } } + if field.Name == "periods" { + variation.SetSelected("json -> struct") + } } hideFailed := widget.NewCheck("Hide Failed", func(b bool) {}) diff --git a/action-vars.go b/action-vars.go index 34349cd..bdd862c 100644 --- a/action-vars.go +++ b/action-vars.go @@ -251,6 +251,8 @@ func defaultValues(contract string, action string, fieldName string, fieldType s fee = fio.GetMaxFee("register_fio_domain") } returnValue = p.Sprintf("%.9f", fee) + case fieldName == "can_vote": + returnValue = "1" case fieldName == "is_public": returnValue = "1" case fieldType == "tokenpubaddr[]": @@ -338,6 +340,21 @@ func defaultValues(contract string, action string, fieldName string, fieldType s "actor":"%s", "permission":"active" }`, account.Actor) + case fieldName == "periods": + returnValue = `[ + { + "duration": 86400, + "percent": 1.2 + }, + { + "duration": 172800, + "percent": 90.8 + }, + { + "duration": 259200, + "percent": 8.0 + } +]` case fieldType == "permission_level[]": returnValue = fmt.Sprintf(`[{ "actor":"%s", From adb14d08ddab1272d69652144ee7b7bfc26462da Mon Sep 17 00:00:00 2001 From: Todd G Date: Fri, 8 Jan 2021 09:13:10 -0700 Subject: [PATCH 2/2] bump fio-go version causing a crash --- go.mod | 2 +- go.sum | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 17c3070..1bed2bf 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/btcsuite/btcd v0.20.1-beta github.com/btcsuite/btcutil v1.0.1 github.com/ethereum/go-ethereum v1.9.15 - github.com/fioprotocol/fio-go v1.0.1-0.20200923061247-06f15c940f04 + github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005 github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/text v0.3.3 diff --git a/go.sum b/go.sum index efec699..90dd969 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,12 @@ github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt github.com/ethereum/go-ethereum v1.9.15 h1:wrWl+QrtutRUJ9LZXdUqBoGoo2b1tOCYRDrAOQhCY3A= github.com/ethereum/go-ethereum v1.9.15/go.mod h1:slT8bPPRhXsyNTwHQxrOnjuTZ1sDXRajW11EkJ84QJ0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fioprotocol/fio-go v1.0.1-0.20200923061247-06f15c940f04 h1:1s2ZTfjMrGE32ZNL0Tr1ScI+zVZQmSbty2kHXm1tsp4= -github.com/fioprotocol/fio-go v1.0.1-0.20200923061247-06f15c940f04/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= +github.com/fioprotocol/fio-go v1.0.2-0.20201220021236-16318c6f0d8e h1:H4nMH3Q02qCGm+iMWskaougG9jLIfjOSn/LPo7f+9xs= +github.com/fioprotocol/fio-go v1.0.2-0.20201220021236-16318c6f0d8e/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= +github.com/fioprotocol/fio-go v1.0.3-0.20201220224546-01e10838c33f h1:z7USAVPeG0e9gKOrkGfCZ08cvlL40yVwiN0ICLXJM24= +github.com/fioprotocol/fio-go v1.0.3-0.20201220224546-01e10838c33f/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= +github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005 h1:j65XCEjg+xFKKcsngbXRECbXN2UEZGqGrO7tq3+u0qI= +github.com/fioprotocol/fio-go v1.0.3-0.20201222151005-9e1df6dd6005/go.mod h1:cX96BK9Y8fQPJP2GXGQvCFovHJ35lw7ICUUUAzqnH40= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=