Skip to content

Commit

Permalink
Merge pull request #3 from electroneum/develop
Browse files Browse the repository at this point in the history
Testnet and Stagenet chain configurations; Minor bug fixes; Removed unused consensus; Update Go package refs
  • Loading branch information
andrepatta committed Jun 28, 2022
2 parents 8aa96d6 + 42003f0 commit 2409292
Show file tree
Hide file tree
Showing 967 changed files with 4,902 additions and 10,909 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: Test Build
run: |
make geth
make etn-sc
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,5 +1,5 @@
language: go
go_import_path: github.com/ethereum/go-ethereum
go_import_path: github.com/electroneum/electroneum-sc
sudo: false
jobs:
allow_failures:
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
script:
# Build the Android archive and upload it to Maven Central and Azure
- mkdir -p $GOPATH/src/github.com/ethereum
- ln -s `pwd` $GOPATH/src/github.com/ethereum/go-ethereum
- ln -s `pwd` $GOPATH/src/github.com/electroneum/electroneum-sc
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -signify SIGNIFY_KEY -deploy https://oss.sonatype.org -upload gethstore/builds

# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -23,7 +23,7 @@ RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]
ENTRYPOINT ["etn-sc"]

# Add some metadata labels to help programatic image consumption
ARG COMMIT=""
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Expand Up @@ -2,31 +2,31 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios evm all test clean
.PHONY: etn-sc android ios evm all test clean

GOBIN = ./build/bin
GO ?= latest
GORUN = env GO111MODULE=on go run

geth:
$(GORUN) build/ci.go install ./cmd/geth
etn-sc:
$(GORUN) build/ci.go install ./cmd/etn-sc
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."
@echo "Run \"$(GOBIN)/etn-sc\" to launch etn-sc."

all:
$(GORUN) build/ci.go install

android:
$(GORUN) build/ci.go aar --local
@echo "Done building."
@echo "Import \"$(GOBIN)/geth.aar\" to use the library."
@echo "Import \"$(GOBIN)/geth-sources.jar\" to add javadocs"
@echo "Import \"$(GOBIN)/etn-sc.aar\" to use the library."
@echo "Import \"$(GOBIN)/etn-sc-sources.jar\" to add javadocs"
@echo "For more info see https://stackoverflow.com/questions/20994336/android-studio-how-to-attach-javadoc"

ios:
$(GORUN) build/ci.go xcode --local
@echo "Done building."
@echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
@echo "Import \"$(GOBIN)/Etn-SC.framework\" to use the library."

test: all
$(GORUN) build/ci.go test
Expand Down
283 changes: 77 additions & 206 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Expand Up @@ -23,8 +23,8 @@ import (
"fmt"
"io"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/abi_test.go
Expand Up @@ -26,9 +26,9 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/common/math"
"github.com/electroneum/electroneum-sc/crypto"
)

const jsondata = `
Expand Down
14 changes: 7 additions & 7 deletions accounts/abi/bind/auth.go
Expand Up @@ -23,13 +23,13 @@ import (
"io"
"math/big"

"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/external"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/electroneum/electroneum-sc/accounts"
"github.com/electroneum/electroneum-sc/accounts/external"
"github.com/electroneum/electroneum-sc/accounts/keystore"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/core/types"
"github.com/electroneum/electroneum-sc/crypto"
"github.com/electroneum/electroneum-sc/log"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
16 changes: 8 additions & 8 deletions accounts/abi/bind/backend.go
Expand Up @@ -21,9 +21,9 @@ import (
"errors"
"math/big"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
electroneum "github.com/electroneum/electroneum-sc"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/core/types"
)

var (
Expand All @@ -50,7 +50,7 @@ type ContractCaller interface {

// CallContract executes an Ethereum contract call with the specified data as the
// input.
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error)
}

// PendingContractCaller defines methods to perform contract calls on the pending state.
Expand All @@ -61,7 +61,7 @@ type PendingContractCaller interface {
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)

// PendingCallContract executes an Ethereum contract call against the pending state.
PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error)
}

// ContractTransactor defines the methods needed to allow operating with a contract
Expand Down Expand Up @@ -92,7 +92,7 @@ type ContractTransactor interface {
// There is no guarantee that this is the true gas limit requirement as other
// transactions may be added or removed by miners, but it should provide a basis
// for setting a reasonable default.
EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
EstimateGas(ctx context.Context, call electroneum.CallMsg) (gas uint64, err error)

// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error
Expand All @@ -105,11 +105,11 @@ type ContractFilterer interface {
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error)

// SubscribeFilterLogs creates a background log filtering operation, returning
// a subscription immediately, which can be used to stream the found events.
SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error)
}

// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
Expand Down
58 changes: 29 additions & 29 deletions accounts/abi/bind/backends/simulated.go
Expand Up @@ -24,25 +24,25 @@ import (
"sync"
"time"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
electroneum "github.com/electroneum/electroneum-sc"
"github.com/electroneum/electroneum-sc/accounts/abi"
"github.com/electroneum/electroneum-sc/accounts/abi/bind"
"github.com/electroneum/electroneum-sc/common"
"github.com/electroneum/electroneum-sc/common/hexutil"
"github.com/electroneum/electroneum-sc/common/math"
"github.com/electroneum/electroneum-sc/consensus/ethash"
"github.com/electroneum/electroneum-sc/core"
"github.com/electroneum/electroneum-sc/core/bloombits"
"github.com/electroneum/electroneum-sc/core/rawdb"
"github.com/electroneum/electroneum-sc/core/state"
"github.com/electroneum/electroneum-sc/core/types"
"github.com/electroneum/electroneum-sc/core/vm"
"github.com/electroneum/electroneum-sc/eth/filters"
"github.com/electroneum/electroneum-sc/ethdb"
"github.com/electroneum/electroneum-sc/event"
"github.com/electroneum/electroneum-sc/log"
"github.com/electroneum/electroneum-sc/params"
"github.com/electroneum/electroneum-sc/rpc"
)

// This nil assignment ensures at compile time that SimulatedBackend implements bind.ContractBackend.
Expand Down Expand Up @@ -231,7 +231,7 @@ func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash common

receipt, _, _, _ := rawdb.ReadReceipt(b.database, txHash, b.config)
if receipt == nil {
return nil, ethereum.NotFound
return nil, electroneum.NotFound
}
return receipt, nil
}
Expand All @@ -252,7 +252,7 @@ func (b *SimulatedBackend) TransactionByHash(ctx context.Context, txHash common.
if tx != nil {
return tx, false, nil
}
return nil, false, ethereum.NotFound
return nil, false, electroneum.NotFound
}

// BlockByHash retrieves a block based on the block hash.
Expand Down Expand Up @@ -414,7 +414,7 @@ func (e *revertError) ErrorData() interface{} {
}

// CallContract executes a contract call.
func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
func (b *SimulatedBackend) CallContract(ctx context.Context, call electroneum.CallMsg, blockNumber *big.Int) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()

Expand All @@ -437,7 +437,7 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM
}

// PendingCallContract executes a contract call on the pending state.
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call electroneum.CallMsg) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
defer b.pendingState.RevertToSnapshot(b.pendingState.Snapshot())
Expand Down Expand Up @@ -482,7 +482,7 @@ func (b *SimulatedBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, erro

// EstimateGas executes the requested code against the currently pending block/state and
// returns the used amount of gas.
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
func (b *SimulatedBackend) EstimateGas(ctx context.Context, call electroneum.CallMsg) (uint64, error) {
b.mu.Lock()
defer b.mu.Unlock()

Expand Down Expand Up @@ -586,7 +586,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs

// callContract implements common code between normal and pending contract calls.
// state is modified during execution, make sure to copy it if necessary.
func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) {
func (b *SimulatedBackend) callContract(ctx context.Context, call electroneum.CallMsg, block *types.Block, stateDB *state.StateDB) (*core.ExecutionResult, error) {
// Gas prices post 1559 need to be initialized
if call.GasPrice != nil && (call.GasFeeCap != nil || call.GasTipCap != nil) {
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
Expand Down Expand Up @@ -679,7 +679,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
func (b *SimulatedBackend) FilterLogs(ctx context.Context, query electroneum.FilterQuery) ([]types.Log, error) {
var filter *filters.Filter
if query.BlockHash != nil {
// Block filter requested, construct a single-shot filter
Expand Down Expand Up @@ -711,7 +711,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter

// SubscribeFilterLogs creates a background log filtering operation, returning a
// subscription immediately, which can be used to stream the found events.
func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query electroneum.FilterQuery, ch chan<- types.Log) (electroneum.Subscription, error) {
// Subscribe to contract events
sink := make(chan []*types.Log)

Expand Down Expand Up @@ -744,7 +744,7 @@ func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethere
}

// SubscribeNewHead returns an event subscription for a new header.
func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
func (b *SimulatedBackend) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (electroneum.Subscription, error) {
// subscribe to a new head
sink := make(chan *types.Header)
sub := b.events.SubscribeNewHeads(sink)
Expand Down Expand Up @@ -798,7 +798,7 @@ func (b *SimulatedBackend) Blockchain() *core.BlockChain {

// callMsg implements core.Message to allow passing it as a transaction simulator.
type callMsg struct {
ethereum.CallMsg
electroneum.CallMsg
}

func (m callMsg) From() common.Address { return m.CallMsg.From }
Expand Down

0 comments on commit 2409292

Please sign in to comment.