Skip to content

Commit

Permalink
fix is_valid_description
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemka374 committed Aug 15, 2023
1 parent a06db05 commit aaa0903
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/src/governance/governor/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub trait GovernorInternal:
return Ok(true)
}

let pos = description.find("proposer=0x").unwrap();
let pos = description.find("proposer=0x").unwrap() + 11usize;
let address = &description[pos..];

if hex::decode(address).is_err() {
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/governance/governor.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ describe('Governor', function () {
'<description>#proposer=' + SS58ToHex(api, deployer.address)
)

console.log(SS58ToHex(api, deployer.address))

await expect(helper.propose(alice)).to.eventually.be.rejected

await api.disconnect()
Expand Down
4 changes: 0 additions & 4 deletions tests/e2e/governance/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ export class GovernorHelper {
throw new Error('Proposal not set')
}

console.log('Proposal ID: ', await this.calculateProposalId())

console.log((await this.governor?.query.propose([this.proposal!], this.description!))?.value.ok?.err)

if(proposer) {
await this.governor?.withSigner(proposer).tx.propose([this.proposal!], this.description!)
}
Expand Down

0 comments on commit aaa0903

Please sign in to comment.