Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhnguyennguyen committed Nov 11, 2019
1 parent 0d4a87b commit 0f4e52b
Show file tree
Hide file tree
Showing 25 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"
"fmt"
"github.com/ethereum/go-ethereum/consensus"
"github.com/tomochain/tomochain/consensus"
"math/big"
"sync"
"time"
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Package bind generates Ethereum contract Go bindings.
//
// Detailed usage document and tutorial available on the go-ethereum Wiki page:
// https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts
// https://github.com/tomochain/tomochain/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts
package bind

import (
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func unpackTestEventData(dest interface{}, hexData string, jsonEvent []byte, ass

/*
Taken from
https://github.com/ethereum/go-ethereum/pull/15568
https://github.com/tomochain/tomochain/pull/15568
*/

type testResult struct {
Expand Down
6 changes: 3 additions & 3 deletions cmd/puppeth/module_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ var dashboardContent = `
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for Java based Android projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from Android too.</p>
<p>Under the hood the Android library is backed by a go-ethereum light node, meaning that given a not-too-old Android device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
<br/>
<p>The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in <a href="https://github.com/ethereum/go-ethereum/wiki/Mobile:-Introduction#android-archive" target="about:blank">Mobile: Introduction &ndash; Android archive</a>.
<p>The stable Android archives are distributed via Maven Central, and the develop snapshots via the Sonatype repositories. Before proceeding, please ensure you have a recent version configured in your Android project. You can find details in <a href="https://github.com/tomochain/tomochain/wiki/Mobile:-Introduction#android-archive" target="about:blank">Mobile: Introduction &ndash; Android archive</a>.
<p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your Android project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
<p>Inside your Java code you can now import the geth archive and connect to Ethereum:
<pre>import org.ethereum.geth.*;</pre>
Expand Down Expand Up @@ -287,7 +287,7 @@ node.start();
<p>Starting with the 1.5 release of go-ethereum, we've transitioned away from shipping only full blown Ethereum clients and started focusing on releasing the code as reusable packages initially for Go projects, then later for ObjC/Swift based iOS projects too. Mobile support is still evolving, hence is bound to change often and hard, but the Ethereum network can nonetheless be accessed from iOS too.</p>
<p>Under the hood the iOS library is backed by a go-ethereum light node, meaning that given a not-too-old Apple device, you should be able to join the network without significant issues. Certain functionality is not yet available and rough edges are bound to appear here and there, please report issues if you find any.</p>
<br/>
<p>Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in <a href="https://github.com/ethereum/go-ethereum/wiki/Mobile:-Introduction#ios-framework" target="about:blank">Mobile: Introduction &ndash; iOS framework</a>.
<p>Both stable and develop builds of the iOS framework are available via CocoaPods. Before proceeding, please ensure you have a recent version configured in your iOS project. You can find details in <a href="https://github.com/tomochain/tomochain/wiki/Mobile:-Introduction#ios-framework" target="about:blank">Mobile: Introduction &ndash; iOS framework</a>.
<p>Before connecting to the Ethereum network, download the <a href="/{{.GethGenesis}}"><code>{{.GethGenesis}}</code></a> genesis json file and either store it in your iOS project as a resource file you can access, or save it as a string in a variable. You're going to need to to initialize your client.</p>
<p>Inside your Swift code you can now import the geth framework and connect to Ethereum (ObjC should be analogous):
<pre>import Geth</pre>
Expand Down Expand Up @@ -419,7 +419,7 @@ try! node?.start();
<p>Puppeth is a tool to aid you in creating a new Ethereum network down to the genesis block, bootnodes, signers, ethstats server, crypto faucet, wallet browsers, block explorer, dashboard and more; without the hassle that it would normally entail to manually configure all these services one by one.</p>
<p>Puppeth uses ssh to dial in to remote servers, and builds its network components out of docker containers using docker-compose. The user is guided through the process via a command line wizard that does the heavy lifting and topology configuration automatically behind the scenes.</p>
<br/>
<p>Puppeth is distributed as part of the <a href="https://geth.ethereum.org/downloads/" target="about:blank">Geth &amp; Tools</a> bundles, but can also be installed separately via:<pre>go get github.com/ethereum/go-ethereum/cmd/puppeth</pre></p>
<p>Puppeth is distributed as part of the <a href="https://geth.ethereum.org/downloads/" target="about:blank">Geth &amp; Tools</a> bundles, but can also be installed separately via:<pre>go get github.com/tomochain/tomochain/cmd/puppeth</pre></p>
<br/>
<p><em>Copyright 2017. The go-ethereum Authors.</em></p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion cmd/tomo/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could
`)
}

// https://github.com/ethereum/go-ethereum/issues/1785
// https://github.com/tomochain/tomochain/issues/1785
func TestUnlockFlagMultiIndex(t *testing.T) {
datadir := tmpDatadirWithKeystore(t)
tomo := runTomo(t,
Expand Down
2 changes: 1 addition & 1 deletion consensus/ethash/ethash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestTestMode(t *testing.T) {
}

// This test checks that cache lru logic doesn't crash under load.
// It reproduces https://github.com/ethereum/go-ethereum/issues/14943
// It reproduces https://github.com/tomochain/tomochain/issues/14943
func TestCacheFileEvict(t *testing.T) {
tmpdir, err := ioutil.TempDir("", "ethash-test")
if err != nil {
Expand Down
20 changes: 10 additions & 10 deletions consensus/posv/posv.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/ethereum/tomochain/tomox/tomox_state"
"github.com/tomochain/tomochain/tomox/tomox_state"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
"io/ioutil"
"math/big"
Expand All @@ -33,6 +33,7 @@ import (
"sync"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/common/hexutil"
Expand All @@ -48,7 +49,6 @@ import (
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/rpc"
lru "github.com/hashicorp/golang-lru"
)

const (
Expand All @@ -69,7 +69,7 @@ type TomoXService interface {
GetTriegc() *prque.Prque
ApplyOrder(coinbase common.Address, chain consensus.ChainContext, statedb *state.StateDB, tomoXstatedb *tomox_state.TomoXStateDB, orderBook common.Hash, order *tomox_state.OrderItem) ([]map[string]string, []*tomox_state.OrderItem, error)
IsSDKNode() bool
SyncDataToSDKNode(txDataMatch tomox_state.TxDataMatch, txHash common.Hash, txMatchTime time.Time, statedb *state.StateDB,dirtyOrderCount *uint64) error
SyncDataToSDKNode(txDataMatch tomox_state.TxDataMatch, txHash common.Hash, txMatchTime time.Time, statedb *state.StateDB, dirtyOrderCount *uint64) error
RollbackReorgTxMatch(txhash common.Hash)
}

Expand Down Expand Up @@ -240,13 +240,13 @@ type Posv struct {
signFn clique.SignerFn // Signer function to authorize hashes with
lock sync.RWMutex // Protects the signer fields

BlockSigners *lru.Cache
HookReward func(chain consensus.ChainReader, state *state.StateDB, header *types.Header) (error, map[string]interface{})
HookPenalty func(chain consensus.ChainReader, blockNumberEpoc uint64) ([]common.Address, error)
HookPenaltyTIPSigning func(chain consensus.ChainReader, header *types.Header, candidate []common.Address) ([]common.Address, error)
HookValidator func(header *types.Header, signers []common.Address) ([]byte, error)
HookVerifyMNs func(header *types.Header, signers []common.Address) error
GetTomoXService func() TomoXService
BlockSigners *lru.Cache
HookReward func(chain consensus.ChainReader, state *state.StateDB, header *types.Header) (error, map[string]interface{})
HookPenalty func(chain consensus.ChainReader, blockNumberEpoc uint64) ([]common.Address, error)
HookPenaltyTIPSigning func(chain consensus.ChainReader, header *types.Header, candidate []common.Address) ([]common.Address, error)
HookValidator func(header *types.Header, signers []common.Address) ([]byte, error)
HookVerifyMNs func(header *types.Header, signers []common.Address) error
GetTomoXService func() TomoXService
HookGetSignersFromContract func(blockHash common.Hash) ([]common.Address, error)
}

Expand Down
16 changes: 8 additions & 8 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ package core

import (
"fmt"
"github.com/ethereum/tomochain/consensus/posv"
"github.com/ethereum/tomochain/tomox/tomox_state"
"github.com/tomochain/tomochain/consensus/posv"
"github.com/tomochain/tomochain/tomox/tomox_state"

"github.com/ethereum/tomochain/common"
"github.com/ethereum/tomochain/consensus"
"github.com/ethereum/tomochain/core/state"
"github.com/ethereum/tomochain/core/types"
"github.com/ethereum/tomochain/log"
"github.com/ethereum/tomochain/params"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/consensus"
"github.com/tomochain/tomochain/core/state"
"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/params"
)

// BlockValidator is responsible for validating block headers, uncles and
Expand Down
4 changes: 2 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"sync/atomic"
"time"

"github.com/ethereum/tomochain/accounts/abi/bind"
"github.com/ethereum/tomochain/tomox/tomox_state"
"github.com/tomochain/tomochain/accounts/abi/bind"
"github.com/tomochain/tomochain/tomox/tomox_state"

"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/common/mclock"
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ func TestEIP161AccountRemoval(t *testing.T) {
// tests that under weird reorg conditions the blockchain and its internal header-
// chain return the same latest block/header.
//
// https://github.com/ethereum/go-ethereum/pull/15941how Source Control
// https://github.com/tomochain/tomochain/pull/15941how Source Control
func TestBlockchainHeaderchainReorgConsistency(t *testing.T) {
// Generate a canonical chain to act as the main dataset
engine := ethash.NewFaker()
Expand Down
2 changes: 1 addition & 1 deletion core/bloombits/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestMatcherRandom(t *testing.T) {

// Tests that the matcher can properly find matches if the starting block is
// shifter from a multiple of 8. This is needed to cover an optimisation with
// bitset matching https://github.com/ethereum/go-ethereum/issues/15309.
// bitset matching https://github.com/tomochain/tomochain/issues/15309.
func TestMatcherShifted(t *testing.T) {
// Block 0 always matches in the tests, skip ahead of first 8 blocks with the
// start to get a potential zero byte in the matcher bitset.
Expand Down
2 changes: 1 addition & 1 deletion core/state/statedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func TestIntermediateLeaks(t *testing.T) {

// TestCopy tests that copying a statedb object indeed makes the original and
// the copy independent of each other. This test is a regression test against
// https://github.com/ethereum/go-ethereum/pull/15549.
// https://github.com/tomochain/tomochain/pull/15549.
func TestCopy(t *testing.T) {
// Create a random state test to copy and modify "independently"
db, _ := ethdb.NewMemDatabase()
Expand Down
16 changes: 8 additions & 8 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import (
"runtime"
"sync"

"github.com/ethereum/tomochain/common"
"github.com/ethereum/tomochain/consensus"
"github.com/ethereum/tomochain/consensus/misc"
"github.com/ethereum/tomochain/core/state"
"github.com/ethereum/tomochain/core/types"
"github.com/ethereum/tomochain/core/vm"
"github.com/ethereum/tomochain/crypto"
"github.com/ethereum/tomochain/params"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/consensus"
"github.com/tomochain/tomochain/consensus/misc"
"github.com/tomochain/tomochain/core/state"
"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/core/vm"
"github.com/tomochain/tomochain/crypto"
"github.com/tomochain/tomochain/params"
)

// StateProcessor is a basic Processor, which takes care of transitioning
Expand Down
10 changes: 5 additions & 5 deletions core/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package core

import (
"github.com/ethereum/tomochain/common"
"github.com/ethereum/tomochain/core/state"
"github.com/ethereum/tomochain/core/types"
"github.com/ethereum/tomochain/core/vm"
"github.com/ethereum/tomochain/tomox/tomox_state"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/core/state"
"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/core/vm"
"github.com/tomochain/tomochain/tomox/tomox_state"
"math/big"
)

Expand Down
30 changes: 15 additions & 15 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ import (
"context"
"errors"
"fmt"
"github.com/ethereum/tomochain/tomox/tomox_state"
"github.com/tomochain/tomochain/tomox/tomox_state"
"math/big"
"sort"
"strings"
"time"

"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/accounts/abi/bind"
"github.com/tomochain/tomochain/accounts/keystore"
Expand All @@ -46,8 +48,6 @@ import (
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/rpc"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
)

const (
Expand Down Expand Up @@ -438,7 +438,7 @@ func signHash(data []byte) []byte {
//
// The key used to calculate the signature is decrypted with the given password.
//
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
// https://github.com/tomochain/tomochain/wiki/Management-APIs#personal_sign
func (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, addr common.Address, passwd string) (hexutil.Bytes, error) {
// Look up the wallet containing the requested signer
account := accounts.Account{Address: addr}
Expand All @@ -465,7 +465,7 @@ func (s *PrivateAccountAPI) Sign(ctx context.Context, data hexutil.Bytes, addr c
// Note, the signature must conform to the secp256k1 curve R, S and V values, where
// the V value must be be 27 or 28 for legacy reasons.
//
// https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_ecRecover
// https://github.com/tomochain/tomochain/wiki/Management-APIs#personal_ecRecover
func (s *PrivateAccountAPI) EcRecover(ctx context.Context, data, sig hexutil.Bytes) (common.Address, error) {
if len(sig) != 65 {
return common.Address{}, fmt.Errorf("signature must be 65 bytes long")
Expand Down Expand Up @@ -1875,7 +1875,7 @@ func (s *PublicTomoXTransactionPoolAPI) GetOrderCount(ctx context.Context, addr
return (*hexutil.Uint64)(&nonce), err
}

func (s *PublicTomoXTransactionPoolAPI) GetBestBid(ctx context.Context, baseToken,quoteToken common.Address) (PriceVolume, error) {
func (s *PublicTomoXTransactionPoolAPI) GetBestBid(ctx context.Context, baseToken, quoteToken common.Address) (PriceVolume, error) {

result := PriceVolume{}
block := s.b.CurrentBlock()
Expand All @@ -1891,14 +1891,14 @@ func (s *PublicTomoXTransactionPoolAPI) GetBestBid(ctx context.Context, baseToke
if err != nil {
return result, err
}
result.Price, result.Volume = tomoxState.GetBestBidPrice(tomox_state.GetOrderBookHash(baseToken,quoteToken))
result.Price, result.Volume = tomoxState.GetBestBidPrice(tomox_state.GetOrderBookHash(baseToken, quoteToken))
if result.Price.Sign() == 0 {
return result, errors.New("Bid tree not found")
}
return result, nil
}

func (s *PublicTomoXTransactionPoolAPI) GetBestAsk(ctx context.Context, baseToken,quoteToken common.Address) (PriceVolume, error) {
func (s *PublicTomoXTransactionPoolAPI) GetBestAsk(ctx context.Context, baseToken, quoteToken common.Address) (PriceVolume, error) {
result := PriceVolume{}
block := s.b.CurrentBlock()
if block == nil {
Expand All @@ -1913,14 +1913,14 @@ func (s *PublicTomoXTransactionPoolAPI) GetBestAsk(ctx context.Context, baseToke
if err != nil {
return result, err
}
result.Price, result.Volume = tomoxState.GetBestAskPrice(tomox_state.GetOrderBookHash(baseToken,quoteToken))
result.Price, result.Volume = tomoxState.GetBestAskPrice(tomox_state.GetOrderBookHash(baseToken, quoteToken))
if result.Price.Sign() == 0 {
return result, errors.New("Ask tree not found")
}
return result, nil
}

func (s *PublicTomoXTransactionPoolAPI) GetBidTree(ctx context.Context, baseToken,quoteToken common.Address) (map[*big.Int]tomox_state.DumpOrderList, error) {
func (s *PublicTomoXTransactionPoolAPI) GetBidTree(ctx context.Context, baseToken, quoteToken common.Address) (map[*big.Int]tomox_state.DumpOrderList, error) {
block := s.b.CurrentBlock()
if block == nil {
return nil, errors.New("Current block not found")
Expand All @@ -1933,14 +1933,14 @@ func (s *PublicTomoXTransactionPoolAPI) GetBidTree(ctx context.Context, baseToke
if err != nil {
return nil, err
}
result, err := tomoxState.DumpBidTrie(tomox_state.GetOrderBookHash(baseToken,quoteToken))
result, err := tomoxState.DumpBidTrie(tomox_state.GetOrderBookHash(baseToken, quoteToken))
if err != nil {
return nil, err
}
return result, nil
}

func (s *PublicTomoXTransactionPoolAPI) GetAskTree(ctx context.Context, baseToken,quoteToken common.Address) (map[*big.Int]tomox_state.DumpOrderList, error) {
func (s *PublicTomoXTransactionPoolAPI) GetAskTree(ctx context.Context, baseToken, quoteToken common.Address) (map[*big.Int]tomox_state.DumpOrderList, error) {
block := s.b.CurrentBlock()
if block == nil {
return nil, errors.New("Current block not found")
Expand All @@ -1953,14 +1953,14 @@ func (s *PublicTomoXTransactionPoolAPI) GetAskTree(ctx context.Context, baseToke
if err != nil {
return nil, err
}
result, err := tomoxState.DumpAskTrie(tomox_state.GetOrderBookHash(baseToken,quoteToken))
result, err := tomoxState.DumpAskTrie(tomox_state.GetOrderBookHash(baseToken, quoteToken))
if err != nil {
return nil, err
}
return result, nil
}

func (s *PublicTomoXTransactionPoolAPI) GetOrderById(ctx context.Context, baseToken,quoteToken common.Address, orderId uint64) (interface{}, error) {
func (s *PublicTomoXTransactionPoolAPI) GetOrderById(ctx context.Context, baseToken, quoteToken common.Address, orderId uint64) (interface{}, error) {
block := s.b.CurrentBlock()
if block == nil {
return nil, errors.New("Current block not found")
Expand All @@ -1974,7 +1974,7 @@ func (s *PublicTomoXTransactionPoolAPI) GetOrderById(ctx context.Context, baseTo
return nil, err
}
orderIdHash := common.BigToHash(new(big.Int).SetUint64(orderId))
orderitem := tomoxState.GetOrder(tomox_state.GetOrderBookHash(baseToken,quoteToken), orderIdHash)
orderitem := tomoxState.GetOrder(tomox_state.GetOrderBookHash(baseToken, quoteToken), orderIdHash)
if orderitem.Quantity == nil || orderitem.Quantity.Sign() == 0 {
return nil, errors.New("Order not found")
}
Expand Down
2 changes: 1 addition & 1 deletion light/odr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"bytes"
"context"
"errors"
"github.com/ethereum/go-ethereum/consensus"
"github.com/tomochain/tomochain/consensus"
"math/big"
"testing"
"time"
Expand Down
Loading

0 comments on commit 0f4e52b

Please sign in to comment.