Skip to content

Commit

Permalink
auto ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwzw committed Mar 11, 2022
1 parent be390bc commit 46acda8
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions plugin/consensus/dpos/types/signable.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (vote *Vote) String() string {

// Verify ...
func (vote *Vote) Verify(chainID string, pubKey crypto.PubKey) error {
addr := address.BytesToBtcAddress(address.NormalVer, pubKey.Bytes()).Hash160[:]
addr := address.BytesToBtcAddress(address.NormalVer, pubKey.Bytes()).Hash160[:]
if !bytes.Equal(addr, vote.VoterNodeAddress) {
return ErrVoteInvalidValidatorAddress
}
Expand Down Expand Up @@ -192,7 +192,7 @@ func (notify *Notify) String() string {

// Verify ...
func (notify *Notify) Verify(chainID string, pubKey crypto.PubKey) error {
addr := address.BytesToBtcAddress(address.NormalVer, pubKey.Bytes()).Hash160[:]
addr := address.BytesToBtcAddress(address.NormalVer, pubKey.Bytes()).Hash160[:]
if !bytes.Equal(addr, notify.NotifyNodeAddress) {
return ErrNotifyInvalidValidatorAddress
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/dapp/cross2eth/ebrelayer/relayer/chain33/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func getTxByHashesRpc(txhex, rpcLaddr string) (string, error) {

func getContractAddr(caller, txhex string) address.Address {
return *address.BytesToBtcAddress(address.NormalVer,
address.ExecPubKey(caller + ethcommon.Bytes2Hex(common.HexToHash(txhex).Bytes())))
address.ExecPubKey(caller+ethcommon.Bytes2Hex(common.HexToHash(txhex).Bytes())))
}

func deploySingleContract(code []byte, abi, constructorPara, contractName, paraChainName, deployer, rpcLaddr string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion plugin/dapp/evm/commands/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func calcNewContractAddrCmd() *cobra.Command {
func calcNewContractAddr(cmd *cobra.Command, args []string) {
deployer, _ := cmd.Flags().GetString("deployer")
hash, _ := cmd.Flags().GetString("hash")
newContractAddr := address.BytesToBtcAddress(address.NormalVer, address.ExecPubKey(deployer + hash))
newContractAddr := address.BytesToBtcAddress(address.NormalVer, address.ExecPubKey(deployer+hash))
fmt.Println(newContractAddr.String())
}

Expand Down
26 changes: 13 additions & 13 deletions plugin/dapp/evm/executor/vm/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ type MemoryStateDB struct {
// 开始执行下一个区块时(执行器框架调用setEnv设置的区块高度发生变更时),会重新创建此DB对象
func NewMemoryStateDB(StateDB db.KV, LocalDB db.KVDB, CoinsAccount *account.DB, blockHeight int64, api client.QueueProtocolAPI) *MemoryStateDB {
mdb := &MemoryStateDB{
StateDB: StateDB,
LocalDB: LocalDB,
CoinsAccount: CoinsAccount,
StateDB: StateDB,
LocalDB: LocalDB,
CoinsAccount: CoinsAccount,
evmPlatformAddr: address.BytesToBtcAddress(address.NormalVer,
address.ExecPubKey(api.GetConfig().ExecName("evm"))).String(),
accounts: make(map[string]*ContractAccount),
logs: make(map[common.Hash][]*model.ContractLog),
logSize: 0,
preimages: make(map[common.Hash][]byte),
stateDirty: make(map[string]interface{}),
dataDirty: make(map[string]interface{}),
blockHeight: blockHeight,
refund: 0,
txIndex: 0,
api: api,
accounts: make(map[string]*ContractAccount),
logs: make(map[common.Hash][]*model.ContractLog),
logSize: 0,
preimages: make(map[common.Hash][]byte),
stateDirty: make(map[string]interface{}),
dataDirty: make(map[string]interface{}),
blockHeight: blockHeight,
refund: 0,
txIndex: 0,
api: api,
}
return mdb
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/dapp/evm/rpc/jrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (c *Jrpc) CalcNewContractAddr(parm *evm.EvmCalcNewContractAddrReq, result *
return types.ErrInvalidParam
}
newContractAddr := address.BytesToBtcAddress(address.NormalVer,
address.ExecPubKey(parm.Caller + parm.Txhash))
address.ExecPubKey(parm.Caller+parm.Txhash))
*result = newContractAddr.String()
return nil
}
1 change: 1 addition & 0 deletions plugin/dapp/multisig/executor/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package executor

import (
"encoding/hex"

"github.com/33cn/chain33/system/address/btc"

"github.com/33cn/chain33/account"
Expand Down
3 changes: 2 additions & 1 deletion plugin/dapp/multisig/executor/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
package executor

import (
"github.com/33cn/chain33/system/address/btc"
"testing"

"github.com/33cn/chain33/system/address/btc"

"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common"
commonlog "github.com/33cn/chain33/common/log"
Expand Down
1 change: 1 addition & 0 deletions plugin/dapp/multisig/executor/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ multiSig合约主要实现如下功能:
import (
"bytes"
"encoding/hex"

"github.com/33cn/chain33/system/address/btc"

"github.com/33cn/chain33/account"
Expand Down
2 changes: 1 addition & 1 deletion plugin/dapp/privacy/crypto/onetimeed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type oneTimeEd25519 struct{}

func init() {
crypto.Register(privacytypes.SignNameOnetimeED25519, &oneTimeEd25519{},
crypto.WithRegOptionTypeID(privacytypes.OnetimeED25519))
crypto.WithRegOptionTypeID(privacytypes.OnetimeED25519))
}

func (onetime *oneTimeEd25519) GenKey() (crypto.PrivKey, error) {
Expand Down

0 comments on commit 46acda8

Please sign in to comment.