hack/: fix linter warnings
This commit is contained in:
parent
28fb0f0ec8
commit
8f1ab74b53
|
@ -62,16 +62,16 @@ func main() {
|
||||||
sequence := uint64(time.Now().Unix())
|
sequence := uint64(time.Now().Unix())
|
||||||
timestamp := time.Now()
|
timestamp := time.Now()
|
||||||
|
|
||||||
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16", timestamp, sequence, true, false, "Submit should succeed") {
|
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16", timestamp, sequence, true, "Submit should succeed") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16", timestamp, sequence, true, false, "Already commited should succeed") {
|
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c16", timestamp, sequence, true, "Already commited should succeed") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
sequence += 10
|
sequence += 10
|
||||||
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c17", timestamp, sequence, false, true, "Bad emitter address should fail") {
|
if !testSubmit(ctx, logger, gk, wormchainConn, contract, "0000000000000000000000000290fb167208af455bb137780163b7b7a9a10c17", timestamp, sequence, false, "Bad emitter address should fail") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,6 @@ func testSubmit(
|
||||||
timestamp time.Time,
|
timestamp time.Time,
|
||||||
sequence uint64,
|
sequence uint64,
|
||||||
expectedResult bool,
|
expectedResult bool,
|
||||||
errorExpected bool,
|
|
||||||
tag string,
|
tag string,
|
||||||
) bool {
|
) bool {
|
||||||
EmitterAddress, _ := vaa.StringToAddress(emitterAddressStr)
|
EmitterAddress, _ := vaa.StringToAddress(emitterAddressStr)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//nolint:forcetypeassert //this is a hack
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -266,11 +266,13 @@ func process(txRpc *rpc.TransactionWithMeta) (*solana.PublicKey, error) {
|
||||||
program, err := solana.PublicKeyFromBase58(*solanaAddr)
|
program, err := solana.PublicKeyFromBase58(*solanaAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Invalid program address: %v", err)
|
log.Fatalf("Invalid program address: %v", err)
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tx, err := txRpc.GetTransaction()
|
tx, err := txRpc.GetTransaction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to unmarshal transaction: %v", err)
|
log.Fatalf("Failed to unmarshal transaction: %v", err)
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
signature := tx.Signatures[0]
|
signature := tx.Signatures[0]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
//nolint:noctx // this is a hack
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -401,7 +402,7 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if seq <= uint64(lowest) {
|
if seq <= lowest {
|
||||||
// We are done
|
// We are done
|
||||||
log.Println("Finished!")
|
log.Println("Finished!")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue