Skip to content

Commit

Permalink
move og_interface, consensus_interface, ogcrypto out of arefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
heeeeeng committed Aug 14, 2020
1 parent 27970d0 commit 41279ea
Show file tree
Hide file tree
Showing 120 changed files with 11,471 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion arefactor/core/og_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"github.com/annchain/OG/arefactor/consensus"
"github.com/annchain/OG/arefactor/dummy"
"github.com/annchain/OG/arefactor/og"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/ogsyncer"
"github.com/annchain/OG/arefactor/performance"
"github.com/annchain/OG/arefactor/rpc"
"github.com/annchain/OG/arefactor/transport_interface"
"github.com/annchain/OG/og_interface"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"path"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/core/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"github.com/annchain/OG/arefactor/consensus_interface"
"github.com/annchain/OG/arefactor/dummy"
"github.com/annchain/OG/arefactor/og"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/performance"
"github.com/annchain/OG/arefactor/transport"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/utilfuncs"
"github.com/latifrons/soccerdash"
"github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/dummy/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"fmt"
"github.com/annchain/OG/arefactor/consensus_interface"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/files"
"github.com/annchain/commongo/math"
"github.com/annchain/commongo/utilfuncs"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/event_go.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package arefactor

import (
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/OG/arefactor/transport_event"
"github.com/latifrons/goffchan"
)
Expand Down
5 changes: 3 additions & 2 deletions arefactor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/annchain/OG/arefactor
go 1.14

require (
github.com/annchain/OG v0.0.5
github.com/annchain/commongo v0.0.0-20200727100046-6b7cd76c21f4
github.com/annchain/OG v0.0.7
github.com/annchain/commongo v0.0.3
github.com/annchain/kyber/v3 v3.1.1
github.com/annchain/trie v0.0.0-20200810071945-f021089b234f
github.com/btcsuite/btcd v0.20.1-beta
Expand All @@ -23,4 +23,5 @@ require (
github.com/tinylib/msgp v1.1.2
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed
gopkg.in/go-playground/validator.v9 v9.29.1 // indirect
)
247 changes: 247 additions & 0 deletions arefactor/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion arefactor/og/community_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package og

import (
"github.com/annchain/OG/arefactor/og/message"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/transport"
"github.com/annchain/OG/arefactor/transport_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/utilfuncs"
"github.com/latifrons/goffchan"
"github.com/sirupsen/logrus"
Expand Down
4 changes: 2 additions & 2 deletions arefactor/og/core/accessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"strconv"
"sync"

ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
"github.com/annchain/OG/arefactor/utils/marshaller"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/marshaller"
"github.com/annchain/commongo/math"
"github.com/annchain/ogdb"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/account_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"container/heap"
"fmt"
"github.com/annchain/OG/arefactor/og/core/state"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"
log "github.com/sirupsen/logrus"
"sort"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/confirm_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"github.com/annchain/OG/arefactor/og/core/state"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"
"github.com/annchain/ogdb"
)
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"sync"

"github.com/annchain/OG/arefactor/og/core/state"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"
"github.com/annchain/ogdb"

Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"path/filepath"

"github.com/annchain/OG/arefactor/og"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/math"
"github.com/libp2p/go-libp2p-core/crypto"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/interface.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package core

import (
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"

// TODO move out evm package
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"fmt"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
)

type OgLedger struct {
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/processor_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"fmt"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"

// TODO move out evm package
Expand Down
4 changes: 2 additions & 2 deletions arefactor/og/core/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package core

import (
"fmt"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/utils/marshaller"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/marshaller"
)

type ReceiptStatus uint8
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/state/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package state

import (
ogTypes "github.com/annchain/OG/arefactor/og_interface"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"
)

Expand Down
6 changes: 3 additions & 3 deletions arefactor/og/core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/marshaller"
"math/big"

ogTypes "github.com/annchain/OG/arefactor/og_interface"
crypto "github.com/annchain/OG/arefactor/ogcrypto"
ogTypes "github.com/annchain/OG/og_interface"
crypto "github.com/annchain/OG/ogcrypto"
"github.com/annchain/commongo/math"
log "github.com/sirupsen/logrus"
)
Expand Down
6 changes: 3 additions & 3 deletions arefactor/og/core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package state

import (
"fmt"
"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/marshaller"
"sync"
"time"

ogTypes "github.com/annchain/OG/arefactor/og_interface"
crypto "github.com/annchain/OG/arefactor/ogcrypto"
ogTypes "github.com/annchain/OG/og_interface"
crypto "github.com/annchain/OG/ogcrypto"
"github.com/annchain/commongo/math"
"github.com/annchain/trie"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/state/statedb_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package state

import (
"fmt"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
ogTypes "github.com/annchain/OG/og_interface"
"sync"

"github.com/annchain/ogdb"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/state/statedb_interface.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package state

import (
ogTypes "github.com/annchain/OG/arefactor/og_interface"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"
)

Expand Down
4 changes: 2 additions & 2 deletions arefactor/og/core/state/token_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package state

import (
"fmt"
ogtypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/utils/marshaller"
ogtypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/marshaller"
"github.com/annchain/commongo/math"
"math/big"
)
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package core

import (
"fmt"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
ogTypes "github.com/annchain/OG/og_interface"
"math/rand"
"sort"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/core/tx_pool_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package core

import (
"github.com/annchain/OG/arefactor/og/core/state"
ogTypes "github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/types"
ogTypes "github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/math"

log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package og

import (
"github.com/annchain/OG/arefactor/og/message"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/transport_interface"
"github.com/annchain/OG/og_interface"
"github.com/latifrons/goffchan"
"github.com/sirupsen/logrus"
"time"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/engine_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package og

import (
"github.com/annchain/OG/arefactor/og/message"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/transport_interface"
"github.com/annchain/OG/og_interface"
"github.com/sirupsen/logrus"
)

Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/ledger_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package og

import (
"encoding/json"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/hexutil"
"github.com/libp2p/go-libp2p-core/crypto"
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/ledger_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package og

import (
"fmt"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/utilfuncs"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/network_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package og

import (
"encoding/json"
"github.com/annchain/OG/arefactor/og_interface"
"github.com/annchain/OG/arefactor/transport_interface"
"github.com/annchain/OG/og_interface"
"github.com/annchain/commongo/hexutil"
"github.com/libp2p/go-libp2p-core/crypto"
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/signers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package og

//import (
// "encoding/binary"
// "github.com/annchain/OG/arefactor/og_interface"
// "github.com/annchain/OG/og_interface"
// ogcrypto2 "github.com/annchain/OG/deprecated/ogcrypto"
// "github.com/annchain/OG/deprecated/ogcrypto_interface"
//)
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package og
//import (
// "bytes"
// "github.com/annchain/OG/arefactor/og/types"
// "github.com/annchain/OG/arefactor/og_interface"
// "github.com/annchain/OG/og_interface"
// "github.com/libp2p/go-libp2p-core/crypto"
// "golang.org/x/crypto/ripemd160"
//)
Expand Down
2 changes: 1 addition & 1 deletion arefactor/og_interface/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package og_interface
import (
"fmt"

"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/marshaller"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions arefactor/og_interface/address20.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"crypto/sha256"
"encoding/binary"
"fmt"
ogCrypto "github.com/annchain/OG/arefactor/ogcrypto"
"github.com/annchain/OG/arefactor/utils/marshaller"
ogCrypto "github.com/annchain/OG/ogcrypto"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/marshaller"
"github.com/annchain/commongo/math"
"github.com/annchain/commongo/utilfuncs"
"math/big"
Expand Down
12 changes: 11 additions & 1 deletion arefactor/og_interface/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package og_interface

import (
"fmt"
"math/big"

"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/marshaller"
)

const (
Expand Down Expand Up @@ -33,3 +34,12 @@ func UnmarshalHash(b []byte) (Hash, []byte, error) {
b, err := h.UnmarshalMsg(b)
return h, b, err
}

func BigToHash(b *big.Int, hashFlag byte) Hash {
switch hashFlag {
case FlagHash32:
return BigToHash32(b)
default:
return BigToHash32(b)
}
}
2 changes: 1 addition & 1 deletion arefactor/og_interface/hash32.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package og_interface
import (
"crypto/sha256"
"fmt"
"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/marshaller"
"github.com/annchain/commongo/math"
"github.com/annchain/commongo/utilfuncs"
"math/big"
Expand Down
4 changes: 2 additions & 2 deletions arefactor/og_interface/type_interface.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package og_interface

import (
"github.com/annchain/OG/arefactor/common/hexutil"
"github.com/annchain/OG/arefactor/utils/marshaller"
"github.com/annchain/commongo/hexutil"
"github.com/annchain/commongo/marshaller"
)

type FixLengthBytes interface {
Expand Down
2 changes: 1 addition & 1 deletion arefactor/ogcrypto/bn256/bn256_fast.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
package bn256

import "github.com/annchain/OG/arefactor/ogcrypto/bn256/cloudflare"
import "github.com/annchain/OG/ogcrypto/bn256/cloudflare"

// G1 is an abstract cyclic group. The zero value is suitable for use as the
// output of an operation, but cannot be used as an input.
Expand Down
Loading

0 comments on commit 41279ea

Please sign in to comment.