From c44457ceada7f9a73910d491821482b8b9f3c1f2 Mon Sep 17 00:00:00 2001 From: Min65535 <22154915+Min65535@users.noreply.github.com> Date: Fri, 7 Feb 2020 16:44:18 +0800 Subject: [PATCH 1/2] SendTransaction --- common/g-error/full_ chain_service.go | 4 ++-- core/rpc-interface/chainstack_mercury_api.go | 3 ++- core/rpc-interface/dipperin_external_api.go | 7 +++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/g-error/full_ chain_service.go b/common/g-error/full_ chain_service.go index 57db2d85..063f2de5 100644 --- a/common/g-error/full_ chain_service.go +++ b/common/g-error/full_ chain_service.go @@ -3,5 +3,5 @@ package g_error import "github.com/pkg/errors" var ( - ErrNotMineMaster = errors.New("current node is not mine master") -) \ No newline at end of file + ErrNotMineMaster = errors.New("current node is not mine master") +) diff --git a/core/rpc-interface/chainstack_mercury_api.go b/core/rpc-interface/chainstack_mercury_api.go index 72bf004f..3b6a113b 100644 --- a/core/rpc-interface/chainstack_mercury_api.go +++ b/core/rpc-interface/chainstack_mercury_api.go @@ -180,9 +180,10 @@ func (api *DipperinVenusApi) GetBlockNumber(hash common.Hash) *uint64 { return api.service.GetBlockNumber(hash) } -func (api *DipperinVenusApi) ConvertLogs(logs []*model2.Log) ([]*model2.Log, error) { +func (api *DipperinVenusApi) ConvertLogs(logs []*model2.Log) ([]*model2.Log, error) { return api.service.ConvertLogs(logs) } + // get genesis block // swagger:operation GET /url/GetGenesis block information block // --- diff --git a/core/rpc-interface/dipperin_external_api.go b/core/rpc-interface/dipperin_external_api.go index 2618f122..78f57922 100644 --- a/core/rpc-interface/dipperin_external_api.go +++ b/core/rpc-interface/dipperin_external_api.go @@ -17,6 +17,10 @@ type DipperExternalApi struct { allApis *DipperinVenusApi } +func (api *DipperExternalApi) SendTransaction(from, to common.Address, value, gasPrice *big.Int, gasLimit uint64, data []byte, nonce *uint64) (common.Hash, error) { + return api.allApis.SendTransaction(from, to, value, gasPrice, gasLimit, data, nonce) +} + // verify whether the chain is in sync func (api *DipperExternalApi) GetSyncStatus() bool { return api.allApis.GetSyncStatus() @@ -96,8 +100,7 @@ func (api *DipperExternalApi) GetBlockNumber(hash common.Hash) *uint64 { return api.allApis.GetBlockNumber(hash) } - -func (api *DipperExternalApi) ConvertLogs(logs []*model2.Log) ([]*model2.Log, error) { +func (api *DipperExternalApi) ConvertLogs(logs []*model2.Log) ([]*model2.Log, error) { return api.allApis.ConvertLogs(logs) } From 1e380101514ca35a583ca9d09386ea70ab9b6d2a Mon Sep 17 00:00:00 2001 From: Min65535 <22154915+Min65535@users.noreply.github.com> Date: Fri, 7 Feb 2020 16:55:56 +0800 Subject: [PATCH 2/2] fix bugs tips in dipperincli main --- cmd/dipperincli/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/dipperincli/main.go b/cmd/dipperincli/main.go index 97d58deb..206af9f9 100644 --- a/cmd/dipperincli/main.go +++ b/cmd/dipperincli/main.go @@ -152,7 +152,7 @@ func appAction(c *cli.Context) { case chain_config.BootEnvVenus, chain_config.BootEnvMercury, chain_config.BootEnvTest, chain_config.BootEnvLocal: default: - log.DLogger.Error("boots_env set error,please check!", zap.String("bootEnv", env)) + log.DLogger.Warn("boots_env set error,please check!", zap.String("bootEnv", env)) return }