[#280] ir: Add netmap processor unit tests
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
fb5dcc15d2
commit
d00b1c0d29
15 changed files with 690 additions and 41 deletions
|
@ -21,7 +21,7 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
|
|||
// check if notary transaction is valid, see #976
|
||||
if originalRequest := ev.NotaryRequest(); originalRequest != nil {
|
||||
tx := originalRequest.MainTransaction
|
||||
ok, err := np.netmapClient.Morph().IsValidScript(tx.Script, tx.Signers)
|
||||
ok, err := np.netmapClient.MorphIsValidScript(tx.Script, tx.Signers)
|
||||
if err != nil || !ok {
|
||||
np.log.Warn(logs.NetmapNonhaltNotaryTransaction,
|
||||
zap.String("method", "netmap.AddPeer"),
|
||||
|
@ -73,7 +73,7 @@ func (np *Processor) processAddPeer(ev netmapEvent.AddPeer) {
|
|||
|
||||
if nr := ev.NotaryRequest(); nr != nil {
|
||||
// create new notary request with the original nonce
|
||||
err = np.netmapClient.Morph().NotaryInvoke(
|
||||
err = np.netmapClient.MorphNotaryInvoke(
|
||||
np.netmapClient.ContractAddress(),
|
||||
0,
|
||||
nr.MainTransaction.Nonce,
|
||||
|
@ -117,7 +117,7 @@ func (np *Processor) processUpdatePeer(ev netmapEvent.UpdatePeer) {
|
|||
}
|
||||
|
||||
if nr := ev.NotaryRequest(); nr != nil {
|
||||
err = np.netmapClient.Morph().NotarySignAndInvokeTX(nr.MainTransaction)
|
||||
err = np.netmapClient.MorphNotarySignAndInvokeTX(nr.MainTransaction)
|
||||
} else {
|
||||
prm := netmapclient.UpdatePeerPrm{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue