accountant: minor cleanup
This commit is contained in:
parent
b1525333eb
commit
bbec427145
|
@ -146,7 +146,7 @@ func tokenBridgeRegisterChain(req *nodev1.BridgeRegisterChain, timestamp time.Ti
|
|||
return v, nil
|
||||
}
|
||||
|
||||
// tokenBridgeUpgradeContract converts a nodev1.TokenBridgeRegisterChain message to its canonical VAA representation.
|
||||
// tokenBridgeModifyBalance converts a nodev1.TokenBridgeModifyBalance message to its canonical VAA representation.
|
||||
// Returns an error if the data is invalid.
|
||||
func tokenBridgeModifyBalance(req *nodev1.BridgeModifyBalance, timestamp time.Time, guardianSetIndex uint32, nonce uint32, sequence uint64) (*vaa.VAA, error) {
|
||||
if req.TargetChainId > math.MaxUint16 {
|
||||
|
|
|
@ -493,7 +493,7 @@ mod governance_packet_impl {
|
|||
}
|
||||
v => {
|
||||
return Err(Error::custom(format_args!(
|
||||
"invalid value: {v}, expected one of 1, 2"
|
||||
"invalid value: {v}, expected one of 1, 2, 3"
|
||||
)))
|
||||
}
|
||||
};
|
||||
|
|
|
@ -149,12 +149,9 @@ func (r BodyTokenBridgeModifyBalance) Serialize() []byte {
|
|||
reason := make([]byte, 32)
|
||||
|
||||
// truncate or pad "reason"
|
||||
for i := 0; i < len(reason); i += 1 {
|
||||
if i < len(r.Reason) {
|
||||
reason[i] = r.Reason[i]
|
||||
} else {
|
||||
reason[i] = ' '
|
||||
}
|
||||
count := copy(reason, r.Reason)
|
||||
for i := range reason[count:] {
|
||||
reason[i] = ' '
|
||||
}
|
||||
payload.Write(reason)
|
||||
|
||||
|
|
Loading…
Reference in New Issue