-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement bep100 update cosmos dependency * add upgrade height for FixFailAckPackage register channel * convert to bep20 supply in sync update token supply * distribute fee * the mirror and sync fee in package is already converted into BC amount * update dependency * enable account scripts for cross chain transfer * register upgrade height * send only no script execution error * include refund package into result * add transfer in tag * use idx other than address as refund exclude flag * use full refund instead of partial refund * publish mirror related events (#813) * update mirror config * move deduct fee from deliverTx * fix comments * add missing tags * fix transfer out fail ack handler issue * update schmema * update dependency * add old total supply for mirror sync event * fix mirror event Co-authored-by: HaoyangLiu <[email protected]>
- Loading branch information
1 parent
9b2dfd4
commit e017bfe
Showing
23 changed files
with
908 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package pub | ||
|
||
import "fmt" | ||
|
||
type Mirror struct { | ||
TxHash string | ||
ChainId string | ||
Type string | ||
RelayerFee int64 | ||
Sender string | ||
Contract string | ||
BEP20Name string | ||
BEP20Symbol string | ||
BEP2Symbol string | ||
OldTotalSupply int64 | ||
TotalSupply int64 | ||
Decimals int | ||
Fee int64 | ||
} | ||
|
||
func (msg Mirror) String() string { | ||
return fmt.Sprintf("Mirror: txHash: %s, sender: %s, bep2Symbol: %s", msg.TxHash, msg.Sender, msg.BEP2Symbol) | ||
} | ||
|
||
func (msg Mirror) ToNativeMap() map[string]interface{} { | ||
var native = make(map[string]interface{}) | ||
native["txHash"] = msg.TxHash | ||
native["chainId"] = msg.ChainId | ||
native["type"] = msg.Type | ||
native["relayerFee"] = msg.RelayerFee | ||
native["sender"] = msg.Sender | ||
native["contract"] = msg.Contract | ||
native["bep20Name"] = msg.BEP20Name | ||
native["bep20Symbol"] = msg.BEP20Symbol | ||
native["bep2Symbol"] = msg.BEP2Symbol | ||
native["oldTotalSupply"] = msg.OldTotalSupply | ||
native["totalSupply"] = msg.TotalSupply | ||
native["decimals"] = msg.Decimals | ||
native["fee"] = msg.Fee | ||
return native | ||
} | ||
|
||
// deliberated not implemented Ess | ||
type Mirrors struct { | ||
Height int64 | ||
Num int | ||
Timestamp int64 | ||
Mirrors []Mirror | ||
} | ||
|
||
func (msg Mirrors) String() string { | ||
return fmt.Sprintf("Mirrors in block %d, num: %d", msg.Height, msg.Num) | ||
} | ||
|
||
func (msg Mirrors) ToNativeMap() map[string]interface{} { | ||
var native = make(map[string]interface{}) | ||
native["height"] = msg.Height | ||
mirrors := make([]map[string]interface{}, len(msg.Mirrors), len(msg.Mirrors)) | ||
for idx, t := range msg.Mirrors { | ||
mirrors[idx] = t.ToNativeMap() | ||
} | ||
native["timestamp"] = msg.Timestamp | ||
native["num"] = msg.Num | ||
native["mirrors"] = mirrors | ||
return native | ||
} |
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
Oops, something went wrong.