Open nathanleclaire opened 2 years ago
@gagliardetto lmk if anything stands out to you
Hmmm so, some additional information from experimentation -- if I remove the device
instruction parameter (i.e., the Device
struct) -- I don't get the error. Perhaps the bindings aren't encoding the parameter correctly? (This is Anchor 0.24.2 by the way)
Splitting the Device
struct into individual args works...
(*solana.Transaction)(0x140000c60e0)(
├─ Signatures[len=1]
│ └─ 4MpGtFh84ntJTjqaFoHHgLzkpsaesxyWeL6MZCwFFpgiuX6fPxrhPacb3qDd3UjRCguQU1cmcGn7tvjSpUZRpbvf
├─ Message
│ ├─ RecentBlockhash: AmuXnDNuugCGUsUvbt6ai7Zwf3221GebJZVR332u5dyn
│ ├─ AccountKeys[len=4]
│ │ ├─ Gr1LZxEY1TGiVdJ4GvgKt9DSv9x6WUZaTS91nu3S3Ej3
│ │ ├─ 7YpAsJZQvapwo1pT2RQTg2zkFffHN5Au1MUoyUGuTWhr
│ │ ├─ 11111111111111111111111111111111
│ │ └─ EdUCoDdRnT5HsQ2Ejy3TWMTQP8iUyMQB4WzoNh45pNX9
│ └─ Header
│ ├─ NumRequiredSignatures: 1
│ ├─ NumReadonlySignedAccounts: 0
│ └─ NumReadonlyUnsignedAccounts: 2
└─ Instructions[len=1]
└─ Program: Worknet EdUCoDdRnT5HsQ2Ejy3TWMTQP8iUyMQB4WzoNh45pNX9
└─ Instruction: UpdateDevice
├─ Params[len=4]
│ ├─ Ipv4: ([4]uint8) (len=4 cap=4) {
│ │ 00000000 00 00 00 00 |....|
│ │ }
│ ├─ Hostname: (string) (len=3) "foo"
│ ├─ Bump: (uint8) 255
│ └─ Status: (worknet.DeviceStatus) Registered
└─ Accounts[len=3]
├─ deviceAuthority: Gr1LZxEY1TGiVdJ4GvgKt9DSv9x6WUZaTS91nu3S3Ej3 [WRITE, SIGN]
├─ device: 7YpAsJZQvapwo1pT2RQTg2zkFffHN5Au1MUoyUGuTWhr [WRITE]
└─ systemProgram: 11111111111111111111111111111111 []
)
But that's kind of a bummer, I expected to be able to pass a whole Device
struct. That should work right?
I'm getting back a weird error on my transaction --
the transaction message:
It's peculiar. I have the Go bindings working just fine with the
RegisterDevice
instruction, which is barely different fromUpdateDevice
that's throwing off the error here.My Anchor test for the same endpoint works fine 🤷
Any ideas?