-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from bttcprotocol/release_1.0.9
Release 1.0.9
- Loading branch information
Showing
9 changed files
with
124 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package fork | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/ethereum/go-ethereum/common/hexutil" | ||
) | ||
|
||
const ( | ||
MainChainID = "delivery-199" | ||
DonauChainID = "delivery-1029" | ||
InnerChainID = ":delivery-22125" | ||
//nolint:lll | ||
donauMultiChain = "0x7b22636861696e5f706172616d657465725f6d6170223a7b22657468223a7b2274785f636f6e6669726d6174696f6e73223a223634222c2261637469766174655f686569676874223a2230222c227374616b696e675f6d616e616765725f61646472657373223a22307866653331646132376262613964613638643564653633373464323538353566393935396138353238222c22736c6173685f6d616e616765725f61646472657373223a22307830303030303030303030303030303030303030303030303030303030303030303030303030303030222c22726f6f745f636861696e5f61646472657373223a22307832663661323032616437633638373362336362643166333937653939623262306262313438613837222c227374616b696e675f696e666f5f61646472657373223a22307834393963623131363637633031323834316161366432343166376533303032336336363366353435222c2273746174655f73656e6465725f61646472657373223a22307833356235336637653161623064373662636333633261666331656336373839313233343262336137227d2c22627363223a7b2274785f636f6e6669726d6174696f6e73223a223134222c2261637469766174655f686569676874223a22313030222c227374616b696e675f6d616e616765725f61646472657373223a22307862643034313530393434356366616561626566323261623462623332343930393138653561613533222c22736c6173685f6d616e616765725f61646472657373223a22307830303030303030303030303030303030303030303030303030303030303030303030303030303030222c22726f6f745f636861696e5f61646472657373223a22307865323331396562663066373831326466633064363533623532323566323161393362613139313937222c227374616b696e675f696e666f5f61646472657373223a22307830353537643166313261616336643230383733646639636336356434613066303631613738653536222c2273746174655f73656e6465725f61646472657373223a22307831303335653262336564306236323438346164393932626139383331643830313538326663343238227d7d7d" | ||
//nolint:lll | ||
innerMultiChain = "0x7b22636861696e5f706172616d657465725f6d6170223a7b22657468223a7b2274785f636f6e6669726d6174696f6e73223a223634222c2261637469766174655f686569676874223a2230222c227374616b696e675f6d616e616765725f61646472657373223a22307861353435333262626566333366366462643837353163303930663031323739666361633434633764222c22736c6173685f6d616e616765725f61646472657373223a22307830303030303030303030303030303030303030303030303030303030303030303030303030303030222c22726f6f745f636861696e5f61646472657373223a22307861326132333231616561623461626662396630656636353939626636333632376239656165333661222c227374616b696e675f696e666f5f61646472657373223a22307832376235633330313739633336656339613736393366626465383062656363356435636230333566222c2273746174655f73656e6465725f61646472657373223a22307839623036393962313431643739303630383535396637356231383037633066306635303030666631227d2c22627363223a7b2274785f636f6e6669726d6174696f6e73223a223136222c2261637469766174655f686569676874223a22313030222c227374616b696e675f6d616e616765725f61646472657373223a22307835323865633566626331333739656535383364306139623362373631316439383233313663323661222c22736c6173685f6d616e616765725f61646472657373223a22307830303030303030303030303030303030303030303030303030303030303030303030303030303030222c22726f6f745f636861696e5f61646472657373223a22307863353262386565623364353338353233626663613730383339616339366166303435613930333031222c227374616b696e675f696e666f5f61646472657373223a22307861326132333231616561623461626662396630656636353939626636333632376239656165333661222c2273746174655f73656e6465725f61646472657373223a22307839363132373366313335663966326635643330393362626537376362313662393266636461656133227d7d7d" | ||
) | ||
|
||
// newMarshalForkHeight json marshal height. | ||
var newMarshalForkHeight int64 | ||
|
||
// multiChainForkHeight multiChain. | ||
var multiChainForkHeight int64 | ||
|
||
// multiChainForkVal fork value. | ||
var multiChainForkVal = []byte{} | ||
|
||
func GetNewMarshalForkHeight() int64 { | ||
return newMarshalForkHeight | ||
} | ||
|
||
func GetMultiChainForkHeight() int64 { | ||
return multiChainForkHeight | ||
} | ||
|
||
func GetMultiChainForkVal() []byte { | ||
return multiChainForkVal | ||
} | ||
|
||
func UpdateForkConfig(chainID string) { | ||
var err error | ||
|
||
switch chainID { | ||
case MainChainID: | ||
// multiChain proposal:5 voting_end_time:2023-07-11T07:44:13. | ||
newMarshalForkHeight = 8604000 | ||
// 0:no need to fork. | ||
multiChainForkHeight = 0 | ||
multiChainForkVal = []byte{} | ||
case DonauChainID: | ||
// multiChain proposal:14. | ||
multiChainForkHeight = 12836457 | ||
newMarshalForkHeight = multiChainForkHeight + 1 | ||
|
||
multiChainForkVal, err = hexutil.Decode(donauMultiChain) | ||
if err != nil { | ||
log.Fatalln("decode donau multiChain value err", err) | ||
} | ||
case InnerChainID: | ||
// multiChain proposal:42. | ||
multiChainForkHeight = 11853136 | ||
newMarshalForkHeight = multiChainForkHeight + 1 | ||
|
||
multiChainForkVal, err = hexutil.Decode(innerMultiChain) | ||
if err != nil { | ||
log.Fatalln("decode test multiChain value err", err) | ||
} | ||
default: | ||
newMarshalForkHeight = 0 | ||
multiChainForkHeight = 0 | ||
multiChainForkVal = []byte{} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters